38 lines
750 B
PHP
38 lines
750 B
PHP
<?php
|
|
|
|
use PhangoApp\WPDO;
|
|
use PhaTemplates\Templates;
|
|
|
|
class TplController extends PhangoApp\PhaRouter\Controller {
|
|
|
|
public $tpl;
|
|
public $db;
|
|
|
|
public function __construct() {
|
|
|
|
session_start();
|
|
|
|
$table=new WPDO\WTable('useradmin', ['username', 'password', 'email', 'num_attempts']);
|
|
|
|
$this->db=new WPDO\WPDO(['useradmin' => $table]);
|
|
|
|
$this->tpl=new Templates(['theme/admin/templates', 'modules/admin/templates']);
|
|
|
|
}
|
|
|
|
public function check_login() {
|
|
|
|
if(isset($_SESSION['admin_login'])) {
|
|
|
|
return true;
|
|
|
|
}
|
|
else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|