forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
49 lines (40 loc) · 1.28 KB
/
index.php
File metadata and controls
49 lines (40 loc) · 1.28 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
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');