mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Issue 3015 - store timestamp when password is reset (#3863)
* Added few unsigned to ints in order to get rid of warnings. Added column to users table, for when password is changed(issue#3015). Moved password length check to separate method, to make it cleaner. * Added migration file and changed schema version to 27 due to servatrice.sql schema modification. * Make password length configurable.
This commit is contained in:
parent
e4c98e2ab8
commit
cd431594e2
10 changed files with 30 additions and 8 deletions
|
|
@ -953,7 +953,8 @@ bool Servatrice_DatabaseInterface::changeUserPassword(const QString &user,
|
|||
|
||||
QString passwordSha512 = PasswordHasher::computeHash(newPassword, PasswordHasher::generateRandomSalt());
|
||||
|
||||
passwordQuery = prepareQuery("update {prefix}_users set password_sha512=:password where name = :name");
|
||||
passwordQuery = prepareQuery("update {prefix}_users set password_sha512=:password, "
|
||||
"passwordLastChangedDate = NOW() where name = :name");
|
||||
passwordQuery->bindValue(":password", passwordSha512);
|
||||
passwordQuery->bindValue(":name", user);
|
||||
if (execSqlQuery(passwordQuery))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue