Update stored password hash on user login.

If an md5 hash is stored, a new hash will be calculated and stored.
This commit is contained in:
Kienan Stewart 2018-04-15 19:03:57 -04:00
parent b5382bb13b
commit 971e38778f
1 changed files with 6 additions and 0 deletions

View File

@ -104,6 +104,12 @@ class m_mem {
}
$this->user = $db->Record;
$cuid = $db->f("uid");
// Transitional code to update md5 hashed passwords to those created
// with password_hash().
if (strncmp($db->f('pass'), '$1$', 3) == 0) {
$db->query("update membres set pass = ? where uid = ?",
array(password_hash($password), $cuid));
}
if (panel_islocked() && $cuid != 2000) {
$msg->raise("ALERT", "mem", _("This website is currently under maintenance, login is currently disabled."));