mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 02:28:03 -07:00
suspend user
This commit is contained in:
parent
f91f23a727
commit
baab49bcc2
6 changed files with 170 additions and 0 deletions
49
web/suspend/user/index.php
Normal file
49
web/suspend/user/index.php
Normal file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
// Init
|
||||
//error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
$TAB = 'USER';
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
// Header
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
|
||||
|
||||
// Panel
|
||||
top_panel($user,$TAB);
|
||||
|
||||
// Are you admin?
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
|
||||
// Cancel
|
||||
if (!empty($_POST['back'])) {
|
||||
header("Location: /list/user/");
|
||||
}
|
||||
|
||||
// Ok
|
||||
if (!empty($_GET['user'])) {
|
||||
$v_username = escapeshellarg($_GET['user']);
|
||||
exec (VESTA_CMD."v_suspend_user ".$v_username, $output, $return_var);
|
||||
if ($return_var != 0) {
|
||||
$error = implode('<br>', $output);
|
||||
if (empty($error)) $error = 'Error: vesta did not return any output.';
|
||||
$_SESSION['error_msg'] = $error;
|
||||
} else {
|
||||
$_SESSION['ok_msg'] = "OK: user <b>".$_GET[user]."</b> has been suspended.";
|
||||
unset($v_lname);
|
||||
}
|
||||
unset($output);
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_suspend_user.html');
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/suspend_user.html');
|
||||
unset($_SESSION['error_msg']);
|
||||
unset($_SESSION['ok_msg']);
|
||||
|
||||
} else {
|
||||
header("Location: /list/user/");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Footer
|
||||
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');
|
Loading…
Add table
Add a link
Reference in a new issue