Users.php
public function hashPassword($password){
return CPasswordHelper::hashPassword($password);
}
public function validatePassword($password){
return CPasswordHelper::verifyPassword($password,$this->password);
}
UserIdentity.php
public function authenticate(){
$user = Users::model()->findByAttributes(array('login' => $this->username));
if($user === null){
$this->errorCode = self::ERROR_USERNAME_INVALID;
}else if(!$user->validatePassword($this->password)){
$this->errorCode = self::ERROR_PASSWORD_INVALID;
}else{
$this->_id = $user->id;
$this->setState('login', $user->login);
$this->errorCode = self::ERROR_NONE;
}
return $this->errorCode == self::ERROR_NONE;
}