mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 18:49:17 -07:00
added dns&mail bulk operation support
This commit is contained in:
parent
03237bfa94
commit
daea2394cc
10 changed files with 258 additions and 91 deletions
79
web/bulk/dns/index.php
Normal file
79
web/bulk/dns/index.php
Normal file
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
$domain = $_POST['domain'];
|
||||
$record = $_POST['record'];
|
||||
$action = $_POST['action'];
|
||||
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
if (empty($record)) {
|
||||
switch ($action) {
|
||||
case 'delete': $cmd='v_delete_dns_domain';
|
||||
break;
|
||||
case 'suspend': $cmd='v_suspend_dns_domain';
|
||||
break;
|
||||
case 'unsuspend': $cmd='v_unsuspend_dns_domain';
|
||||
break;
|
||||
default: header("Location: /list/dns/"); exit;
|
||||
}
|
||||
} else {
|
||||
switch ($action) {
|
||||
case 'delete': $cmd='v_delete_dns_domain_record';
|
||||
break;
|
||||
case 'suspend': $cmd='v_suspend_dns_domain_record';
|
||||
break;
|
||||
case 'unsuspend': $cmd='v_unsuspend_dns_domain_record';
|
||||
break;
|
||||
default: header("Location: /list/dns/?domain=".$domain); exit;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (empty($record)) {
|
||||
switch ($action) {
|
||||
case 'delete': $cmd='v_delete_dns_domain';
|
||||
break;
|
||||
default: header("Location: /list/dns/"); exit;
|
||||
}
|
||||
} else {
|
||||
switch ($action) {
|
||||
case 'delete': $cmd='v_delete_dns_domain_record';
|
||||
break;
|
||||
default: header("Location: /list/dns/?domain=".$domain); exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (empty($record)) {
|
||||
foreach ($domain as $value) {
|
||||
// DNS
|
||||
$value = escapeshellarg($value);
|
||||
exec (VESTA_CMD.$cmd." ".$user." ".$value." no", $output, $return_var);
|
||||
$restart = 'yes';
|
||||
}
|
||||
} else {
|
||||
foreach ($record as $value) {
|
||||
// DNS Record
|
||||
$value = escapeshellarg($value);
|
||||
$dom = escapeshellarg($domain);
|
||||
exec (VESTA_CMD.$cmd." ".$user." ".$dom." ".$value." no", $output, $return_var);
|
||||
$restart = 'yes';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($restart)) {
|
||||
exec (VESTA_CMD."v_restart_dns", $output, $return_var);
|
||||
}
|
||||
|
||||
if (empty($record)) {
|
||||
header("Location: /list/dns/");
|
||||
exit;
|
||||
} else {
|
||||
header("Location: /list/dns/?domain=".$domain);
|
||||
exit;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue