EliteConf
 All Data Structures Namespaces Files Functions Variables Pages
UserIdentity.php
Go to the documentation of this file.
1 <?php
2 
8 class UserIdentity extends CUserIdentity {
9 
18  private $_id;
19 
20  public function authenticate() {
21  $record = Users::model()->findByAttributes(array('username' => $this->username));
22  if ($record === null)
23  $this->errorCode = self::ERROR_USERNAME_INVALID;
24  else if ($record->password !== $this->password)
25  $this->errorCode = self::ERROR_PASSWORD_INVALID;
26  else {
27  $this->_id = $record->userid;
28  //$this->setState('title', $record->title);
29  $this->errorCode = self::ERROR_NONE;
30  }
31  return !$this->errorCode;
32  }
33 
34  public function getId() {
35  return $this->_id;
36  }
37 
38 }