/
User.php
52 lines (41 loc) · 1.08 KB
/
User.php
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
Class Dase_User_Exception extends Exception {}
/* the idea here is to enable the dase framework to be used independently of
* the dase application and so we need a generic user class to instantiates
* whatever user class the app is supplying
*/
Class Dase_User
{
public $eid;
public $is_serviceuser;
function __construct() {}
public static function get($db,$config)
{
$class_name = $config->getAppSettings('user_class');
if (class_exists($class_name)) {
//allows a DASe instance to be used
//as host for modules (no user required)
if ('Dase_User' == $class_name) {
return new Dase_User;
}
return new $class_name($db);
} else {
throw new Dase_User_Exception("Error: $class_name is not a valid class!");
}
}
//must be supplied by db user class:
public function retrieveByEid($eid)
{
return $this;
}
//must be supplied by db user class:
public function getUserCount()
{
return 1;
}
//must be supplied by db user class:
public function setHttpPassword($token)
{
return;
}
}