CI_2
This commit is contained in:
parent
e919d1a7e3
commit
daed345b1e
|
@ -357,16 +357,18 @@ class user{
|
|||
private $database = null;
|
||||
private $tools = null;
|
||||
public $auth = null;
|
||||
public $authenticated = false;
|
||||
|
||||
public function __construct($database, $tools){
|
||||
$this->database = $database;
|
||||
$this->tools = $tools;
|
||||
$this->auth = new \Delight\Auth\Auth($database->connection, $tools->get_ip(), DB_PREFIX."_", false);
|
||||
$this->authenticated = $this->auth->isLoggedIn();
|
||||
define("LOGIN", "OK");
|
||||
}
|
||||
|
||||
public function authenticated(){
|
||||
return $this->auth->isLoggedIn();
|
||||
return $this->authenticated;
|
||||
}
|
||||
|
||||
public function requirelogin(){
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
require_once 'ui.php';
|
||||
if($user->authenticated()){
|
||||
if($user->authenticated){
|
||||
$tools->redirect("list.php");
|
||||
}
|
||||
$error = false;
|
||||
|
|
Loading…
Reference in New Issue