* complete task #209:identify function of module user support encrypted authentication.

This commit is contained in:
fujia
2010-06-30 10:03:32 +00:00
parent 84be9473f3
commit 233d42fb17
3 changed files with 9 additions and 1 deletions
+5
View File
@@ -168,9 +168,14 @@ class userModel extends model
$user = $this->dao->select('*')->from(TABLE_USER)
->where('account')->eq($account)
->beginIF(strlen($password) != 32)
->andWhere('password')->eq(md5($password))
->fi()
->andWhere('deleted')->eq(0)
->fetch();
if(strlen($password) == 32) $user = ($password == md5($user->password . $this->session->rand))?$user:'';
if($user)
{
$ip = $_SERVER['REMOTE_ADDR'];