forked from SleepWalker/hoauth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDummyUserIdentity.php
More file actions
36 lines (32 loc) · 791 Bytes
/
DummyUserIdentity.php
File metadata and controls
36 lines (32 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* Simple DummyUserIdentity class to handle authentication in `yii-user` module
*
* @version 1.2.2
* @copyright Copyright © 2013 Sviatoslav Danylenko
* @author Sviatoslav Danylenko <dev@udf.su>
* @license PGPLv3 ({@link http://www.gnu.org/licenses/gpl-3.0.html})
* @link https://github.com/SleepWalker/hoauth
*/
class DummyUserIdentity extends CUserIdentity
{
private $_id;
public function __construct($id, $username)
{
$this->username = $username;
$this->_id = $id;
$this->errorCode=self::ERROR_NONE;
}
/**
* Authenticates a user.
* @return boolean whether authentication succeeds.
*/
public function authenticate()
{
return $this->errorCode==self::ERROR_NONE;
}
public function getId()
{
return $this->_id;
}
}