Index: trunk/core/units/users/users_event_handler.php =================================================================== diff -u -N -r8409 -r8413 --- trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 8409) +++ trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 8413) @@ -25,10 +25,10 @@ 'OnSubscribeUser' => Array('self' => true), 'OnRecommend' => Array('self' => true), - + 'OnItemBuild' => Array('self' => true), ); - + $this->permMapping = array_merge($this->permMapping, $permissions); } @@ -296,7 +296,7 @@ { $prefix_special = $this->Application->IsAdmin() ? 'u.current' : 'u'; // "u" used on front not to change theme $object =& $this->Application->recallObject($prefix_special, null, Array('skip_autoload' => true)); - + $next_template = $this->Application->GetVar('next_template'); if ($next_template == '_ses_redirect') { $location = $this->Application->BaseURL().$this->Application->RecallVar($next_template); @@ -1208,7 +1208,7 @@ } } - + /** * Checks, that currently loaded item is allowed for viewing (non permission-based) * @@ -1218,10 +1218,12 @@ function checkItemStatus(&$event) { $object =& $event->getObject(); - $status = $object->GetDBField('Status'); - + if (!$object->isLoaded()) { + return true; + } + $virtual_users = Array (-1, -2); // root, Guest - return ($status == STATUS_ACTIVE) || in_array($object->GetID(), $virtual_users); + return ($object->GetDBField('Status') == STATUS_ACTIVE) || in_array($object->GetID(), $virtual_users); } }