Skip to content

Commit e7128b4

Browse files
committed
unsuspend + delete user
1 parent baab49b commit e7128b4

File tree

11 files changed

+139
-26
lines changed

11 files changed

+139
-26
lines changed

web/css/jquery-custom-dialogs.css

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
----------------------------------*/
3636

3737
/* Overlays */
38-
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
38+
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #e6e6e6;}
3939

4040

4141
/*!
@@ -56,7 +56,7 @@
5656
.ui-widget { font-family: Arial, Helvetica, sans-serif; font-size: 12pt; }
5757
.ui-widget .ui-widget { font-size: 10pt; }
5858
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Arial, Helvetica, sans-serif; font-size: 10pt; }
59-
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
59+
.ui-widget-content { border: 1px solid #aaaaaa; color: #222222; }
6060
.ui-widget-content a { color: #222222; }
6161
.ui-widget-header { border: 1px solid #d6d4c9; background: #ebe9dc; color: #777777; font-size: 10pt; font-weight: bold;}
6262
.ui-widget-header a { color: #222222; }
@@ -76,9 +76,7 @@
7676
----------------------------------*/
7777

7878
/* states and images */
79-
.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
80-
.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
81-
.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
79+
.ui-icon { width: 16px; height: 16px; }
8280
.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
8381
.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
8482
.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
@@ -266,7 +264,7 @@
266264
----------------------------------*/
267265

268266
/* Overlays */
269-
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
267+
.ui-widget-overlay { opacity: .30;filter:Alpha(Opacity=30); }
270268
.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; }/*!
271269
* jQuery UI Resizable 1.8.20
272270
*
@@ -415,7 +413,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
415413
*
416414
* http://docs.jquery.com/UI/Dialog#theming
417415
*/
418-
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
416+
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; background: #fff; }
419417
.ui-dialog .ui-dialog-titlebar { padding: .4em 10pt; position: relative; }
420418
.ui-dialog .ui-dialog-title { float: left; margin: .10pt 16px .10pt 0; font-family: Georgia; font-style: italic; color: #c69c6d;}
421419
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }

web/delete/user/index.php

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
// Init
3+
//error_reporting(NULL);
4+
ob_start();
5+
session_start();
6+
$TAB = 'USER';
7+
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
8+
9+
// Header
10+
include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html');
11+
12+
// Panel
13+
top_panel($user,$TAB);
14+
15+
// Are you admin?
16+
if ($_SESSION['user'] == 'admin') {
17+
18+
// Cancel
19+
if (!empty($_POST['back'])) {
20+
header("Location: /list/user/");
21+
}
22+
23+
// Ok
24+
if (!empty($_GET['user'])) {
25+
$v_username = escapeshellarg($_GET['user']);
26+
exec (VESTA_CMD."v_delete_user ".$v_username, $output, $return_var);
27+
if ($return_var != 0) {
28+
$error = implode('<br>', $output);
29+
if (empty($error)) $error = 'Error: vesta did not return any output.';
30+
$_SESSION['error_msg'] = $error;
31+
} else {
32+
$_SESSION['ok_msg'] = "OK: user <b>".$_GET[user]."</b> has been deleted.";
33+
unset($v_lname);
34+
}
35+
unset($output);
36+
37+
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_delete_user.html');
38+
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/delete_user.html');
39+
unset($_SESSION['error_msg']);
40+
unset($_SESSION['ok_msg']);
41+
42+
} else {
43+
header("Location: /list/user/");
44+
}
45+
}
46+
47+
// Footer
48+
include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html');

web/edit/user/index.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@
4646
$v_ns2 = $nameservers[1];
4747
$v_ns3 = $nameservers[2];
4848
$v_ns4 = $nameservers[3];
49+
$v_suspended = $data[$v_username]['SUSPENDED'];
50+
if ( $v_suspended == 'yes' ) {
51+
$v_status = 'suspended';
52+
} else {
53+
$v_status = 'active';
54+
}
55+
$v_time = $data[$v_username]['TIME'];
56+
$v_date = $data[$v_username]['DATE'];
4957

5058
unset($output);
5159

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<table class='data'>
2+
<tr class="data-add">
3+
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
4+
<table class="data-col1">
5+
<tr><td style="padding: 18 0 4 18;"></td></tr>
6+
</table>
7+
</td>
8+
<td class="data-dotted" width="830px" style="vertical-align:top;">
9+
<table width="830px"><tr>
10+
<td></td>
11+
</tr></table>
12+
13+
<table class="data-col2" width="830px">
14+
<tr>
15+
<td style="padding: 24px 0 0 0;">
16+
<form method="post">
17+
<input type="submit" class="add-button" name="back" value="Back to users">
18+
</form>
19+
</td>
20+
</tr>
21+
</table>
22+
</td>
23+
</tr>
24+
</table>

