예제 #1
0
파일: My_User.class.php 프로젝트: cwcw/cms
 /**
  *@Decription : user login
  *
  *@Param : user name
  *@Param : password
  *
  *@return: int (0: success; 1:user not exists; 2:password wrong)
  */
 public function login($username, $password)
 {
     if (($userInfo = $this->getUserByName($username)) === false) {
         return 1;
     }
     if ($userInfo['pwd'] !== My_Kernel::encryptString($password)) {
         return 2;
     }
     //load user information into session
     $this->_initUserSession($userInfo);
     return 0;
 }