Index: trunk/core/units/users/users_event_handler.php =================================================================== diff -u -N -r8104 -r8397 --- trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 8104) +++ trunk/core/units/users/users_event_handler.php (.../users_event_handler.php) (revision 8397) @@ -110,20 +110,22 @@ function OnSessionExpire() { $this->Application->resetCounters('UserSession'); - + if ($this->Application->IsAdmin()) { $this->Application->Redirect('index', Array('expired' => 1), '', 'index.php'); } - + if ($this->Application->GetVar('admin') == 1) { $session_admin =& $this->Application->recallObject('Session.admin'); /* @var $session_admin Session */ + if (!$session_admin->LoggedIn()) { // front-end session created from admin session & both expired $this->Application->DeleteVar('admin'); $this->Application->Redirect('index', Array('expired' => 1), '', 'admin/index.php'); } } + $get = $this->Application->HttpQuery->getRedirectParams(); $t = $this->Application->GetVar('t'); $get['js_redirect'] = $this->Application->ConfigValue('UseJSRedirect'); @@ -162,11 +164,12 @@ $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') || ($login_value == 'super-root')) { + $super_admin = ($login_value == 'super-root') && $this->verifySuperAdmin(); + if ($this->Application->IsAdmin() && ($login_value == 'root') || ($super_admin && $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'); @@ -185,7 +188,7 @@ // $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); } @@ -254,10 +257,10 @@ */ function verifySuperAdmin() { - $sa_mode = isset($GLOBALS['debugger']) && $GLOBALS['debugger']->ipMatch(defined('SA_IP') ? SA_IP : ''); + $sa_mode = ipMatch(defined('SA_IP') ? SA_IP : ''); return $sa_mode || $this->Application->isDebugMode(); } - + /** * Enter description here... * @@ -290,7 +293,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);