From bcc682d15ccf7735e88079d3a5a1d16fed197c64 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Thu, 2 Dec 2010 06:14:20 +0000 Subject: [PATCH] * fix the error when checking hash. --- module/user/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/user/model.php b/module/user/model.php index f4fa8ce31b..11f6255827 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -210,12 +210,12 @@ class userModel extends model ->fetch(); /* If the length of $password is 32 or 40, checking by the auth hash. */ - if(strlen($password) == 32) + if($user and strlen($password) == 32) { $hash = $this->session->rand ? md5($user->password . $this->session->rand) : $user->password; $user = $password == $hash ? $user : ''; } - elseif(strlen($password) == 40) + elseif($user and strlen($password) == 40) { $hash = sha1($user->account . $user->password . $user->last); $user = $password == $hash ? $user : '';