From 28d66aac89615586f503cff7f04854f106c5a933 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 12 Sep 2012 13:53:37 +0300 Subject: [PATCH] refactoring dns section: new html formating --- bin/v_delete_dns_domain | 2 +- web/add/dns/index.php | 6 - web/edit/dns/index.php | 3 - web/list/dns/index.php | 7 - web/templates/admin/add_dns.html | 221 ++++++++++----- web/templates/admin/add_dns_rec.html | 163 +++++++---- web/templates/admin/add_web.html | 2 +- web/templates/admin/edit_dns.html | 165 +++++++---- web/templates/admin/edit_dns_rec.html | 132 ++++++--- web/templates/admin/edit_web.html | 2 +- web/templates/admin/list_dns.html | 312 ++++++++++++--------- web/templates/admin/list_dns_rec.html | 252 +++++++++-------- web/templates/admin/menu_add_dns.html | 15 - web/templates/admin/menu_add_dns_rec.html | 15 - web/templates/admin/menu_dns.html | 42 --- web/templates/admin/menu_dns_rec.html | 40 --- web/templates/admin/menu_edit_dns.html | 15 - web/templates/admin/menu_edit_dns_rec.html | 15 - web/templates/header.html | 19 +- web/templates/user/add_dns.html | 184 ++++++++---- web/templates/user/add_web.html | 2 +- web/templates/user/edit_dns.html | 131 ++++++--- web/templates/user/list_dns.html | 279 +++++++++++------- web/templates/user/list_dns_rec.html | 204 ++++++++------ web/templates/user/menu_dns.html | 16 -- web/templates/user/menu_dns_rec.html | 15 - 26 files changed, 1337 insertions(+), 922 deletions(-) delete mode 100644 web/templates/admin/menu_add_dns.html delete mode 100644 web/templates/admin/menu_add_dns_rec.html delete mode 100644 web/templates/admin/menu_dns.html delete mode 100644 web/templates/admin/menu_dns_rec.html delete mode 100644 web/templates/admin/menu_edit_dns.html delete mode 100644 web/templates/admin/menu_edit_dns_rec.html delete mode 100644 web/templates/user/menu_dns.html delete mode 100644 web/templates/user/menu_dns_rec.html diff --git a/bin/v_delete_dns_domain b/bin/v_delete_dns_domain index 96b1a312..bab2ac23 100755 --- a/bin/v_delete_dns_domain +++ b/bin/v_delete_dns_domain @@ -50,7 +50,7 @@ rm -f $HOMEDIR/$user/conf/dns/$domain.db #----------------------------------------------------------# # Deleting domain -sed -i "/$user\/conf\/dns\/$domain.db\"/d" /etc/named.conf +sed -i "/DOMAIN='$domain'/ d" $USER_DATA/dns.conf rm -f $USER_DATA/dns/$domain.conf # Decreasing domain value diff --git a/web/add/dns/index.php b/web/add/dns/index.php index c1fa300b..94d79daf 100644 --- a/web/add/dns/index.php +++ b/web/add/dns/index.php @@ -150,23 +150,17 @@ top_panel($user,$TAB); $v_ns4 = $nameservers[3]; unset($output); } - 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/menu_add_dns.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns.html'); } else { - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_add_dns.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/user/add_dns.html'); } unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); } else { $v_domain = $_GET['domain']; - - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_add_dns_rec.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/add_dns_rec.html'); unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); diff --git a/web/edit/dns/index.php b/web/edit/dns/index.php index c2b69c55..574567cd 100644 --- a/web/edit/dns/index.php +++ b/web/edit/dns/index.php @@ -140,10 +140,8 @@ top_panel($user,$TAB); } if ($_SESSION['user'] == 'admin') { - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_edit_dns.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_dns.html'); } else { - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_edit_dns.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/user/edit_dns.html'); } unset($_SESSION['error_msg']); @@ -200,7 +198,6 @@ top_panel($user,$TAB); } } - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_edit_dns_rec.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/edit_dns_rec.html'); unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']); diff --git a/web/list/dns/index.php b/web/list/dns/index.php index 64a0ac6f..c5413f38 100644 --- a/web/list/dns/index.php +++ b/web/list/dns/index.php @@ -20,8 +20,6 @@ if ($_SESSION['user'] == 'admin') { $data = json_decode(implode('', $output), true); $data = array_reverse($data); unset($output); - - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_dns.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_dns.html'); } else { exec (VESTA_CMD."v_list_dns_domain_records '".$user."' '".$_GET['domain']."' 'json'", $output, $return_var); @@ -29,19 +27,15 @@ if ($_SESSION['user'] == 'admin') { $data = json_decode(implode('', $output), true); $data = array_reverse($data); unset($output); - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_dns_rec.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_dns_rec.html'); } } else { - if (empty($_GET['domain'])){ exec (VESTA_CMD."v_list_dns_domains $user 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/user/menu_dns.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_dns.html'); } else { exec (VESTA_CMD."v_list_dns_domain_records '".$user."' '".$_GET['domain']."' 'json'", $output, $return_var); @@ -49,7 +43,6 @@ if ($_SESSION['user'] == 'admin') { $data = json_decode(implode('', $output), true); $data = array_reverse($data); unset($output); - include($_SERVER['DOCUMENT_ROOT'].'/templates/user/menu_dns_rec.html'); include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_dns_rec.html'); } diff --git a/web/templates/admin/add_dns.html b/web/templates/admin/add_dns.html index 3841c3b7..502243f0 100644 --- a/web/templates/admin/add_dns.html +++ b/web/templates/admin/add_dns.html @@ -1,72 +1,157 @@ - + + + + + + + + - - - - diff --git a/web/templates/admin/edit_dns.html b/web/templates/admin/edit_dns.html index fd018d6f..7018f36f 100644 --- a/web/templates/admin/edit_dns.html +++ b/web/templates/admin/edit_dns.html @@ -1,48 +1,119 @@ -
- - -
-
- - -
- - - - - - - -
Domain
IP address
Advanced Options ⇢
- - - - - - - -
Template
Domain Expiriation
TTL
Name Servers
- - -
-
-
+ + + + + +
+ + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ Domain +
+ + IP address +
+ + Advanced Options +
+ + + + + + + + + + + + + + + + + + + +
+ Template +
+ +
+ Domain Expiriation +
+ + TTL +
+ + Name Servers +
+ + + +
+
+
+ diff --git a/web/templates/admin/add_dns_rec.html b/web/templates/admin/add_dns_rec.html index 060ae73b..43b5250f 100644 --- a/web/templates/admin/add_dns_rec.html +++ b/web/templates/admin/add_dns_rec.html @@ -1,58 +1,109 @@ - + + + + + +
- - - - - -
- - -
-
- - -
- - - - - - - - - -
Domain
Record
Type
IP or Value
Priority (optional)
- - -
-
+
+ + + + + +
+ + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ Domain +
+ + Record +
+ + Type +
+ +
+ IP or Value +
+ + Priority (optional) +
+ + + +
+
+
diff --git a/web/templates/admin/add_web.html b/web/templates/admin/add_web.html index 0fb6d74d..1efe6591 100644 --- a/web/templates/admin/add_web.html +++ b/web/templates/admin/add_web.html @@ -98,7 +98,7 @@
- Advanced Options ⇢ + Advanced Options
- - - - -
- - - - -
-
- - -
-
- - - - - - - - - - -
Domain
IP address
Template
Domain Expiriation
SOA
TTL
- - -
-
+ + + + + + + + + +
+ + + + + +
+ + + + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ Domain +
+ + IP address +
+ + Template +
+ +
+ Domain Expiriation +
+ + SOA +
+ + TTL +
+ + + +
+
+
diff --git a/web/templates/admin/edit_dns_rec.html b/web/templates/admin/edit_dns_rec.html index 49cbf14a..7c1f5bc8 100644 --- a/web/templates/admin/edit_dns_rec.html +++ b/web/templates/admin/edit_dns_rec.html @@ -1,35 +1,99 @@ - - - - - -
- - - - -
-
- - -
-
- - - - - - - - - -
Domain
Record
Type
IP or Value
>
Priority (optional)
- - -
-
+ + + + + + + + + +
+ + + + + +
+ + + + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ Domain +
+ + Record +
+ + Type +
+ + IP or Value +
+ > +
+ Priority (optional) +
+ + + +
+
+
diff --git a/web/templates/admin/edit_web.html b/web/templates/admin/edit_web.html index d64b3dcd..577f4425 100644 --- a/web/templates/admin/edit_web.html +++ b/web/templates/admin/edit_web.html @@ -18,7 +18,7 @@ -
+ - - - - - - - - -
">
- - - - - - - - - -
list records add record edit - - "> -
" title="Confirmation"> -

