hi friend, this code
//UserIdentity.php
$user = User::model()->findByAttributes(array('email'=>$this->username));
if ($user === null) {
8 $this->errorCode=self::ERROR_USERNAME_INVALID;
9 } else if ($user->pass !== hash_hmac('sha256',
10 $this->password,
11 Yii::app()->params['encryptionKey']) ) {
12 $this->errorCode=self::ERROR_PASSWORD_INVALID;
13 } else { // Okay!
14 $this->errorCode=self::ERROR_NONE;
15 $this->setState('type', $user->type);
16 $this->_id = $user->id;
17 }
18 return !$this->errorCode;
19 }
20 public function getId() {
21
#ask
array(‘email’=>$this->username)
1.‘email’, get from database or view?
2.$this->username , get from database or view?
- === dan !=== , equels 3x, what’s mean it? my know like this ==, 2x
//SiteController.php
$model->attributes= $_POST['User'];
1.$model->attributes, what’s mean?is it get all attributes that set on User.php
2.$_POST[‘User’] = ???get all value on view.php
than the last question
so, how log in with database, If someone login name there is in database or register not same name?
regards.