Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IX-9.0.0-SUP-523 #6

Closed
wants to merge 159 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
17f1afb
Added KMC v6.0.6 JS files
ranyefet Jul 14, 2013
804e143
Set embed code textarea to read-only, updated view to use v6.0.6 JS
ranyefet Jul 14, 2013
ae6d993
Do not add Kaltura SEO links for paying customers
ranyefet Jul 14, 2013
d08dc6a
Added notice for preview page
ranyefet Jul 14, 2013
d47eb50
Added v6.0.7 JS release files
ranyefet Jul 14, 2013
dc2eb5e
moved kmc js files into directories
ranyefet Jul 14, 2013
5a24e28
test commit to branch
hilak Jul 16, 2013
6913874
Changed to move from using exec file, to use php code.
blItzkrIg1o1 Jul 15, 2013
13ce17e
change storage_profile tinyint parameters to integers
hilak Jul 16, 2013
1cb580d
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
hilak Jul 16, 2013
7063344
revert the FETCH_ASSOC change
blItzkrIg1o1 Jul 16, 2013
b20c6b9
checked featureStatus is not null as well
rotema Jul 16, 2013
cecc385
SUP 412 added missing part of the code fix
yossipapi Jul 16, 2013
292d57f
changed function signature
hilak Jul 16, 2013
722d148
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
hilak Jul 16, 2013
2b040a8
merge sql scripts for storage_profile and tag tables
hilak Jul 16, 2013
3d3019d
merge sql scripts for storage_profile and tag tables
hilak Jul 16, 2013
4deed85
revert commit comment
hilak Jul 17, 2013
500613e
remove referencews to taskConfig
hilak Jul 17, 2013
830e189
remove constants and add implementation of IKalturaDynamicEnum
hilak Jul 17, 2013
ee39c4a
Removing support in dc:external_url and replacing it with dc:url
blItzkrIg1o1 Jul 17, 2013
6296169
Merge branch 'IX-9.0.0' into IX-9.0.0-http-redirection
blItzkrIg1o1 Jul 17, 2013
8de0766
Moved preview page from kmc to extwidget
ranyefet Jul 17, 2013
f30111a
Updated preview to use extwidget instead of kmc
ranyefet Jul 17, 2013
0edabbd
Merge branch 'previewEmbedFixes' into IX-9.0.0
ranyefet Jul 17, 2013
7111f89
Support missing XML elements
Jul 17, 2013
204db42
Add permissions to list event notification template by admin console …
Jul 17, 2013
fa4104e
Add permissions to list event notification template by admin console …
Jul 17, 2013
bb5fed7
move download action to work with the new code.
blItzkrIg1o1 Jul 17, 2013
c9ef483
Merge branch 'IX-9.0.0' into IX-9.0.0-http-redirection
blItzkrIg1o1 Jul 17, 2013
7ba1bdb
Restore old preview action to support old links
ranyefet Jul 17, 2013
66cc281
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
ranyefet Jul 17, 2013
24ce9c7
add querystring if exists
ranyefet Jul 17, 2013
5cadeb1
die after redirect
ranyefet Jul 17, 2013
cb69bc5
error- null object reference. KontikiAPIWrapper::getUrn should not th…
hilak Jul 17, 2013
2df34ca
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
hilak Jul 17, 2013
2fe771e
Enable clone as is by passing null as the event notification template
Jul 17, 2013
45595ea
Prevent creation of new templates and enable clone of shared partner
Jul 17, 2013
f10a348
SUP 473 fix double in download url causing Amazon s3 to fail retrieving
yossipapi Jul 17, 2013
6b53e6f
forced contenttypetoretrun variable of function urlExists to be of type
yossipapi Jul 17, 2013
5de6275
added missing css
ranyefet Jul 17, 2013
81d5ca5
unset namespace if name is not given
rotema Jul 17, 2013
9fe8eed
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
rotema Jul 17, 2013
3eaf180
Support cloning templates
Jul 17, 2013
40edc0e
Load partial plugins after the javascript in order to enable the plugins
Jul 17, 2013
2e0d87e
replace references to $this->taskConfig and $this->kClient with KBatc…
hilak Jul 17, 2013
f14a6cc
fix syntax error : KalturaStorageProfile instead of StorageProfile
hilak Jul 18, 2013
1266d9c
migration of featuresStatus to featuresStatuses
rotema Jul 18, 2013
9e021ab
SUP-454 #time 1h #comment support partners which are set with
rotema Jul 18, 2013
aa0a154
change the conditions to work on any scope type
Jul 18, 2013
ea65d9e
fix errors after testing
hilak Jul 18, 2013
550dbdc
Redirect to www_host
ranyefet Jul 18, 2013
8cc26e3
updated 6.0.7 files
ranyefet Jul 18, 2013
4548c98
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
hilak Jul 18, 2013
cb6fdf8
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
ranyefet Jul 18, 2013
d1e4177
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
ranyefet Jul 18, 2013
959e850
Conditions extend generic Kaltura condition directly
Jul 18, 2013
3a828d6
Enable using metadata profile system name instead of id
Jul 18, 2013
487228c
merge changes re: storage job data
hilak Jul 18, 2013
6fe431e
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
hilak Jul 18, 2013
babb4a2
Apply dynamic values through the scope on the conditions
Jul 18, 2013
0302ba9
removed reference to non-existent class
hilak Jul 21, 2013
8f12867
kontikiAPIWrapper class changed from having static functions to class…
hilak Jul 21, 2013
6fbd39c
prevented a race condition between the file_exists and file_get_contents
erankor Jul 21, 2013
2b93a84
remove references to static $entrypoint
hilak Jul 21, 2013
ad95c57
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
hilak Jul 21, 2013
23678fd
added StorageExport Closer to the template batch configuration
hilak Jul 21, 2013
1fd92de
stroage export closer requires unique id
hilak Jul 21, 2013
c45f2c8
1. fix issue on category.php which fixes the problem of a category ch…
hilak Jul 21, 2013
0bfec76
making the mysql md5 func match the php's md5
rotema Jul 21, 2013
30cb46c
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
hilak Jul 21, 2013
c512336
Support description to be presented in the admin console
Jul 21, 2013
1f322af
Doc comment change only
Jul 21, 2013
6313a28
New condition type that returns true when specific field changed
Jul 21, 2013
7d06d00
kEventFieldCondition extends generic Kaltura kCondition
Jul 21, 2013
ea361a9
Added new user parameters attribute to be edited from the admin console
Jul 21, 2013
baa303d
zend client bug fix - in case of an error during multirequest should
erankor Jul 22, 2013
7d2c094
kalcli - added installation instructions for windows
erankor Jul 22, 2013
377466a
Avoid null in dynamic values strings
Jul 22, 2013
677c0b9
removed x-iframe-options header
ranyefet Jul 22, 2013
b788d93
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
ranyefet Jul 22, 2013
687abda
removed iframe check
ranyefet Jul 22, 2013
1b41e52
changes following code review
hilak Jul 22, 2013
d83e0d0
code review changes
hilak Jul 22, 2013
1e981da
BaseEnum moved to infra
hilak Jul 22, 2013
4db9e64
remove unnecessary class
hilak Jul 22, 2013
fd1c710
code review - not enough to check BatchJobType, need also to check Jo…
hilak Jul 22, 2013
8d0e2fd
undefined var $protocol
hilak Jul 22, 2013
134d5af
user $data->serveUrl instead of $data->entrypoint
hilak Jul 22, 2013
045d7dd
fixes following QA sanity
hilak Jul 22, 2013
0a266e6
Added event notification enums description
Jul 22, 2013
ee183fb
Only public methods are defined in interface
Jul 22, 2013
1439e08
Added MetadataEventNotifications, ContentDistributionEventNotifications
Jul 22, 2013
7920f39
Load KalturaMetadataFieldChangedCondition according to condition type
Jul 22, 2013
d1da51a
New condition type KalturaMetadataFieldChangedCondition
Jul 22, 2013
402bee2
kEventFieldCondition is new type of generic condition
Jul 22, 2013
fc25ce8
Expand EventNotificationEventObjectType
Jul 22, 2013
c01a5c1
Limit admin console UI to update action only
Jul 22, 2013
df3ba57
Create http notification template on shared partner
Jul 22, 2013
155a832
Server version IX-9.0.0
Jul 23, 2013
3f0b236
qnd: reverted my previous change to playlist execute (Pearson document
yossipapi Jul 23, 2013
ec91d97
ps:p-153215 Update comcast connector to include entryID in the feedURL
Jul 23, 2013
c1232d6
Merge branch 'IX-9.0.0-CR-091201' into IX-9.0.0
Jul 23, 2013
94513cb
fix for fatal error caused by calling a non-defined __construct function
hilak Jul 23, 2013
3a7df2f
Renamed from test to exec
Jul 23, 2013
428fc4c
Added description and changed emails to to bcc
Jul 23, 2013
8fb25e0
Enable null values on to, cc, bcc and replyTo
Jul 23, 2013
10b4242
Adding user parameters is not needed (for now)
Jul 23, 2013
9aa50fb
Added permission items for KalturaEventNotificationTemplate attributes
Jul 23, 2013
aeb9e87
create update query with NULL correctly and fix builder for BaseClasses
rotema Jul 23, 2013
18c8663
Merge branch 'IX-9.0.0' into FEC-343
hilak Jul 23, 2013
a712a96
Fix for PLAT-40
hilak Jul 23, 2013
10cac87
fix default criteria
hilak Jul 24, 2013
7c1b790
fix for KMS-982
hilak Jul 24, 2013
a74d6ee
PLAT 49 missing if caused fatal error
yossipapi Jul 24, 2013
ad2b0b7
kApiCache bug fix
erankor Jul 24, 2013
00c7b84
set statsDomain for http in order to support old players which werent…
etameran Jul 24, 2013
440c22b
PS:P-119904 Velocix integration
Jul 24, 2013
3718712
PS:P-119904 Velocix integration
Jul 24, 2013
984e240
PS:P-119904 Velocix integration
Jul 24, 2013
13d5eda
PS:P-119904 Velocix integration
Jul 24, 2013
74e653c
PS:P-119904 Velocix integration
Jul 24, 2013
509b993
PS:P-119904 Velocix integration
Jul 24, 2013
a6eda94
PS:P-119904 Velocix integration
Jul 24, 2013
f8c2f80
Merge branch 'IX-9.0.0-P-119904' into IX-9.0.0
Jul 24, 2013
31ee696
PLAT-44
Jul 24, 2013
8ce697f
Merge branch 'kwdiget-stats-domain' into IX-9.0.0
etameran Jul 24, 2013
a3d17c2
removed flag oldCustomDataValueWasNull, using custom_data_md5 instead
rotema Jul 24, 2013
1c9f586
Merge branch 'IX-9.0.0' into IX-9.0.0-ObjectBuilderFixes
rotema Jul 24, 2013
37679c5
changes to allow correct filtering according to category_kuser::status
hilak Jul 24, 2013
2bb0377
population should occur for deleted categoryKusers as well
hilak Jul 24, 2013
fdf8db9
fix- dual function definition
hilak Jul 24, 2013
03e172a
fix for case of array
hilak Jul 24, 2013
586497c
fixes after test
hilak Jul 24, 2013
070b631
Wrapped the HTTP notification with new KalturaHttpNotification object
Jul 24, 2013
7ec7a0f
Constructor removed from parent class
Jul 24, 2013
1a9fd98
Update the job id in the job data.
Jul 24, 2013
f095ce3
sphinx criterion fails on call to irrelevant function
hilak Jul 24, 2013
31c0c06
Dispatch method is protected by permissions, no need to disable it.
Jul 24, 2013
b75f7b5
Merge branch 'IX-9.0.0' into IX-9.0.0-category_kuser_status_fix
hilak Jul 24, 2013
6b2993f
Only arrays can't be set to null.
Jul 24, 2013
91cd40e
improved compatCheck support for kwidget action
erankor Jul 24, 2013
4bda203
prevert the logger from being initialized more than once
erankor Jul 24, 2013
1e6ea10
kwidget action optimization
erankor Jul 24, 2013
ccb59cb
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
erankor Jul 24, 2013
14fdc6a
added benchmarking for kwidget patching
erankor Jul 24, 2013
69315ce
serve actions caching bug fix
erankor Jul 24, 2013
8c011b4
kwidget changes bug fixes
erankor Jul 25, 2013
dd05b4a
PS:P-119904 Velocix integration - yet another hds url change
Jul 25, 2013
353a3b3
Merge branch 'IX-9.0.0-P-119904' into IX-9.0.0
Jul 25, 2013
d42e5f8
PS:P-119904 Velocix integration - initiate username and password in d…
Jul 25, 2013
b9e638b
Merge branch 'IX-9.0.0-P-119904' into IX-9.0.0
Jul 25, 2013
e1f28a7
fix references to taskConfig
hilak Jul 25, 2013
969842e
Merge branch 'IX-9.0.0' of https://github.com/kaltura/server into IX-…
hilak Jul 25, 2013
ba5a80f
Merge branch 'IX-9.0.0' into IX-9.0.0-PLAT-57
hilak Jul 25, 2013
0f1635a
Merge http-notification
Jul 25, 2013
ba4030f
Enable HTML elements in forms
Jul 25, 2013
d7f60de
SUP-523 #comment Added updated at field to the distribution Connectors
yossipapi Jul 25, 2013
e5c0215
SUP-523 #comment Added updated at field to the Remote Storage Profiles
yossipapi Jul 25, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Hercules 8.0.0
IX 9.0.0
59 changes: 59 additions & 0 deletions admin_console/configs/lang/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,65 @@
'Kaltura_Client_EventNotification_Enum_EventNotificationTemplateType::EMAIL' => 'Email',
'Kaltura_Client_EventNotification_Enum_EventNotificationTemplateType::HTTP' => 'HTTP',

'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::BATCH_JOB_STATUS' => 'Batch job status (Very dangerous)',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_ADDED' => 'Object added',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_CHANGED' => 'Object changed',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_COPIED' => 'Object copied',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_CREATED' => 'Object created',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_DATA_CHANGED' => 'Object data changed',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_DELETED' => 'Object deleted',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_ERASED' => 'Object erased',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_READY_FOR_REPLACMENT' => 'Object ready for replacment',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_SAVED' => 'Object saved',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_UPDATED' => 'Object updated',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventType::OBJECT_REPLACED' => 'Object replaced',

'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::AD_CUE_POINT' => 'Ad cue-point',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::ANNOTATION' => 'Annotation',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::CODE_CUE_POINT' => 'Code cue-point',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::CUE_POINT' => 'Cue-point',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::METADATA' => 'Metadata',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::ENTRY' => 'Entry',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::CATEGORY' => 'Category',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::ASSET' => 'Asset',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::FLAVORASSET' => 'Flavor asset',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::THUMBASSET' => 'Thumbnail asset',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::KUSER' => 'User',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::ACCESSCONTROL' => 'Access control',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::BATCHJOB' => 'Batch job',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::BULKUPLOADRESULT' => 'Bulk upload result',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::CATEGORYKUSER' => 'Category - User',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::CONVERSIONPROFILE2' => 'Conversion profile',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::FLAVORPARAMS' => 'Flavor params',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::FLAVORPARAMSCONVERSIONPROFILE' => 'Flavor params - Conversion profile',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::FLAVORPARAMSOUTPUT' => 'Flavor params output',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::GENERICSYNDICATIONFEED' => 'Generic syndication feed',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::KUSERTOUSERROLE' => 'User - User role',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::PARTNER' => 'Partner',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::PERMISSION' => 'Permission',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::PERMISSIONITEM' => 'Permission item',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::PERMISSIONTOPERMISSIONITEM' => 'Permission - Permission item',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::SCHEDULER' => 'Scheduler',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::SCHEDULERCONFIG' => 'Scheduler config',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::SCHEDULERSTATUS' => 'Scheduler status',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::SCHEDULERWORKER' => 'Scheduler worker',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::STORAGEPROFILE' => 'Storage profile',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::SYNDICATIONFEED' => 'Syndication feed',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::THUMBPARAMS' => 'Thumbnail params',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::THUMBPARAMSOUTPUT' => 'Thumbnail params output',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::UPLOADTOKEN' => 'Upload token',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::USERLOGINDATA' => 'User login data',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::USERROLE' => 'User role',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::WIDGET' => 'Widget',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::CATEGORYENTRY' => 'Category - Entry',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::DISTRIBUTION_PROFILE' => 'Distribution profile',
'Kaltura_Client_EventNotification_Enum_EventNotificationEventObjectType::ENTRY_DISTRIBUTION' => 'Entry distribution',


'Kaltura_Client_EmailNotification_Enum_EmailNotificationFormat::HTML' => 'HTML',
'Kaltura_Client_EmailNotification_Enum_EmailNotificationFormat::TEXT' => 'Text',


// user role
'user role intro text' => '',
);
Expand Down
2 changes: 2 additions & 0 deletions admin_console/views/scripts/partner/external-storages.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
<th><?php echo $this->translate('Trigger'); ?></th>
<th><?php echo $this->translate('Ready Behavior'); ?></th>
<th><?php echo $this->translate('Creation Date'); ?></th>
<th><?php echo $this->translate('Updated At'); ?></th>
<th><?php echo $this->translate('Action'); ?></th>
</tr>
</thead>
Expand All @@ -72,6 +73,7 @@
<td><?php echo $triggersNames[$storage->trigger]; ?></td>
<td><?php echo $this->enumTranslate('Kaltura_Client_Enum_StorageProfileReadyBehavior', $storage->readyBehavior); ?></td>
<td><?php echo $this->dateFormat($storage->createdAt, Zend_Date::DATE_LONG); ?></td>
<td><?php echo $this->dateFormat($storage->updatedAt, Zend_Date::DATE_LONG); ?></td>
<td>
<select class="options" onchange="doAction(this.value, <?php echo $storage->partnerId; ?>, <?php echo $storage->id; ?>)">
<option value=""><?php echo $this->translate('Select Action'); ?></option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,18 @@ public function __construct($not = false)
}

/**
* @param accessControl $accessControl
* @param kScope $scope
* @return bool
*/
protected function internalFulfilled(accessControl $accessControl)
protected function internalFulfilled(kScope $scope)
{
// no properties defined, the condition is fulfilled
if (count($this->getProperties()) == 0)
return true;

$scope = $accessControl->getScope();
if(!($scope instanceof accessControlScope))
return false;

$entryId = $scope->getEntryId();
$entryAssets = assetPeer::retrieveReadyByEntryId($scope->getEntryId());
foreach($entryAssets as $asset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ function getPrivileges()
/* (non-PHPdoc)
* @see kCondition::internalFulfilled()
*/
protected function internalFulfilled(accessControl $accessControl)
protected function internalFulfilled(kScope $scope)
{
$scope = $accessControl->getScope();
if(!($scope instanceof accessControlScope))
return false;

if (!$scope->getKs() || (!$scope->getKs() instanceof ks))
return false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public function setComparison($comparison)

/**
* Return single integer or array of integers
* @param accessControl $accessControl
* @param kScope $scope
* @return int|array<int> the field content
*/
abstract public function getFieldValue(accessControl $accessControl);
abstract public function getFieldValue(kScope $scope);

/**
* @return int
Expand Down Expand Up @@ -110,10 +110,10 @@ protected function fieldFulfilled($field, $value)
/* (non-PHPdoc)
* @see kCondition::internalFulfilled()
*/
protected function internalFulfilled(accessControl $accessControl)
protected function internalFulfilled(kScope $scope)
{
$field = $this->getFieldValue($accessControl);
$value = $this->getIntegerValue($accessControl->getScope());
$field = $this->getFieldValue($scope);
$value = $this->getIntegerValue($scope);

KalturaLog::debug("Copares field [$field] to value [$value]");
if (is_null($value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ abstract class kCondition
*/
protected $type;

/**
* @var string
*/
protected $description;

/**
* @var bool
*/
Expand All @@ -22,18 +27,26 @@ public function __construct($not = false)
}

/**
* @param accessControl $accessControl
* Enable changing the condition attributes according to additional data in the scope
*/
protected function applyDynamicValues(kScope $scope)
{
}

/**
* @param kScope $scope
* @return bool
*/
abstract protected function internalFulfilled(accessControl $accessControl);
abstract protected function internalFulfilled(kScope $scope);

/**
* @param accessControl $accessControl
* @param kScope $scope
* @return bool
*/
final public function fulfilled(accessControl $accessControl)
final public function fulfilled(kScope $scope)
{
return $this->calcNot($this->internalFulfilled($accessControl));
$this->applyDynamicValues($scope);
return $this->calcNot($this->internalFulfilled($scope));
}

/**
Expand All @@ -51,6 +64,22 @@ protected function setType($type)
{
$this->type = $type;
}

/**
* @return string $description
*/
public function getDescription()
{
return $this->description;
}

/**
* @param string $description
*/
public function setDescription($description)
{
$this->description = $description;
}

/**
* @return bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ function getGeoCoderType()
/* (non-PHPdoc)
* @see kCondition::getFieldValue()
*/
public function getFieldValue(accessControl $accessControl)
public function getFieldValue(kScope $scope)
{
$scope = $accessControl->getScope();
kApiCache::addExtraField(kApiCache::ECF_COUNTRY, kApiCache::COND_MATCH, $this->getStringValues($scope));

$ip = $scope->getIp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public function __construct($not = false)
/* (non-PHPdoc)
* @see kMatchCondition::getFieldValue()
*/
public function getFieldValue(accessControl $accessControl)
public function getFieldValue(kScope $scope)
{
$this->field->setScope($accessControl->getScope());
$this->field->setScope($scope);
return $this->field->getValue();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public function __construct($not = false)
/* (non-PHPdoc)
* @see kMatchCondition::getFieldValue()
*/
public function getFieldValue(accessControl $accessControl)
public function getFieldValue(kScope $scope)
{
$this->field->setScope($accessControl->getScope());
$this->field->setScope($scope);
return $this->field->getValue();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ public function __construct($not = false)
/* (non-PHPdoc)
* @see kCondition::getFieldValue()
*/
public function getFieldValue(accessControl $accessControl)
public function getFieldValue(kScope $scope)
{
$scope = $accessControl->getScope();
kApiCache::addExtraField(kApiCache::ECF_IP, kApiCache::COND_IP_RANGE, $this->getStringValues($scope));
return $scope->getIp();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ abstract class kMatchCondition extends kCondition
* @var array<kStringValue>
*/
protected $values;


/**
* @var array
*/
protected $dynamicValues;

/**
* @param array $values
*/
Expand All @@ -31,6 +36,15 @@ function getValues()
{
return $this->values;
}

/* (non-PHPdoc)
* @see kCondition::applyDynamicValues()
*/
protected function applyDynamicValues(kScope $scope)
{
parent::applyDynamicValues($scope);
$this->dynamicValues = $scope->getDynamicValues('{', '}');
}

/**
* @param kScope $scope
Expand All @@ -42,31 +56,40 @@ function getStringValues($scope = null)
return array();

$values = array();
$dynamicValuesKeys = null;
if(is_array($this->dynamicValues) && count($this->dynamicValues))
$dynamicValuesKeys = array_keys($this->dynamicValues);

foreach($this->values as $value)
{
/* @var $value kStringValue */
$calculatedValue = null;
if(is_object($value))
{
if($scope && $value instanceof kStringField)
$value->setScope($scope);
$values[] = $value->getValue();

$calculatedValue = $value->getValue();
}
else
{
$values[] = strval($value);
$calculatedValue = strval($value);
}

if($dynamicValuesKeys)
$calculatedValue = str_replace($dynamicValuesKeys, $this->dynamicValues, $calculatedValue);

$values[] = $calculatedValue;
}

return $values;
}

/**
* @param accessControl $accessControl
* @param kScope $scope
* @return string the field content
*/
abstract public function getFieldValue(accessControl $accessControl);
abstract public function getFieldValue(kScope $scope);

/**
* @param string $field
Expand Down Expand Up @@ -106,10 +129,10 @@ public function fieldFulfilled($field, $values)
/* (non-PHPdoc)
* @see kCondition::internalFulfilled()
*/
protected function internalFulfilled(accessControl $accessControl)
protected function internalFulfilled(kScope $scope)
{
$field = $this->getFieldValue($accessControl);
$values = $this->getStringValues($accessControl->getScope());
$field = $this->getFieldValue($scope);
$values = $this->getStringValues($scope);

KalturaLog::debug("Matches field [$field] to values [" . print_r($values, true) . "]");
if (!count($values))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@ public function __construct($not = false)
/* (non-PHPdoc)
* @see kCondition::getFieldValue()
*/
public function getFieldValue(accessControl $accessControl)
public function getFieldValue(kScope $scope)
{
$scope = $accessControl->getScope();
$referrer = $scope->getReferrer();
return requestUtils::parseUrlHost($referrer);
}

/* (non-PHPdoc)
* @see kCondition::internalFulfilled()
*/
protected function internalFulfilled(accessControl $accessControl)
protected function internalFulfilled(kScope $scope)
{
$scope = $accessControl->getScope();
$referrer = $scope->getReferrer();

if ($this->getNot()===true && !$this->globalWhitelistDomainsAppended && strpos($referrer, "kwidget") === false && kConf::hasParam("global_whitelisted_domains"))
Expand All @@ -56,7 +54,7 @@ protected function internalFulfilled(accessControl $accessControl)

kApiCache::addExtraField(kApiCache::ECF_REFERRER, kApiCache::COND_SITE_MATCH, $this->getStringValues($scope));

return parent::internalFulfilled($accessControl);
return parent::internalFulfilled($scope);
}

/* (non-PHPdoc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ public function __construct($not = false)
/* (non-PHPdoc)
* @see kCondition::getFieldValue()
*/
public function getFieldValue(accessControl $accessControl)
public function getFieldValue(kScope $scope)
{
$scope = $accessControl->getScope();
kApiCache::addExtraField(kApiCache::ECF_USER_AGENT, kApiCache::COND_REGEX, $this->getStringValues($scope));
return $scope->getUserAgent();
}
Expand Down
Loading