forked from RaspberryPints/RaspberryPints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
41 lines (38 loc) · 1.04 KB
/
admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
session_start();
require_once __DIR__.'/includes/common.php';
require_once __DIR__.'/admin/includes/checklogin.php';
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login' && $_SERVER['REQUEST_METHOD'] === 'POST') {
# Check Login
if (ProcessLogin()) {
# Log an Audit
# Show admin page!
$_REQUEST['action'] = null;
} else {
#Add AUDITING and Fail2Ban/User Lockouts
$Smarty->assign('LoginError', 'Bad Username or Password');
}
}
if( !isset( $_SESSION['myusername'])){
# Do login
$Smarty->assign('Page', 'login');
$Smarty->display('frontend/layout.tpl');
exit;
}
if (!isset($_REQUEST['action'])) {
# Show default Admin Page
$Smarty->assign('Page', 'Home');
$Smarty->display('admin/layout.tpl');
exit;
}
switch($_REQUEST['action']) {
case 'personalize':
include 'admin/personalize.php';
break;
default:
# Show default Admin Page
$Smarty->assign('Page', 'Home');
$Smarty->display('admin/layout.tpl');
break;
}
?>