Move libraries to autoload format
This commit is contained in:
parent
7ac0f6c850
commit
b4f758f0b5
8 changed files with 1009 additions and 23 deletions
|
|
@ -86,8 +86,8 @@ class AppController extends TplController{
|
|||
|
||||
if($num_tries<5) {
|
||||
|
||||
$username=trim($_POST['username']);
|
||||
$password=trim($_POST['password']);
|
||||
$username=trim($_POST['username'] ?? '');
|
||||
$password=trim($_POST['password'] ?? '');
|
||||
|
||||
if($username=='') {
|
||||
|
||||
|
|
@ -104,6 +104,7 @@ class AppController extends TplController{
|
|||
$error=0;
|
||||
|
||||
$_SESSION['admin_login']=1;
|
||||
$_SESSION['date_login']=date("Y-m-d H:i:s");
|
||||
|
||||
if($arr_user['double_auth']) {
|
||||
|
||||
|
|
@ -253,15 +254,32 @@ class AppController extends TplController{
|
|||
|
||||
break;
|
||||
|
||||
case 'double_auth':
|
||||
case 'check_auth':
|
||||
|
||||
//Session expired.
|
||||
|
||||
if($this->check_login()) {
|
||||
|
||||
echo $this->tpl->load_template('check_auth', ['title' => 'Double auth']);
|
||||
if($_SERVER['REQUEST_METHOD']=='POST') {
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
echo $this->tpl->load_template('check_auth', ['title' => 'Double auth']);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'logout':
|
||||
|
||||
unset($_SESSION['admin_login']);
|
||||
unset($_SESSION['double_auth']);
|
||||
unset($_SESSION['date_login']);
|
||||
|
||||
header('Location: '.PhangoApp\PhaRouter\Url::make_url('admin'));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue