This commit is contained in:
Matteo Gheza 2020-09-13 13:38:18 +02:00
parent e919d1a7e3
commit daed345b1e
2 changed files with 4 additions and 2 deletions

View File

@ -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(){

View File

@ -1,6 +1,6 @@
<?php
require_once 'ui.php';
if($user->authenticated()){
if($user->authenticated){
$tools->redirect("list.php");
}
$error = false;