Index: branches/5.2.x/core/units/categories/categories_event_handler.php =================================================================== diff -u -N -r14244 -r14474 --- branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 14244) +++ branches/5.2.x/core/units/categories/categories_event_handler.php (.../categories_event_handler.php) (revision 14474) @@ -1,6 +1,6 @@ Application->getUnitOption($event->Prefix,'StatusField'); - if (!$status_fields) { + $object =& $event->getObject(); + /* @var $object kDBItem */ + + if ( !$object->isLoaded() ) { return true; } - $status_field = array_shift($status_fields); - if ($status_field == 'Status' || $status_field == 'Enabled') { - $object =& $event->getObject(); - if (!$object->isLoaded()) { - return true; + if ( $object->GetDBField('Status') != STATUS_ACTIVE && $object->GetDBField('Status') != 4 ) { + if ( !$object->GetDBField('DirectLinkEnabled') || !$object->GetDBField('DirectLinkAuthKey') ) { + return false; } - return $object->GetDBField($status_field) == STATUS_ACTIVE || $object->GetDBField($status_field) == 4; + return $this->Application->GetVar('authkey') == $object->GetDBField('DirectLinkAuthKey'); } + return true; } @@ -1602,6 +1603,17 @@ $object->SetError('cust_RssSource', 'not_allowed', 'la_error_NotAllowed'); } } + + if ( !$object->GetDBField('DirectLinkAuthKey') ) { + $key_parts = Array ( + $object->GetID(), + $object->GetDBField('ParentId'), + $object->GetField('Name'), + 'b38' + ); + + $object->SetDBField('DirectLinkAuthKey', substr( md5( implode(':', $key_parts) ), 0, 20 )); + } } /**