suspend user

This commit is contained in:
Serghey Rodin 2012-05-22 20:21:06 +03:00
commit baab49bcc2
6 changed files with 170 additions and 0 deletions

View 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_unsuspend_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 unsuspended.";
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');