From 306158d5fb74ec96f0c2321834f702ecb0874a7d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 18 May 2008 17:13:38 +0000 Subject: [PATCH] Fix for first admin login --- inc/modules/admin/admin-inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 4d3cde5ab7..899bd4c36a 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -79,7 +79,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) } } - //* DEBUG: */ echo "*".$pass."/".md5($password)."/".$ret."
"; + /* DEBUG: */ echo "*".$pass."/".md5($password)."/".$ret."
"; if ((strlen($pass) == 32) && ($pass == md5($password))) { // Generate new hash $pass = generateHash($password); @@ -96,6 +96,7 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) $salt = __SALT; // Check if password is same + //* DEBUG: */ echo "*".$ret.",".$pass.",".$password.",".$salt."*
\n"; if (($ret == "pass") && ($pass == generateHash($password, $salt)) && (!empty($salt))) { // Change the passord hash here $pass = generateHash($password); @@ -120,9 +121,16 @@ function CHECK_ADMIN_LOGIN ($admin_login, $password) } elseif ((empty($salt)) && ($ret == "pass")) { // Something bad went wrong $ret = "failed"; + } elseif ($ret == "done") { + // Try to login here if we have the old hashing way (sql_patches not installed?) + if (!LOGIN_ADMIN($admin_login, $pass)) { + // Something went wrong + $ret = "failed"; + } } // Return the result + //* DEBUG: */ die("RETURN=".$ret); return $ret; } -- 2.39.5