From: Roland Häder Date: Sun, 18 May 2008 17:13:38 +0000 (+0000) Subject: Fix for first admin login X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=306158d5fb74ec96f0c2321834f702ecb0874a7d;p=mailer.git Fix for first admin login --- 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; }