From 8d3275bee488d058c6ff0efe6e81d20a584d3709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 6 Aug 2013 15:51:48 +0200 Subject: multi user --- inc/poche/User.class.php | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'inc/poche/User.class.php') 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 public $email; public $config; - function __construct($user) + function __construct($user = array()) { - $this->id = $user['id']; - $this->username = $user['username']; - $this->name = $user['name']; - $this->password = $user['password']; - $this->email = $user['email']; - $this->config = $user['config']; + if ($user != array()) { + $this->id = $user['id']; + $this->username = $user['username']; + $this->name = $user['name']; + $this->password = $user['password']; + $this->email = $user['email']; + $this->config = $user['config']; + } } - function getConfigValue($name) { + public function getId() + { + return $this->id; + } + + public function getUsername() + { + return $this->username; + } + + public function setConfig($config) + { + $this->config = $config; + } + + public function getConfigValue($name) { return (isset($this->config[$name])) ? $this->config[$name] : FALSE; } } \ No newline at end of file -- cgit v1.2.3