Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (15 sloc) 410 Bytes
<?php
defined('APP_DIR') or define('APP_DIR', __DIR__ . '/../app/');
include_once(APP_DIR . 'model/User.php');
include_once(APP_DIR . 'include/http.php');
$data = User::authenticated();
if (!$data || $data->access != 'admin') {
Http::redirect('index.php');
}
$username = Http::post_params()['username'];
$user = User::get($username);
if ($user) {
$user->delete();
}
Http::redirect('admin.php');
?>
You can’t perform that action at this time.