web/templates/admin/edit_user.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
<tr class="data-add">
1515
<td class="data-dotted" style="padding: 0px 10px 0px 0px" width="150">
1616
<table class="data-col1">
17-
<tr><td style="padding: 18 0 4 18;"></td></tr>
17+
<tr><td style="padding: 20px 0 4px 4px;"><a class="data-date" ?><?php echo date("d M Y", strtotime($v_date))?></a></td></tr>
18+
<tr><td style="padding: 0 0 6px 4px;"><a class="data-date" ?><?php echo $v_time?></a></td></tr>
19+
<tr><td style="padding: 0 0 0 24px;" class="data-<?php echo $v_status ?>"><i><b><?php echo $v_status ?></b></i></td></tr>
1820
</table>
1921
</td>
2022
<td class="data-dotted" width="830px" style="vertical-align:top;">
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<table class="sub-menu">
2+
<tr>
3+
<td style="padding: 50px 2px 38px 153px;" >
4+
<?php
5+
if (!empty($_SESSION['error_msg'])) {
6+
echo "<a class=\"add-error\"><i>".$_SESSION['error_msg']."</i></a>";
7+
} else {
8+
if (!empty($_SESSION['ok_msg'])) {
9+
echo "<a class=\"add-ok\"><i> ".$_SESSION['ok_msg']."</i></a>";
10+
}
11+
}
12+
?>
13+
</td>
14+
</tr>
15+
</table>

web/templates/admin/menu_suspend_user.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<table class="sub-menu">
22
<tr>
3-
<td style="padding: 10px 2px 28px 0;" ><a class="add-name"><i>Suspending User </i></a>
3+
<td style="padding: 50px 2px 38px 153px;" >
44
<?php
55
if (!empty($_SESSION['error_msg'])) {
6-
echo "<a class=\"add-error\"><i>".$_SESSION['error_msg']."</i></a>";
6+
echo "<a class=\"add-error\"><i>".$_SESSION['error_msg']."</i></a>";
77
} else {
88
if (!empty($_SESSION['ok_msg'])) {
9-
echo "<a class=\"add-ok\"><i> ".$_SESSION['ok_msg']."</i></a>";
9+
echo "<a class=\"add-ok\"><i> ".$_SESSION['ok_msg']."</i></a>";
1010
}
1111
}
1212
?>

web/templates/admin/menu_unsuspend_user.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<table class="sub-menu">
22
<tr>
3-
<td style="padding: 10px 2px 28px 0;" ><a class="add-name"><i>Unsuspending User </i></a>
3+
<td style="padding: 50px 2px 38px 153px;" >
44
<?php
55
if (!empty($_SESSION['error_msg'])) {
6-
echo "<a class=\"add-error\"><i>".$_SESSION['error_msg']."</i></a>";
6+
echo "<a class=\"add-error\"><i>".$_SESSION['error_msg']."</i></a>";
77
} else {
88
if (!empty($_SESSION['ok_msg'])) {
9-
echo "<a class=\"add-ok\"><i> ".$_SESSION['ok_msg']."</i></a>";
9+
echo "<a class=\"add-ok\"><i> ".$_SESSION['ok_msg']."</i></a>";
1010
}
1111
}
1212
?>

web/templates/admin/suspend_user.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@
99
<table width="830px"><tr>
1010
<td></td>
1111
</tr></table>
12-
<form method="post" name="v_suspend_user">
12+
1313
<table class="data-col2" width="830px">
14-
<tr><td style="padding: 24px 0 0 0;">
15-
<input type="submit" class="add-button" name="back" value="Back to users">
16-
</td></tr>
17-
</form>
14+
<tr>
15+
<td style="padding: 24px 0 0 0;" width="100px">
16+
<form method="post">
17+
<input type="submit" class="add-button" name="back" value="Back to users">
18+
</form>
19+
</td>
20+
<td style="padding: 24px 0 0 0;">
21+
<form action="/unsuspend/user/" method="get">
22+
<input type="hidden" name="user" value="<?php echo $_GET['user']?>">
23+
<input type="submit" class="add-button" name="unsuspend" value="Unsuspend <?php echo $_GET['user']?>">
24+
</form>
25+
</td>
26+
</tr>
1827
</table>
1928
</td>
2029
</tr>

web/templates/admin/unsuspend_user.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@
99
<table width="830px"><tr>
1010
<td></td>
1111
</tr></table>
12-
<form method="post" name="v_suspend_user">
12+
1313
<table class="data-col2" width="830px">
14-
<tr><td style="padding: 24px 0 0 0;">
15-
<input type="submit" class="add-button" name="back" value="Back to users">
16-
</td></tr>
17-
</form>
14+
<tr>
15+
<td style="padding: 24px 0 0 0;" width="100px">
16+
<form method="post">
17+
<input type="submit" class="add-button" name="back" value="Back to users">
18+
</form>
19+
</td>
20+
<td style="padding: 24px 0 0 0;">
21+
<form action="/suspend/user/" method="get">
22+
<input type="hidden" name="user" value="<?php echo $_GET['user']?>">
23+
<input type="submit" class="add-button" name="suspend" value="Suspend <?php echo $_GET['user']?>">
24+
</form>
25+
</td>
26+
</tr>
1827
</table>
1928
</td>
2029
</tr>

0 commit comments

Comments
 (0)