Browse Source

login and activate are actions for guests, not for registered users

Signed-off-by: emanuele <emanuele45@gmail.com>
emanuele 12 years ago
parent
commit
b86776e8a5
2 changed files with 10 additions and 2 deletions
  1. 5 1
      Sources/LogInOut.php
  2. 5 1
      Sources/Register.php

+ 5 - 1
Sources/LogInOut.php

@@ -28,7 +28,11 @@ if (!defined('SMF'))
  */
 function Login()
 {
-	global $txt, $context, $scripturl;
+	global $txt, $context, $scripturl, $user_info;
+
+	// You are already logged in, go take a tour of the boards
+	if (!empty($user_info['id']))
+		redirectexit();
 
 	// In wireless?  If so, use the correct sub template.
 	if (WIRELESS)

+ 5 - 1
Sources/Register.php

@@ -522,7 +522,11 @@ function Register2($verifiedOpenID = false)
  */
 function Activate()
 {
-	global $context, $txt, $modSettings, $scripturl, $sourcedir, $smcFunc, $language;
+	global $context, $txt, $modSettings, $scripturl, $sourcedir, $smcFunc, $language, $user_info;
+
+	// Logged in users should not bother to activate their accounts
+	if (!empty($user_info['id']))
+		redirectexit();
 
 	loadLanguage('Login');
 	loadTemplate('Login');