Index: trunk/core/units/users/users_event_handler.php =================================================================== diff -u -N -r4524 -r4625 --- trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4524) +++ trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 4625) @@ -2,7 +2,21 @@ class UsersEventHandler extends InpDBEventHandler { - + /** + * Checks permissions of user + * + * @param kEvent $event + */ + function CheckPermission(&$event) + { + if ($event->Name == 'OnLogin' || $event->Name == 'OnLogout') { + // permission is checked in OnLogin event directly + return true; + } + + return parent::CheckPermission($event); + } + function OnSessionExpire() { if( $this->Application->IsAdmin() ) { @@ -127,12 +141,12 @@ $modules_helper =& $this->Application->recallObject('ModulesHelper'); if ($user_name != 'root') { // root is virtual user, so allow him to login to admin in any case - $ret = $this->Application->CheckPermission('ADMIN', 0); + $ret = $this->Application->CheckPermission('ADMIN', 1); } $ret = $ret && $modules_helper->checkLogin(); } else { - $ret = $this->Application->CheckPermission('LOGIN', 0); + $ret = $this->Application->CheckPermission('LOGIN', 1); } return $ret; }