diff options
Diffstat (limited to 'inc/poche/User.class.php')
-rw-r--r-- | inc/poche/User.class.php | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/inc/poche/User.class.php b/inc/poche/User.class.php index ef47730f..6dac7839 100644 --- a/inc/poche/User.class.php +++ b/inc/poche/User.class.php | |||
@@ -17,17 +17,34 @@ class User | |||
17 | public $email; | 17 | public $email; |
18 | public $config; | 18 | public $config; |
19 | 19 | ||
20 | function __construct($user) | 20 | function __construct($user = array()) |
21 | { | 21 | { |
22 | $this->id = $user['id']; | 22 | if ($user != array()) { |
23 | $this->username = $user['username']; | 23 | $this->id = $user['id']; |
24 | $this->name = $user['name']; | 24 | $this->username = $user['username']; |
25 | $this->password = $user['password']; | 25 | $this->name = $user['name']; |
26 | $this->email = $user['email']; | 26 | $this->password = $user['password']; |
27 | $this->config = $user['config']; | 27 | $this->email = $user['email']; |
28 | $this->config = $user['config']; | ||
29 | } | ||
28 | } | 30 | } |
29 | 31 | ||
30 | function getConfigValue($name) { | 32 | public function getId() |
33 | { | ||
34 | return $this->id; | ||
35 | } | ||
36 | |||
37 | public function getUsername() | ||
38 | { | ||
39 | return $this->username; | ||
40 | } | ||
41 | |||
42 | public function setConfig($config) | ||
43 | { | ||
44 | $this->config = $config; | ||
45 | } | ||
46 | |||
47 | public function getConfigValue($name) { | ||
31 | return (isset($this->config[$name])) ? $this->config[$name] : FALSE; | 48 | return (isset($this->config[$name])) ? $this->config[$name] : FALSE; |
32 | } | 49 | } |
33 | } \ No newline at end of file | 50 | } \ No newline at end of file |