From d59de4c125d4b81ac16fa1597c4f325f67ca867e Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Sun, 20 May 2012 18:23:49 +0300 Subject: [PATCH] explict listing --- web/add/user/index.php | 17 +++++++++-------- web/css/jquery-custom-dialogs.css | 2 +- web/inc/main.php | 1 + web/templates/admin/add_user.html | 2 +- web/templates/admin/list_backup.html | 14 ++++++++++++++ web/templates/admin/list_cron.html | 14 ++++++++++++++ web/templates/admin/list_db.html | 14 ++++++++++++++ web/templates/admin/list_dns.html | 14 ++++++++++++++ web/templates/admin/list_dns_rec.html | 14 ++++++++++++++ web/templates/admin/list_ip.html | 14 ++++++++++++++ web/templates/admin/list_log.html | 15 +++++++++++++++ web/templates/admin/list_mail.html | 14 ++++++++++++++ web/templates/admin/list_mail_acc.html | 13 +++++++++++++ web/templates/admin/list_stats.html | 14 ++++++++++++++ web/templates/admin/list_user.html | 15 +++++++++++++++ web/templates/admin/list_web.html | 15 +++++++++++++++ web/templates/admin/menu_add_user.html | 2 +- web/templates/header.html | 15 +++++++++++++-- 18 files changed, 196 insertions(+), 13 deletions(-) diff --git a/web/add/user/index.php b/web/add/user/index.php index 30086f605..772a0e980 100644 --- a/web/add/user/index.php +++ b/web/add/user/index.php @@ -24,6 +24,14 @@ if ($_SESSION['user'] == 'admin') { // Ok if (!empty($_POST['ok'])) { // Check input + if (empty($_POST['v_username'])) $errors[] = 'user'; + if (empty($_POST['v_password'])) $errors[] = 'password'; + if (empty($_POST['v_package'])) $errrors[] = 'package'; + if (empty($_POST['v_email'])) $errors[] = 'email'; + if (empty($_POST['v_fname'])) $errors[] = 'first name'; + if (empty($_POST['v_lname'])) $errors[] = 'last name'; + + // Protect input $v_username = escapeshellarg($_POST['v_username']); $v_password = escapeshellarg($_POST['v_password']); $v_package = escapeshellarg($_POST['v_package']); @@ -31,13 +39,6 @@ if ($_SESSION['user'] == 'admin') { $v_fname = escapeshellarg($_POST['v_fname']); $v_lname = escapeshellarg($_POST['v_lname']); - if (empty($v_username)) $errors[] = 'user'; - if (empty($v_password)) $errors[] = 'password'; - if (empty($v_package)) $errrors[] = 'package'; - if (empty($v_email)) $errors[] = 'email'; - if (empty($v_fname)) $errors[] = 'first name'; - if (empty($v_lname)) $errors[] = 'last name'; - // Check for errors if (!empty($errors[0])) { foreach ($errors as $i => $error) { @@ -55,7 +56,7 @@ if ($_SESSION['user'] == 'admin') { if (empty($error)) $error = 'Error: vesta did not return any output.'; $_SESSION['error_msg'] = $error; } else { - $_SESSION['ok_msg'] = "OK: user ".$v_username." has been created successfully."; + $_SESSION['ok_msg'] = "OK: user ".$_POST[v_username]." has been created successfully."; unset($v_username); unset($v_password); unset($v_email); diff --git a/web/css/jquery-custom-dialogs.css b/web/css/jquery-custom-dialogs.css index 4730e6301..d35e06ab4 100644 --- a/web/css/jquery-custom-dialogs.css +++ b/web/css/jquery-custom-dialogs.css @@ -417,7 +417,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad */ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } .ui-dialog .ui-dialog-titlebar { padding: .4em 10pt; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .10pt 16px .10pt 0; } +.ui-dialog .ui-dialog-title { float: left; margin: .10pt 16px .10pt 0; font-family: Georgia; font-style: italic;} .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } diff --git a/web/inc/main.php b/web/inc/main.php index 686cf734e..0d2b30147 100644 --- a/web/inc/main.php +++ b/web/inc/main.php @@ -16,6 +16,7 @@ if (!empty($_SESSION['look'])&& $_SESSION['look'] != 'admin') { define('VESTA_CMD', '/usr/bin/sudo /usr/local/vesta/bin/'); +$i = 0; // Define functions function check_error($return_var){ diff --git a/web/templates/admin/add_user.html b/web/templates/admin/add_user.html index 84b19baa2..9fe85557f 100644 --- a/web/templates/admin/add_user.html +++ b/web/templates/admin/add_user.html @@ -36,7 +36,7 @@ document.v_add_user.v_password.value = randomstring; $value) { echo "\t\t\t\t\n"; diff --git a/web/templates/admin/list_backup.html b/web/templates/admin/list_backup.html index 30ca79f6d..404e562dc 100644 --- a/web/templates/admin/list_backup.html +++ b/web/templates/admin/list_backup.html @@ -2,6 +2,7 @@ $value) { + ++$i; $web = 'no'; $dns = 'no'; $mail = 'no'; @@ -63,3 +64,16 @@ foreach ($data as $key => $value) { } ?> + + + + +
→ + + listed
diff --git a/web/templates/admin/list_cron.html b/web/templates/admin/list_cron.html index e659e826e..9263c1db8 100644 --- a/web/templates/admin/list_cron.html +++ b/web/templates/admin/list_cron.html @@ -2,6 +2,7 @@ $value) { + ++$i; if ($data[$key]['SUSPENDED'] == 'yes') { $status = 'suspended'; $spnd_action = 'ususpend' ; @@ -80,3 +81,16 @@ foreach ($data as $key => $value) { } ?> + + + + +
→ + + listed
diff --git a/web/templates/admin/list_db.html b/web/templates/admin/list_db.html index ee3c3f21b..d3d191085 100644 --- a/web/templates/admin/list_db.html +++ b/web/templates/admin/list_db.html @@ -2,6 +2,7 @@ $value) { + ++$i; if ($data[$key]['SUSPENDED'] == 'yes') { $status = 'suspended'; $spnd_action = 'ususpend' ; @@ -64,3 +65,16 @@ foreach ($data as $key => $value) { } ?> + + + + +
→ + + listed
diff --git a/web/templates/admin/list_dns.html b/web/templates/admin/list_dns.html index ba5f13903..afd06c454 100644 --- a/web/templates/admin/list_dns.html +++ b/web/templates/admin/list_dns.html @@ -2,6 +2,7 @@ $value) { + ++$i; if ($data[$key]['SUSPENDED'] == 'yes') { $status = 'suspended'; $spnd_action = 'ususpend' ; @@ -61,3 +62,16 @@ foreach ($data as $key => $value) { } ?> + + + + +
→ + + listed
diff --git a/web/templates/admin/list_dns_rec.html b/web/templates/admin/list_dns_rec.html index 1fbd00f73..b1a1f4851 100644 --- a/web/templates/admin/list_dns_rec.html +++ b/web/templates/admin/list_dns_rec.html @@ -2,6 +2,7 @@ $value) { + ++$i; if ($data[$key]['SUSPENDED'] == 'yes') { $status = 'suspended'; $spnd_action = 'ususpend' ; @@ -44,3 +45,16 @@ foreach ($data as $key => $value) { } ?> + + + + +
→ + + listed
diff --git a/web/templates/admin/list_ip.html b/web/templates/admin/list_ip.html index 145005449..2c5446d8a 100644 --- a/web/templates/admin/list_ip.html +++ b/web/templates/admin/list_ip.html @@ -2,6 +2,7 @@ $value) { + ++$i; ?> @@ -49,3 +50,16 @@ foreach ($data as $key => $value) { } ?> + + + + +
→ + + listed
diff --git a/web/templates/admin/list_log.html b/web/templates/admin/list_log.html index eadb2bcde..16d3cee37 100644 --- a/web/templates/admin/list_log.html +++ b/web/templates/admin/list_log.html @@ -2,6 +2,7 @@ $value) { + ++$i; ?> @@ -29,3 +30,17 @@ foreach ($data as $key => $value) { } ?> + + + + + +
→ + + listed
diff --git a/web/templates/admin/list_mail.html b/web/templates/admin/list_mail.html index 8732656a7..0718c71f9 100644 --- a/web/templates/admin/list_mail.html +++ b/web/templates/admin/list_mail.html @@ -2,6 +2,7 @@ $value) { + ++$i; if ($data[$key]['SUSPENDED'] == 'yes') { $status = 'suspended'; $spnd_action = 'ususpend' ; @@ -67,3 +68,16 @@ foreach ($data as $key => $value) { } ?> + + + + +
→ + + listed
diff --git a/web/templates/admin/list_mail_acc.html b/web/templates/admin/list_mail_acc.html index c3f66a9cf..20394bbc5 100644 --- a/web/templates/admin/list_mail_acc.html +++ b/web/templates/admin/list_mail_acc.html @@ -2,6 +2,7 @@ $value) { + ++$i; if ($data[$key]['SUSPENDED'] == 'yes') { $status = 'suspended'; $spnd_action = 'ususpend' ; @@ -59,3 +60,15 @@ foreach ($data as $key => $value) { } ?> + + + + diff --git a/web/templates/admin/list_stats.html b/web/templates/admin/list_stats.html index 6b4aa3880..49d2afb27 100644 --- a/web/templates/admin/list_stats.html +++ b/web/templates/admin/list_stats.html @@ -2,6 +2,7 @@ $value) { + ++$i; ?> @@ -75,3 +76,16 @@ foreach ($data as $key => $value) { } ?>
→ + + listed
+ + + + +
→ + + listed
diff --git a/web/templates/admin/list_user.html b/web/templates/admin/list_user.html index fb2d4cb21..2ed65ef2f 100644 --- a/web/templates/admin/list_user.html +++ b/web/templates/admin/list_user.html @@ -2,6 +2,7 @@ $value) { + ++$i; if ($data[$key]['SUSPENDED'] == 'yes') { $status = 'suspended'; $spnd_action = 'unsuspend' ; @@ -175,4 +176,18 @@ foreach ($data as $key => $value) { + + + + + +
→ + + listed
diff --git a/web/templates/admin/list_web.html b/web/templates/admin/list_web.html index 92469c227..539f3f870 100644 --- a/web/templates/admin/list_web.html +++ b/web/templates/admin/list_web.html @@ -2,6 +2,7 @@ $value) { + ++$i; if ($data[$key]['SUSPENDED'] == 'yes') { $status = 'suspended'; $spnd_action = 'ususpend' ; @@ -68,3 +69,17 @@ foreach ($data as $key => $value) { } ?> + + + + + +
→ + + listed
diff --git a/web/templates/admin/menu_add_user.html b/web/templates/admin/menu_add_user.html index 767bb012a..db853839b 100644 --- a/web/templates/admin/menu_add_user.html +++ b/web/templates/admin/menu_add_user.html @@ -1,6 +1,6 @@ -