aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/User.class.php
blob: eaadd3e5bcc7ed343c4617f62a3663e456a0d0bf (plain) (blame)
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
53
54
55
56
57
<?php
/**
 * wallabag, self hostable application allowing you to not miss any content anymore
 *
 * @category   wallabag
 * @author     Nicolas Lœuillet <nicolas@loeuillet.org>
 * @copyright  2013
 * @license    http://opensource.org/licenses/MIT see COPYING file
 */

class User
{
    public $id;
    public $username;
    public $name;
    public $password;
    public $email;
    public $config;

    function __construct($user = array())
    {
        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'];
        }
    }

    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;
    }
}