1
0
mirror of https://github.com/serghey-rodin/vesta.git synced 2025-03-12 04:36:25 -07:00

65 lines
1.6 KiB
PHP
Raw Permalink Normal View History

2013-01-19 23:57:58 +04:00
<?php
// Init
error_reporting(NULL);
ob_start();
session_start();
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
2015-06-03 02:31:03 +03:00
// Check token
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
header('location: /login/');
exit();
2015-06-03 02:31:03 +03:00
}
2014-10-05 14:40:30 +03:00
// Check user
if ($_SESSION['user'] != 'admin') {
header("Location: /list/user");
exit;
}
2013-01-19 23:57:58 +04:00
2014-10-05 14:40:30 +03:00
if (!empty($_GET['user'])) {
$user=$_GET['user'];
2014-10-05 14:40:30 +03:00
}
// Mail domain
if ((!empty($_GET['domain'])) && (empty($_GET['account']))) {
$v_username = escapeshellarg($user);
$v_domain = escapeshellarg($_GET['domain']);
exec (VESTA_CMD."v-suspend-mail-domain ".$v_username." ".$v_domain, $output, $return_var);
check_return_code($return_var,$output);
unset($output);
$back=getenv("HTTP_REFERER");
2014-10-05 14:40:30 +03:00
if (!empty($back)) {
header("Location: ".$back);
2013-01-19 23:57:58 +04:00
exit;
}
2014-10-05 14:40:30 +03:00
header("Location: /list/mail/");
exit;
}
2013-01-19 23:57:58 +04:00
2014-10-05 14:40:30 +03:00
// Mail account
if ((!empty($_GET['domain'])) && (!empty($_GET['account']))) {
$v_username = escapeshellarg($user);
$v_domain = escapeshellarg($_GET['domain']);
$v_account = escapeshellarg($_GET['account']);
exec (VESTA_CMD."v-suspend-mail-account ".$v_username." ".$v_domain." ".$v_account, $output, $return_var);
check_return_code($return_var,$output);
unset($output);
2014-10-05 14:40:30 +03:00
$back = $_SESSION['back'];
if (!empty($back)) {
header("Location: ".$back);
2013-01-19 23:57:58 +04:00
exit;
}
2014-10-05 14:40:30 +03:00
header("Location: /list/mail/?domain=".$_GET['domain']);
exit;
2013-01-19 23:57:58 +04:00
}
$back = $_SESSION['back'];
if (!empty($back)) {
header("Location: ".$back);
2013-01-19 23:57:58 +04:00
exit;
}
2014-10-05 14:40:30 +03:00
2013-01-19 23:57:58 +04:00
header("Location: /list/mail/");
exit;