HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
UserIdentity.php
Go to the documentation of this file.
1 <?php
2 
8 class UserIdentity extends CUserIdentity
9 {
18  public function authenticate()
19  {
20  $users=array(
21  // username => password
22  'demo'=>'demo',
23  'admin'=>'admin',
24  );
25  if(!isset($users[$this->username]))
26  $this->errorCode=self::ERROR_USERNAME_INVALID;
27  elseif($users[$this->username]!==$this->password)
28  $this->errorCode=self::ERROR_PASSWORD_INVALID;
29  else
30  $this->errorCode=self::ERROR_NONE;
31  return !$this->errorCode;
32  }
33 }