diff --git a/inc/AccountHistory.class.php b/inc/AccountHistory.class.php index eae6ecb5..ebdaa7ba 100644 --- a/inc/AccountHistory.class.php +++ b/inc/AccountHistory.class.php @@ -510,4 +510,22 @@ class AccountHistory extends AccountBase implements AccountInterface return $queryRes->acchistory_accountId; } + + /** + * Actualiza el hash de las cuentas en el histórico. + * + * @param $newHash string El nuevo hash de la clave maestra + * @return bool + */ + public static function updateAccountsMPassHash($newHash) + { + $query = 'UPDATE accHistory SET ' + . 'acchistory_mPassHash = :newHash ' + . 'WHERE acchistory_mPassHash = :oldHash'; + + $data['newHash'] = $newHash; + $data['oldHash'] = ConfigDB::getValue('masterPwd'); + + return DB::getQuery($query, __FUNCTION__, $data); + } } \ No newline at end of file diff --git a/inc/Crypt.class.php b/inc/Crypt.class.php index 196c1968..ff16174e 100644 --- a/inc/Crypt.class.php +++ b/inc/Crypt.class.php @@ -118,7 +118,10 @@ class Crypt $check = (hash("sha256", substr($checkedHash, 0, 64) . $pwd) == substr($checkedHash, 64, 64)); if ($check) { - ConfigDB::setValue('masterPwd', self::mkHashPassword($pwd)); + $newHash = self::mkHashPassword($pwd); + + AccountHistory::updateAccountsMPassHash($newHash); + ConfigDB::setValue('masterPwd', $newHash); Log::writeNewLog(_('Aviso'), _('Se ha regenerado el HASH de clave maestra. No es necesaria ninguna acción.')); } diff --git a/inc/themes/classic/account.inc b/inc/themes/classic/account.inc index f7b4e910..ab0ae406 100644 --- a/inc/themes/classic/account.inc +++ b/inc/themes/classic/account.inc @@ -226,7 +226,7 @@ $name): ?> + value="" >