From f8178b16d7881f852c0ee9d0af31861c3de351b5 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 4 Feb 2014 11:21:19 +0200 Subject: [PATCH] same template for users and admin --- web/add/dns/index.php | 19 +- web/add/web/index.php | 5 - web/templates/user/add_dns.html | 143 ------------- web/templates/user/add_web.html | 365 -------------------------------- 4 files changed, 11 insertions(+), 521 deletions(-) delete mode 100644 web/templates/user/add_dns.html delete mode 100644 web/templates/user/add_web.html diff --git a/web/add/dns/index.php b/web/add/dns/index.php index e62f7a68..8f6ec6c8 100644 --- a/web/add/dns/index.php +++ b/web/add/dns/index.php @@ -40,14 +40,14 @@ if (!empty($_POST['ok'])) { $_SESSION['error_msg'] = __('Field "%s" can not be blank.',$error_msg); } else { // Add DNS - exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip." ".$v_ns1." ".$v_ns2." ".$v_ns3." ".$v_ns4, $output, $return_var); + exec (VESTA_CMD."v-add-dns-domain ".$user." ".$v_domain." ".$v_ip." ".$v_ns1." ".$v_ns2." ".$v_ns3." ".$v_ns4." no", $output, $return_var); check_return_code($return_var,$output); unset($output); // Change Expiriation date if ((!empty($_POST['v_exp'])) && ($_POST['v_exp'] != date('Y-m-d', strtotime('+1 year')))) { $v_exp = escapeshellarg($_POST['v_exp']); - exec (VESTA_CMD."v-change-dns-domain-exp ".$user." ".$v_domain." ".$v_exp, $output, $return_var); + exec (VESTA_CMD."v-change-dns-domain-exp ".$user." ".$v_domain." ".$v_exp." no", $output, $return_var); check_return_code($return_var,$output); unset($output); } @@ -55,7 +55,7 @@ if (!empty($_POST['ok'])) { // Change TTL if ((!empty($_POST['v_ttl'])) && ($_POST['v_ttl'] != '14400') && (empty($_SESSION['error_msg']))) { $v_ttl = escapeshellarg($_POST['v_ttl']); - exec (VESTA_CMD."v-change-dns-domain-ttl ".$user." ".$v_domain." ".$v_ttl, $output, $return_var); + exec (VESTA_CMD."v-change-dns-domain-ttl ".$user." ".$v_domain." ".$v_ttl." no", $output, $return_var); check_return_code($return_var,$output); unset($output); } @@ -64,6 +64,13 @@ if (!empty($_POST['ok'])) { $_SESSION['ok_msg'] = __('DNS_DOMAIN_CREATED_OK',$_POST[v_domain],$_POST[v_domain]); unset($v_domain); } + + if (empty($_SESSION['error_msg'])) { + exec (VESTA_CMD."v-restart-dns", $output, $return_var); + check_return_code($return_var,$output); + unset($output); + } + } } @@ -120,11 +127,7 @@ if ((empty($_GET['domain'])) && (empty($_POST['domain']))) { } if (empty($v_ttl)) $v_ttl = 14400; if (empty($v_exp)) $v_exp = date('Y-m-d', strtotime('+1 year')); - if ($_SESSION['user'] == 'admin') { - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns.html'); - } else { - include($_SERVER['DOCUMENT_ROOT'].'/templates/user/add_dns.html'); - } + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns.html'); unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); } else { diff --git a/web/add/web/index.php b/web/add/web/index.php index 394fb7bc..db4f525e 100644 --- a/web/add/web/index.php +++ b/web/add/web/index.php @@ -272,12 +272,7 @@ $v_ftp_email = $panel[$user]['CONTACT']; $stats = json_decode(implode('', $output), true); unset($output); -// Are you admin? -if ($_SESSION['user'] == 'admin') { include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_web.html'); -} else { - include($_SERVER['DOCUMENT_ROOT'].'/templates/user/add_web.html'); -} unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); //} diff --git a/web/templates/user/add_dns.html b/web/templates/user/add_dns.html deleted file mode 100644 index e9fbb8d3..00000000 --- a/web/templates/user/add_dns.html +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - -
- - - - - -
- - -
-
- - - - -
- - - - - - - - - - - - - -
- -
- - -
- - -
- - - - - - - - - - - - - - - -
- () -
- - TTL -
- - -
- -
- - - -
-
- diff --git a/web/templates/user/add_web.html b/web/templates/user/add_web.html deleted file mode 100644 index a55e1797..00000000 --- a/web/templates/user/add_web.html +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - - - -
- - - - - -
- - - - -
-
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -
- -
- > -
- -
- > -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- onclick="javascript:elementHideShow('proxytable');"> -
- - - - - - - -
- -
- -
-
- / - -
- onclick="javascript:elementHideShow('ssltable');"> -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
- () -
- -
-
- -
- -
- -
- onclick="javascript:elementHideShow('statstable');"> -
- - - - - - - - - - -
- -
- - / -
- -
-
- -
- onclick="javascript:elementHideShow('ftptable');"> -
- - - - - - - - - - - - - - - - - - -
-
- -
- -
- / -
- - -
- -
- - - -
-
- - -