コード例 #1
0
ファイル: User.php プロジェクト: krisrita/udo
 /**
  * 验证密码
  * @param int $uid
  * @param string $password
  * @return true
  */
 public function checkPassword($uid, $password)
 {
     $tblUser = new DB_Howdo_User();
     $user = $tblUser->scalar("stuff_id, salt, password", "where stuff_id={$uid}");
     if (!$user) {
         return Common_Error::ERROR_USER_NOT_EXISTS;
     }
     if ($user['password'] != md5(md5($password . $user['salt']))) {
         return Common_Error::ERROR_USER_PASSWORD_WRONG;
     }
     return true;
 }