]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/User.class.php
fix pictures display when DOWNLOAD_PICTURES is enabled
[github/wallabag/wallabag.git] / inc / poche / User.class.php
index ef47730f46a401c2fc2060aecde55eeaf9c7a2ed..eaadd3e5bcc7ed343c4617f62a3663e456a0d0bf 100644 (file)
@@ -1,11 +1,11 @@
 <?php
 /**
- * poche, a read it later open source system
+ * wallabag, self hostable application allowing you to not miss any content anymore
  *
- * @category   poche
- * @author     Nicolas LÅ“uillet <support@inthepoche.com>
+ * @category   wallabag
+ * @author     Nicolas LÅ“uillet <nicolas@loeuillet.org>
  * @copyright  2013
- * @license    http://www.wtfpl.net/ see COPYING file
+ * @license    http://opensource.org/licenses/MIT see COPYING file
  */
 
 class User
@@ -17,17 +17,41 @@ 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;
+    }
+
+    /**
+     * Returns configuration entry for a user
+     *
+     * @param $name
+     * @return bool
+     */
+    public function getConfigValue($name)
+    {
         return (isset($this->config[$name])) ? $this->config[$name] : FALSE;
     }
 }
\ No newline at end of file