Index: trunk/core/units/users/users_event_handler.php =================================================================== diff -u -N -r8067 -r8078 --- trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 8067) +++ trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 8078) @@ -164,8 +164,11 @@ $this->Application->SetVar('save_username', $save_username); // cookie will be set on next refresh, but refresh won't occur if login error present, so duplicate cookie in HTTPQuery } - if ($this->Application->IsAdmin() && ($login_value == 'root')) { + if ($this->Application->IsAdmin() && ($login_value == 'root') || ($login_value == 'super-root')) { // logging in "root" (admin only) + $super_admin = ($login_value == 'super-root') && $this->verifySuperAdmin(); + $login_value = 'root'; + $root_password = $this->Application->ConfigValue('RootPass'); $password_formatter =& $this->Application->recallObject('kPasswordFormatter'); $test = $password_formatter->EncryptPassword($password, 'b38'); @@ -184,6 +187,10 @@ // $session->SetField('GroupList', implode(',', $groups) ); $this->Application->SetVar('u.current_id', $user_id); $this->Application->StoreVar('user_id', $user_id); + + if ($super_admin) { + $this->Application->StoreVar('super_admin', 1); + } $this->processLoginRedirect($event, $password); return true; @@ -243,6 +250,17 @@ } /** + * Checks that user is allowed to use super admin mode + * + * @return bool + */ + function verifySuperAdmin() + { + $sa_mode = isset($GLOBALS['debugger']) && $GLOBALS['debugger']->ipMatch(defined('SA_IP') ? SA_IP : ''); + return $sa_mode || $this->Application->isDebugMode(); + } + + /** * Enter description here... * * @param string $user_name