From e7128b4a9f60b7a062079853f26c5f581e351545 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 23 May 2012 16:52:52 +0300 Subject: [PATCH] unsuspend + delete user --- web/css/jquery-custom-dialogs.css | 12 ++--- web/delete/user/index.php | 48 ++++++++++++++++++++ web/edit/user/index.php | 8 ++++ web/templates/admin/delete_user.html | 24 ++++++++++ web/templates/admin/edit_user.html | 4 +- web/templates/admin/menu_delete_user.html | 15 ++++++ web/templates/admin/menu_suspend_user.html | 6 +-- web/templates/admin/menu_unsuspend_user.html | 6 +-- web/templates/admin/suspend_user.html | 19 ++++++-- web/templates/admin/unsuspend_user.html | 19 ++++++-- web/unsuspend/user/index.php | 4 +- 11 files changed, 139 insertions(+), 26 deletions(-) create mode 100644 web/delete/user/index.php create mode 100644 web/templates/admin/delete_user.html create mode 100644 web/templates/admin/menu_delete_user.html diff --git a/web/css/jquery-custom-dialogs.css b/web/css/jquery-custom-dialogs.css index 1a8712d9..d7847ea4 100644 --- a/web/css/jquery-custom-dialogs.css +++ b/web/css/jquery-custom-dialogs.css @@ -35,7 +35,7 @@ ----------------------------------*/ /* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #e6e6e6;} /*! @@ -56,7 +56,7 @@ .ui-widget { font-family: Arial, Helvetica, sans-serif; font-size: 12pt; } .ui-widget .ui-widget { font-size: 10pt; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; } -.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content { border: 1px solid #aaaaaa; color: #222222; } .ui-widget-content a { color: #222222; } .ui-widget-header { border: 1px solid #d6d4c9; background: #ebe9dc; color: #777777; font-size: 10pt; font-weight: bold;} .ui-widget-header a { color: #222222; } @@ -76,9 +76,7 @@ ----------------------------------*/ /* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-icon { width: 16px; height: 16px; } .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } @@ -266,7 +264,7 @@ ----------------------------------*/ /* Overlays */ -.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-overlay { opacity: .30;filter:Alpha(Opacity=30); } .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*! * jQuery UI Resizable 1.8.20 * @@ -415,7 +413,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad * * http://docs.jquery.com/UI/Dialog#theming */ -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; background: #fff; } .ui-dialog .ui-dialog-titlebar { padding: .4em 10pt; position: relative; } .ui-dialog .ui-dialog-title { float: left; margin: .10pt 16px .10pt 0; font-family: Georgia; font-style: italic; color: #c69c6d;} .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } diff --git a/web/delete/user/index.php b/web/delete/user/index.php new file mode 100644 index 00000000..d6b64824 --- /dev/null +++ b/web/delete/user/index.php @@ -0,0 +1,48 @@ +', $output); + if (empty($error)) $error = 'Error: vesta did not return any output.'; + $_SESSION['error_msg'] = $error; + } else { + $_SESSION['ok_msg'] = "OK: user ".$_GET[user]." has been deleted."; + unset($v_lname); + } + unset($output); + + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_delete_user.html'); + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/delete_user.html'); + unset($_SESSION['error_msg']); + unset($_SESSION['ok_msg']); + + } else { + header("Location: /list/user/"); + } +} + +// Footer +include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/edit/user/index.php b/web/edit/user/index.php index 6e5653e2..0b5e069c 100644 --- a/web/edit/user/index.php +++ b/web/edit/user/index.php @@ -46,6 +46,14 @@ if ($_SESSION['user'] == 'admin') { $v_ns2 = $nameservers[1]; $v_ns3 = $nameservers[2]; $v_ns4 = $nameservers[3]; + $v_suspended = $data[$v_username]['SUSPENDED']; + if ( $v_suspended == 'yes' ) { + $v_status = 'suspended'; + } else { + $v_status = 'active'; + } + $v_time = $data[$v_username]['TIME']; + $v_date = $data[$v_username]['DATE']; unset($output); diff --git a/web/templates/admin/delete_user.html b/web/templates/admin/delete_user.html new file mode 100644 index 00000000..a014da6c --- /dev/null +++ b/web/templates/admin/delete_user.html @@ -0,0 +1,24 @@ + + + + + +
+ + +
+
+ + +
+ + + + + +
+
+ +
+
+
diff --git a/web/templates/admin/edit_user.html b/web/templates/admin/edit_user.html index 7fa4b16b..815fd65c 100644 --- a/web/templates/admin/edit_user.html +++ b/web/templates/admin/edit_user.html @@ -14,7 +14,9 @@ document.v_edit_user.v_password.value = randomstring; - + + +
diff --git a/web/templates/admin/menu_delete_user.html b/web/templates/admin/menu_delete_user.html new file mode 100644 index 00000000..2e1196cc --- /dev/null +++ b/web/templates/admin/menu_delete_user.html @@ -0,0 +1,15 @@ + + + + + diff --git a/web/templates/admin/menu_suspend_user.html b/web/templates/admin/menu_suspend_user.html index b4e71a4a..2e1196cc 100644 --- a/web/templates/admin/menu_suspend_user.html +++ b/web/templates/admin/menu_suspend_user.html @@ -1,12 +1,12 @@ - diff --git a/web/unsuspend/user/index.php b/web/unsuspend/user/index.php index 04e8ca13..98fe199b 100644 --- a/web/unsuspend/user/index.php +++ b/web/unsuspend/user/index.php @@ -34,8 +34,8 @@ if ($_SESSION['user'] == 'admin') { } unset($output); - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_suspend_user.html'); - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/suspend_user.html'); + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_unsuspend_user.html'); + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/unsuspend_user.html'); unset($_SESSION['error_msg']); unset($_SESSION['ok_msg']);