multi user

This commit is contained in:
Nicolas Lœuillet
2013-08-06 15:51:48 +02:00
parent 7ce7ec4c94
commit 8d3275bee4
8 changed files with 109 additions and 98 deletions

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