]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/User.class.php
multi user
[github/wallabag/wallabag.git] / inc / poche / User.class.php
index ef47730f46a401c2fc2060aecde55eeaf9c7a2ed..6dac7839719472e952b7ae6e356d3da1d310f3fa 100644 (file)
@@ -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