Fixes in controllers and login
This commit is contained in:
parent
9f21c3a87e
commit
7ac0f6c850
4 changed files with 197 additions and 31 deletions
|
|
@ -12,9 +12,11 @@ class TplController extends PhangoApp\PhaRouter\Controller {
|
|||
|
||||
session_start();
|
||||
|
||||
$table=new WPDO\WTable('useradmin', ['username', 'password', 'email', 'num_attempts']);
|
||||
$useradmin=new WPDO\WTable('useradmin', ['id', 'username', 'password', 'email', 'double_auth', 'auth_token']);
|
||||
|
||||
$this->db=new WPDO\WPDO(['useradmin' => $table]);
|
||||
$login_tries=new WPDO\WTable('login_tries', ['ip', 'num_tries', 'date']);
|
||||
|
||||
$this->db=new WPDO\WPDO(['useradmin' => $useradmin, 'login_tries' => $login_tries]);
|
||||
|
||||
$this->tpl=new Templates(['theme/admin/templates', 'modules/admin/templates']);
|
||||
|
||||
|
|
@ -24,6 +26,13 @@ class TplController extends PhangoApp\PhaRouter\Controller {
|
|||
|
||||
if(isset($_SESSION['admin_login'])) {
|
||||
|
||||
if(isset($_SESSION['double_auth'])) {
|
||||
|
||||
//header('Location: '.PhangoApp\PhaRouter\Url::make_url('admin', 'app', ['check_auth']));
|
||||
die;
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue