ソースを参照

Fix change password

ohartl 9 年 前
コミット
70b6463501
2 ファイル変更5 行追加2 行削除
  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 */
 		/** @var User $user */
 		$user = User::find($userId);
 		$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(
 		$thisMappings = array(
 			'username' => DBC_USERS_USERNAME,
 			'username' => DBC_USERS_USERNAME,
 			'domain' => DBC_USERS_DOMAIN,
 			'domain' => DBC_USERS_DOMAIN,
+			'password_hash' => DBC_USERS_PASSWORD,
 		);
 		);
 
 
 		if(defined('DBC_USERS_MAILBOXLIMIT')){
 		if(defined('DBC_USERS_MAILBOXLIMIT')){