2
0
Эх сурвалжийг харах

Revert "Failed tokens moved to adminLogin for a better user experience"

This reverts commit ef213355a23835488606002dc6acca525ca53d5f.
emanuele 12 жил өмнө
parent
commit
9151e1924c

+ 1 - 8
Sources/Security.php

@@ -764,7 +764,7 @@ function createToken($action, $type = 'post')
  */
 function validateToken($action, $type = 'post', $reset = true)
 {
-	global $modSettings, $sourcedir;
+	global $modSettings;
 
 	$type = $type == 'get' || $type == 'request' ? $type : 'post';
 
@@ -806,13 +806,6 @@ function validateToken($action, $type = 'post', $reset = true)
 		// I'm back baby.
 		createToken($action, $type);
 
-		// Need to type in a password for that, man.
-		if (!isset($_GET['xml']))
-		{
-			require_once($sourcedir . '/Subs-Auth.php');
-			adminLogin($type, $action);
-		}
-
 		fatal_lang_error('token_verify_fail', false);
 	}
 	// Remove this token as its useless

+ 1 - 4
Sources/Subs-Auth.php

@@ -193,7 +193,7 @@ function InMaintenance()
  *
  * @param string $type = 'admin'
  */
-function adminLogin($type = 'admin', $additionalToken = false)
+function adminLogin($type = 'admin')
 {
 	global $context, $scripturl, $txt, $user_info, $user_settings;
 
@@ -230,9 +230,6 @@ function adminLogin($type = 'admin', $additionalToken = false)
 	foreach ($_POST as $k => $v)
 		$context['post_data'] .= adminLogin_outputPostVars($k, $v);
 
-	if (!empty($additionalToken))
-		$context['post_data'] .= adminLogin_outputPostVars($context[$additionalToken . '_token_var'], $context[$additionalToken . '_token']);
-
 	// Now we'll use the admin_login sub template of the Login template.
 	$context['sub_template'] = 'admin_login';