Are you sure you want to domain?

-
-
- - delete -
-

Are you sure you want to delete domain?

-
-
- - - - +
- - - +
[] template
+ + + + +
- - - - - -
SOA:
TTL:
- - - - - -
Expire:
Records:
- - - - - + + + $value) { + ++$i; + if ($data[$key]['SUSPENDED'] == 'yes') { + $status = 'suspended'; + $spnd_action = 'unsuspend' ; + } else { + $status = 'active'; + $spnd_action = 'suspend' ; + } + ?> - -
-"; ?> + - - - - -
→ - -
-
-"; ?> -"; ?> -"; ?> + + + + + + +
">
+ + + + + + + + + + + +
list records add record edit + + "> +
" title="Confirmation"> +

Are you sure you want to domain?

+
+
+ + delete +
+

Are you sure you want to delete domain?

+
+
+ + + + + + + + + +
+ +
+ + + + + + +
+ +
+ [] template +
+
+ + + + + + + + + +
SOA:
TTL:
+
+ + + + + + + + + +
Expire:
Records:
+
+ + + + + + "; ?> + + + + + + +
+ +
+ + + "; ?> + "; ?> + "; ?> diff --git a/web/templates/admin/list_dns_rec.html b/web/templates/admin/list_dns_rec.html index d947ca57..a77b79a1 100644 --- a/web/templates/admin/list_dns_rec.html +++ b/web/templates/admin/list_dns_rec.html @@ -1,117 +1,149 @@ - - $value) { - ++$i; - if ($data[$key]['SUSPENDED'] == 'yes') { - $status = 'suspended'; - $spnd_action = 'unsuspend' ; - } else { - $status = 'active'; - $spnd_action = 'suspend' ; - } - ?> - + +
+ $value) { + ++$i; + if ($data[$key]['SUSPENDED'] == 'yes') { + $status = 'suspended'; + $spnd_action = 'unsuspend' ; + } else { + $status = 'active'; + $spnd_action = 'suspend' ; + } + ?> - - - + + + + +
- - - - -
">
-
- - - - - + -
edit - - "> -
" title="Confirmation"> -

Are you sure you want to record?

-
-
- - "> delete -
" title="Confirmation"> -

Are you sure you want to delete record?

-
-
+
+ + + + +
">
+
+ + + + + + + +
edit + + "> +
" title="Confirmation"> +

Are you sure you want to record?

+
+
+ + "> delete +
" title="Confirmation"> +

Are you sure you want to delete record?

+
+
+ + + + + + + +
+
- - - - - - - -
- - + "; ?> + + + + +
+ + +
+ - - - -
"; ?> - - → - - - - - -"; ?> -"; ?> -"; ?> -"; ?> + "; ?> + "; ?> + "; ?> + "; ?> diff --git a/web/templates/admin/menu_add_dns.html b/web/templates/admin/menu_add_dns.html deleted file mode 100644 index edb4b2f1..00000000 --- a/web/templates/admin/menu_add_dns.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/web/templates/admin/menu_add_dns_rec.html b/web/templates/admin/menu_add_dns_rec.html deleted file mode 100644 index 7b2567e5..00000000 --- a/web/templates/admin/menu_add_dns_rec.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/web/templates/admin/menu_dns.html b/web/templates/admin/menu_dns.html deleted file mode 100644 index b0315848..00000000 --- a/web/templates/admin/menu_dns.html +++ /dev/null @@ -1,42 +0,0 @@ - - -
-

.

-
- - - - - - - - - - -
diff --git a/web/templates/admin/menu_dns_rec.html b/web/templates/admin/menu_dns_rec.html deleted file mode 100644 index d56d3f86..00000000 --- a/web/templates/admin/menu_dns_rec.html +++ /dev/null @@ -1,40 +0,0 @@ - - -
-

.

-
- - - - - - - - - - diff --git a/web/templates/admin/menu_edit_dns.html b/web/templates/admin/menu_edit_dns.html deleted file mode 100644 index b63d919d..00000000 --- a/web/templates/admin/menu_edit_dns.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/web/templates/admin/menu_edit_dns_rec.html b/web/templates/admin/menu_edit_dns_rec.html deleted file mode 100644 index dfe0f656..00000000 --- a/web/templates/admin/menu_edit_dns_rec.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/web/templates/header.html b/web/templates/header.html index 2537256a..cd314dcd 100644 --- a/web/templates/header.html +++ b/web/templates/header.html @@ -59,7 +59,7 @@ .bottom { background: #ebe9dc; - color: #777; + color: #555; margin: 30 0 0 0; padding: 4 20 8 0; margin-left: auto; @@ -76,17 +76,17 @@ .bottom a:link { font-size: 8pt; text-decoration: none; - color: #777; + color: #555; } .bottom a:visited { text-decoration: none; - color: #777; + color: #555; } .bottom a:hover { text-decoration: underline; - color: #333; + color: #7fa1cb; } .nav { @@ -568,7 +568,7 @@ } .genpass { - color: #34536A; + color: #34536a; font-size: 8pt; font-family: Arial, sans-serif; padding: 0 5px 0 8px; @@ -577,20 +577,23 @@ } .genpass:hover { - color: #9ba68c; + color: #7fa1cb; } .add-advanced { - color: #34536A; + color: #34536a; font-size: 10pt; font-family: Arial, sans-serif; letter-spacing: 0.1em; + text-decoration: none; + border-bottom: 1px solid #f79b44; } .add-advanced:hover { - color: #9ba68c; + color: #7fa1cb; } + /* fixed header */ .fixed{ position: fixed; diff --git a/web/templates/user/add_dns.html b/web/templates/user/add_dns.html index 1491787a..c0e7667a 100644 --- a/web/templates/user/add_dns.html +++ b/web/templates/user/add_dns.html @@ -1,56 +1,134 @@ - + + + + + + + + - - - - + +
- - -
-
- - -
- - - - - - - -
Domain
IP address
+ -
Advanced Options ⇢
- - - - - -
Domain Expiriation
TTL
Name Servers
- - -
-
-
+ + + + diff --git a/web/templates/user/edit_dns.html b/web/templates/user/edit_dns.html index 6ce4c5f7..17df054a 100644 --- a/web/templates/user/edit_dns.html +++ b/web/templates/user/edit_dns.html @@ -1,35 +1,98 @@ -
+ + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ Domain +
+ + IP address +
+ + Advanced Options +
+ + + + + + + + + + + + + +
+ Domain Expiriation +
+ + TTL +
+ + Name Servers +
+ + + +
+
+
+ diff --git a/web/templates/user/add_web.html b/web/templates/user/add_web.html index 6c1f7e8e..e67c69a4 100644 --- a/web/templates/user/add_web.html +++ b/web/templates/user/add_web.html @@ -98,7 +98,7 @@
- Advanced Options ⇢ + Advanced Options
- - - - -
- - - - -
-
- - -
-
- - - - - - - - -
Domain
IP address
Domain Expiriation
SOA
TTL
- - -
-
+ + + + + +
+ +
+ + + + + +
+ + + + +
+
+ + + + +
+ + + + + + + + + + + + + + + + + + + +
+ Domain +
+ + IP address +
+ + Domain Expiriation +
+ + SOA +
+ + TTL +
+ + + +
+
+
diff --git a/web/templates/user/list_dns.html b/web/templates/user/list_dns.html index 1b308223..8a43941e 100644 --- a/web/templates/user/list_dns.html +++ b/web/templates/user/list_dns.html @@ -1,108 +1,179 @@ - - - $value) { - ++$i; - if ($data[$key]['SUSPENDED'] == 'yes') { - $status = 'suspended'; - $spnd_action = 'unsuspend' ; - } else { - $status = 'active'; - $spnd_action = 'suspend' ; - } - ?> - - - - - - - - -
- - - - - -
">
-
- - - - - - -
list records add record edit - - delete -
-

Are you sure you want to delete domain?

-
-
- - - - +
- - - +
[] template
+ + + + +
-
- - - -
SOA:
TTL:
-
- - - -
Expire:
Records:
-
- - +
+ + $value) { + ++$i; + if ($data[$key]['SUSPENDED'] == 'yes') { + $status = 'suspended'; + $spnd_action = 'unsuspend' ; + } else { + $status = 'active'; + $spnd_action = 'suspend' ; + } + ?> - -
-"; ?> + - - - - -
→ - -
-
-"; ?> -"; ?> -"; ?> + + + + + + +
">
+ + + + + + + + + + +
list records add record edit + + delete +
+

Are you sure you want to delete domain?

+
+
+ + + + + + + + + +
+ +
+ + + + + + +
+ +
+ [] template +
+
+ + + + + + + + + +
SOA:
TTL:
+
+ + + + + + + + + +
Expire:
Records:
+
+ + + + + + "; ?> + + + + + + +
+ +
+ + + "; ?> + "; ?> + "; ?> diff --git a/web/templates/user/list_dns_rec.html b/web/templates/user/list_dns_rec.html index 458628ec..02a04c4b 100644 --- a/web/templates/user/list_dns_rec.html +++ b/web/templates/user/list_dns_rec.html @@ -1,93 +1,125 @@ - - $value) { - ++$i; - if ($data[$key]['SUSPENDED'] == 'yes') { - $status = 'suspended'; - $spnd_action = 'unsuspend' ; - } else { - $status = 'active'; - $spnd_action = 'suspend' ; - } - ?> - + +
+ $value) { + ++$i; + if ($data[$key]['SUSPENDED'] == 'yes') { + $status = 'suspended'; + $spnd_action = 'unsuspend' ; + } else { + $status = 'active'; + $spnd_action = 'suspend' ; + } + ?> - - - + + + + +
- - - - -
">
-
- - - - + -
edit - - "> delete -
" title="Confirmation"> -

Are you sure you want to delete record?

-
-
+
+ + + + +
">
+
+ + + + + + +
edit + + "> delete +
" title="Confirmation"> +

Are you sure you want to delete record?

+
+
+ + + + + + + +
+
- - - - - - - -
- - + "; ?> + + + + +
+ + +
+ - - - -
"; ?> - - → - - - - - -"; ?> -"; ?> -"; ?> -"; ?> + "; ?> + "; ?> + "; ?> + "; ?> diff --git a/web/templates/user/menu_dns.html b/web/templates/user/menu_dns.html deleted file mode 100644 index 63ac3101..00000000 --- a/web/templates/user/menu_dns.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - -
diff --git a/web/templates/user/menu_dns_rec.html b/web/templates/user/menu_dns_rec.html deleted file mode 100644 index c695961d..00000000 --- a/web/templates/user/menu_dns_rec.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - -