2019-04-04 15:18:27 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class User
|
|
|
|
{
|
|
|
|
protected $is_connected = false;
|
2019-04-04 15:58:20 +02:00
|
|
|
protected $external_id; //the user's ID on the external auth system (Object SID on LDAP)
|
|
|
|
protected $id; //the internal id to store locally user's datas
|
|
|
|
protected $display_name;
|
|
|
|
protected $auth_method;
|
2019-04-04 15:18:27 +02:00
|
|
|
protected $groups =array();
|
|
|
|
|
|
|
|
protected $db;
|
|
|
|
|
|
|
|
public function get_id()
|
|
|
|
{
|
|
|
|
if($this->is_connected){
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
public function is_connected()
|
|
|
|
{
|
|
|
|
return $this->is_connected;
|
|
|
|
}
|
2019-04-04 15:58:20 +02:00
|
|
|
|
2019-04-04 15:18:27 +02:00
|
|
|
public function get_auth_method()
|
|
|
|
{
|
|
|
|
if($this->is_connected){
|
|
|
|
return $this->auth_method;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
public function get_groups()
|
|
|
|
{
|
|
|
|
return $this->groups;
|
|
|
|
}
|
2019-04-04 15:58:20 +02:00
|
|
|
|
2019-04-11 16:41:28 +02:00
|
|
|
public function set_db(PDO $db){
|
|
|
|
$this->$db = $db;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function __construct(PDO $db){
|
2019-04-04 15:18:27 +02:00
|
|
|
$this->db = $db;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|