Browse Source

! Automatically enable moderator session (to access moderation center) after login, the same thing done for the admin panel

emanuele 13 years ago
parent
commit
e16e1b0b16
1 changed files with 7 additions and 0 deletions
  1. 7 0
      Sources/LogInOut.php

+ 7 - 0
Sources/LogInOut.php

@@ -105,6 +105,13 @@ function Login2()
 		if ($_GET['member'] != $user_info['id'])
 			fatal_lang_error('login_cookie_error', false);
 
+		$user_info['can_mod'] = allowedTo('access_mod_center') || (!$user_info['is_guest'] && ($user_info['mod_cache']['gq'] != '0=1' || $user_info['mod_cache']['bq'] != '0=1' || ($modSettings['postmod_active'] && !empty($user_info['mod_cache']['ap']))));
+		if ($user_info['can_mod'] && isset($user_settings['openid_uri']) && empty($user_settings['openid_uri']))
+		{
+			$_SESSION['moderate_time'] = time();
+			unset($_SESSION['just_registered']);
+		}
+
 		// Some whitelisting for login_url...
 		if (empty($_SESSION['login_url']))
 			redirectexit();