summaryrefslogtreecommitdiff
path: root/includes/sys_auth.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2016-11-15 22:08:41 +0100
committermsquare <msquare@notrademark.de>2016-11-15 22:08:41 +0100
commitf2630162e9e2cc1f71b8a7ebac8cd76b7b22d7ad (patch)
tree0149291f08e5289bf7598338d21ca560b9f29d80 /includes/sys_auth.php
parentac53559feac4948fc082b5384d3c0ca897f18cd0 (diff)
reduce complexity of password recovery controller
Diffstat (limited to 'includes/sys_auth.php')
-rw-r--r--includes/sys_auth.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/sys_auth.php b/includes/sys_auth.php
index 27a74ae8..135e49e3 100644
--- a/includes/sys_auth.php
+++ b/includes/sys_auth.php
@@ -39,7 +39,11 @@ function generate_salt($length = 16) {
* set the password of a user
*/
function set_password($uid, $password) {
- return sql_query("UPDATE `User` SET `Passwort` = '" . sql_escape(crypt($password, CRYPT_ALG . '$' . generate_salt(16) . '$')) . "', `password_recovery_token`=NULL WHERE `UID` = " . intval($uid) . " LIMIT 1");
+ $result = sql_query("UPDATE `User` SET `Passwort` = '" . sql_escape(crypt($password, CRYPT_ALG . '$' . generate_salt(16) . '$')) . "', `password_recovery_token`=NULL WHERE `UID` = " . intval($uid) . " LIMIT 1");
+ if ($result === false) {
+ engelsystem_error('Unable to update password.');
+ }
+ return $result;
}
/**