From 361f0ec7f3e5545e0fbb5d0b244ac2523fb2e0fe Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Tue, 12 Jun 2012 12:55:54 +0300 Subject: [PATCH] dns add domain page --- web/add/dns/index.php | 89 +++++++++++++++++++++++++++ web/list/user/index.php | 1 + web/templates/admin/add_dns.html | 62 +++++++++++++++++++ web/templates/admin/menu_add_dns.html | 15 +++++ web/templates/header.html | 4 +- 5 files changed, 169 insertions(+), 2 deletions(-) create mode 100644 web/add/dns/index.php create mode 100644 web/templates/admin/add_dns.html create mode 100644 web/templates/admin/menu_add_dns.html diff --git a/web/add/dns/index.php b/web/add/dns/index.php new file mode 100644 index 00000000..e40ad833 --- /dev/null +++ b/web/add/dns/index.php @@ -0,0 +1,89 @@ + $error) { + if ( $i == 0 ) { + $error_msg = $error; + } else { + $error_msg = $error_msg.", ".$error; + } + } + $_SESSION['error_msg'] = "Error: field ".$error_msg." can not be blank."; + } else { + + // Add DNS + exec (VESTA_CMD."v_add_dns_domain ".$user." ".$v_domain." ".$v_ip." ".$v_template." ".$v_exp." ".$v_soa." ".$v_ttl, $output, $return_var); + if ($return_var != 0) { + $error = implode('
', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } + unset($output); + + if (empty($_SESSION['error_msg'])) { + $_SESSION['ok_msg'] = "OK: domain ".$_POST[v_domain]." has been created successfully."; + unset($v_domain); + } + } + } + + exec (VESTA_CMD."v_list_dns_templates json", $output, $return_var); + $templates = json_decode(implode('', $output), true); + unset($output); + + exec (VESTA_CMD."v_list_user_ns ".$user." json", $output, $return_var); + $soa = json_decode(implode('', $output), true); + $v_soa = $soa[0]; + unset($output); + + $v_ttl = 14400; + $v_exp = date('Y-m-d', strtotime('+1 year')); + + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_add_dns.html'); + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns.html'); + unset($_SESSION['error_msg']); + unset($_SESSION['ok_msg']); +} + +// Footer +include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/list/user/index.php b/web/list/user/index.php index b68e3ad1..c8f529d9 100644 --- a/web/list/user/index.php +++ b/web/list/user/index.php @@ -17,6 +17,7 @@ if ($_SESSION['user'] == 'admin') { exec (VESTA_CMD."v_list_users json", $output, $return_var); check_error($return_var); $data = json_decode(implode('', $output), true); + $data = array_reverse($data); unset($output); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_user.html'); diff --git a/web/templates/admin/add_dns.html b/web/templates/admin/add_dns.html new file mode 100644 index 00000000..bab3b3ec --- /dev/null +++ b/web/templates/admin/add_dns.html @@ -0,0 +1,62 @@ + + + + + + +
+ + +
+
+ + +
+ + + + + + + + + + +
Domain
IP address
Template
Advanced Options ⇢
+ + + + + +
Domain Expiriation
SOA
TTL
+ + +
+
diff --git a/web/templates/admin/menu_add_dns.html b/web/templates/admin/menu_add_dns.html new file mode 100644 index 00000000..6efc585b --- /dev/null +++ b/web/templates/admin/menu_add_dns.html @@ -0,0 +1,15 @@ + + + + + diff --git a/web/templates/header.html b/web/templates/header.html index 144b6da7..96bfe59b 100644 --- a/web/templates/header.html +++ b/web/templates/header.html @@ -393,7 +393,7 @@ if (!empty($_SESSION['look'])) { .aliases { font-family: Arial; font-size: 12pt; - color: #999999; + color: #99a7af; padding: 0 0 0 8px; } @@ -407,7 +407,7 @@ if (!empty($_SESSION['look'])) { .fullname { font-family: Arial; font-size: 14pt; - color: #999999; + color: #99a7af; padding: 0 0 0 8px; }