Skip to content
Permalink
Newer
Older
100644 19 lines (15 sloc) 410 Bytes
1
<?php
2
defined('APP_DIR') or define('APP_DIR', __DIR__ . '/../app/');
3
include_once(APP_DIR . 'model/User.php');
4
include_once(APP_DIR . 'include/http.php');
5
6
$data = User::authenticated();
7
if (!$data || $data->access != 'admin') {
8
Http::redirect('index.php');
9
}
10
11
$username = Http::post_params()['username'];
12
$user = User::get($username);
13
14
if ($user) {
15
$user->delete();
16
}
17
18
Http::redirect('admin.php');
19
?>
You can’t perform that action at this time.