-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.php
More file actions
36 lines (28 loc) · 798 Bytes
/
Copy pathindex.php
File metadata and controls
36 lines (28 loc) · 798 Bytes
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
<?php
require_once __DIR__ . "/UserManager.php";
require_once __DIR__ . "/UserController.php";
require_once __DIR__ . "/Firewall.php";
$config = require __DIR__."/config.php";
$userManager = new UserManager($config['files']['users']);
$firewall = new Firewall();
if (!$firewall->isAutenticated()) {
header("HTTP/1.1 401 Authorization Required");
header('WWW-Authenticate: Basic realm="Please login"');
die();
}
if (!isset($_GET['action']))
$_GET['action'] = '';
switch($_GET['action']) {
case 'updatePassword':
$controller = new UserController();
$controller->updatePassword();
break;
case 'listUsers':
$controller = new UserController();
$controller->index();
break;
case 'changePassword':
default:
$controller = new UserController();
$controller->editPassword();
}