2013-08-06 12:18:03 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2014-01-28 09:36:04 +00:00
|
|
|
* wallabag, self hostable application allowing you to not miss any content anymore
|
2013-08-06 12:18:03 +00:00
|
|
|
*
|
2014-01-28 09:36:04 +00:00
|
|
|
* @category wallabag
|
|
|
|
* @author Nicolas Lœuillet <nicolas@loeuillet.org>
|
2013-08-06 12:18:03 +00:00
|
|
|
* @copyright 2013
|
2014-07-11 14:03:59 +00:00
|
|
|
* @license http://opensource.org/licenses/MIT see COPYING file
|
2013-08-06 12:18:03 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
class User
|
|
|
|
{
|
|
|
|
public $id;
|
|
|
|
public $username;
|
|
|
|
public $name;
|
|
|
|
public $password;
|
|
|
|
public $email;
|
|
|
|
public $config;
|
|
|
|
|
2013-08-06 13:51:48 +00:00
|
|
|
function __construct($user = array())
|
2013-08-06 12:18:03 +00:00
|
|
|
{
|
2013-08-06 13:51:48 +00:00
|
|
|
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'];
|
|
|
|
}
|
2013-08-06 12:18:03 +00:00
|
|
|
}
|
|
|
|
|
2013-08-06 13:51:48 +00:00
|
|
|
public function getId()
|
|
|
|
{
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getUsername()
|
|
|
|
{
|
|
|
|
return $this->username;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setConfig($config)
|
|
|
|
{
|
|
|
|
$this->config = $config;
|
|
|
|
}
|
|
|
|
|
2014-07-11 14:03:59 +00:00
|
|
|
/**
|
|
|
|
* Returns configuration entry for a user
|
|
|
|
*
|
|
|
|
* @param $name
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function getConfigValue($name)
|
|
|
|
{
|
2013-08-06 12:18:03 +00:00
|
|
|
return (isset($this->config[$name])) ? $this->config[$name] : FALSE;
|
|
|
|
}
|
|
|
|
}
|