mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Automatic password rehashing added to admin login page.
This commit is contained in:
@@ -143,6 +143,7 @@ else
|
||||
}
|
||||
|
||||
// require_once (e_HANDLER.'user_handler.php');
|
||||
/** @var array $row */
|
||||
$row = $authresult = $obj->authcheck($_POST['authname'], $_POST['authpass'], varset($_POST['hashchallenge'], ''));
|
||||
|
||||
if ($row[0] == "authfail")
|
||||
@@ -155,6 +156,14 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$reHashedPass = e107::getUserSession()->rehashPassword($row,$_POST['authpass']);
|
||||
if($reHashedPass !==false)
|
||||
{
|
||||
e107::getLog()->add('ADMINPW_02', '', E_LOG_INFORMATIVE, '', LOG_TO_ADMIN, $row);
|
||||
$row['user_password'] = $reHashedPass;
|
||||
}
|
||||
|
||||
$cookieval = $row['user_id'].".".md5($row['user_password']);
|
||||
|
||||
// $sql->db_Select("user", "*", "user_name='".$tp -> toDB($_POST['authname'])."'");
|
||||
@@ -197,6 +206,9 @@ else
|
||||
// ---
|
||||
|
||||
e107::getEvent()->trigger("login", $edata_li);
|
||||
|
||||
|
||||
|
||||
e107::getRedirect()->redirect(e_ADMIN_ABS.'admin.php');
|
||||
//echo "<script type='text/javascript'>document.location.href='admin.php'</script>\n";
|
||||
}
|
||||
|
@@ -304,7 +304,7 @@ class UserHandler
|
||||
* If necessary, rehash the user password to the currently set algorythm and updated database. .
|
||||
* @param array $user - user fields. required: user_id, user_loginname, user_password
|
||||
* @param string $password - plain text password.
|
||||
* @return bool|str returns new password hash on success or false.
|
||||
* @return bool|string returns new password hash on success or false.
|
||||
*/
|
||||
public function rehashPassword($user, $password)
|
||||
{
|
||||
|
@@ -213,7 +213,7 @@ define("LAN_AL_WELCOME_05", "");
|
||||
// Admin Password
|
||||
//---------------
|
||||
define("LAN_AL_ADMINPW_01", "Admin password changed");
|
||||
|
||||
define("LAN_AL_ADMINPW_02", "Admin password rehashed");
|
||||
|
||||
// Banners Admin
|
||||
//--------------
|
||||
|
Reference in New Issue
Block a user