This commit is contained in:
Gnieark 2019-04-11 16:41:28 +02:00
parent 52fdd913db
commit 1ab397af86
2 changed files with 10 additions and 4 deletions

View File

@ -11,6 +11,8 @@ class User
protected $db;
public function get_id()
{
if($this->is_connected){
@ -35,7 +37,11 @@ class User
return $this->groups;
}
public function __construct($db){
public function set_db(PDO $db){
$this->$db = $db;
}
public function __construct(PDO $db){
$this->db = $db;
}

View File

@ -25,7 +25,7 @@ class User_Manager
);
";
const QUERY_CREATE_SYSTEM_USER = "INSERT INTO TABLE %table_users%
const QUERY_CREATE_SYSTEM_USER = "INSERT INTO %table_users%
(id,login,display_name,auth_method,active,created_time,created_by)
VALUES (0,'','SYSTEM','none',0, NOW(),0);";
@ -56,10 +56,10 @@ class User_Manager
private function create_local_tables(PDO $db)
public static function create_local_tables(PDO $db)
{
$searched = array('%table_users%','%table_groups%');
$replace = array(self::table_users,self::table_groups);
$replace = array(self::$table_users,self::$table_groups);
$queries = array(
str_replace($searched,$replace,self::QUERY_CREATE_TABLE_USERS),