Explorar o código

Fix change password

ohartl %!s(int64=9) %!d(string=hai) anos
pai
achega
70b6463501
Modificáronse 2 ficheiros con 5 adicións e 2 borrados
  1. 4 2
      include/php/classes/Auth.php
  2. 1 0
      include/php/models/User.php

+ 4 - 2
include/php/classes/Auth.php

@@ -229,7 +229,9 @@ class Auth
 		/** @var User $user */
 		$user = User::find($userId);
 
-		$user->setPasswordHash($passwordHash);
-		$user->save();
+		if(!is_null($user)){
+			$user->setPasswordHash($passwordHash);
+			$user->save();
+		}
 	}
 }

+ 1 - 0
include/php/models/User.php

@@ -26,6 +26,7 @@ class User extends AbstractModel
 		$thisMappings = array(
 			'username' => DBC_USERS_USERNAME,
 			'domain' => DBC_USERS_DOMAIN,
+			'password_hash' => DBC_USERS_PASSWORD,
 		);
 
 		if(defined('DBC_USERS_MAILBOXLIMIT')){