Skip to content

Commit d59de4c

Browse files
committed
explict listing
1 parent 988b30f commit d59de4c

18 files changed

+196
-13
lines changed

web/add/user/index.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,21 @@
2424
// Ok
2525
if (!empty($_POST['ok'])) {
2626
// Check input
27+
if (empty($_POST['v_username'])) $errors[] = 'user';
28+
if (empty($_POST['v_password'])) $errors[] = 'password';
29+
if (empty($_POST['v_package'])) $errrors[] = 'package';
30+
if (empty($_POST['v_email'])) $errors[] = 'email';
31+
if (empty($_POST['v_fname'])) $errors[] = 'first name';
32+
if (empty($_POST['v_lname'])) $errors[] = 'last name';
33+
34+
// Protect input
2735
$v_username = escapeshellarg($_POST['v_username']);
2836
$v_password = escapeshellarg($_POST['v_password']);
2937
$v_package = escapeshellarg($_POST['v_package']);
3038
$v_email = escapeshellarg($_POST['v_email']);
3139
$v_fname = escapeshellarg($_POST['v_fname']);
3240
$v_lname = escapeshellarg($_POST['v_lname']);
3341

34-
if (empty($v_username)) $errors[] = 'user';
35-
if (empty($v_password)) $errors[] = 'password';
36-
if (empty($v_package)) $errrors[] = 'package';
37-
if (empty($v_email)) $errors[] = 'email';
38-
if (empty($v_fname)) $errors[] = 'first name';
39-
if (empty($v_lname)) $errors[] = 'last name';
40-
4142
// Check for errors
4243
if (!empty($errors[0])) {
4344
foreach ($errors as $i => $error) {
@@ -55,7 +56,7 @@
5556
if (empty($error)) $error = 'Error: vesta did not return any output.';
5657
$_SESSION['error_msg'] = $error;
5758
} else {
58-
$_SESSION['ok_msg'] = "OK: user <b>".$v_username."</b> has been created successfully.";
59+
$_SESSION['ok_msg'] = "OK: user <b>".$_POST[v_username]."</b> has been created successfully.";
5960
unset($v_username);
6061
unset($v_password);
6162
unset($v_email);

web/css/jquery-custom-dialogs.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
417417
*/
418418
.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
419419
.ui-dialog .ui-dialog-titlebar { padding: .4em 10pt; position: relative; }
420-
.ui-dialog .ui-dialog-title { float: left; margin: .10pt 16px .10pt 0; }
420+
.ui-dialog .ui-dialog-title { float: left; margin: .10pt 16px .10pt 0; font-family: Georgia; font-style: italic;}
421421
.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
422422
.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
423423
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }

web/inc/main.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
define('VESTA_CMD', '/usr/bin/sudo /usr/local/vesta/bin/');
1818

19+
$i = 0;
1920

2021
// Define functions
2122
function check_error($return_var){

web/templates/admin/add_user.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<?php
3737
foreach ($data as $key => $value) {
3838
echo "\t\t\t\t<option value=\"".$key."\"";
39-
if ((!empty($v_package)) && ( $key == $_POST['package'])){
39+
if ((!empty($v_package)) && ( $key == $_POST['v_package'])){
4040
echo 'selected' ;
4141
}
4242
echo ">".$key."</option>\n";

web/templates/admin/list_backup.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<?php
44
foreach ($data as $key => $value) {
5+
++$i;
56
$web = 'no';
67
$dns = 'no';
78
$mail = 'no';
@@ -63,3 +64,16 @@
6364
}
6465
?>
6566
</table>
67+
<table class="data-count">
68+
<tr>
69+
<td><i>
70+
<?php
71+
if ( $i == 1) {
72+
echo "1 backup archive ";
73+
} else {
74+
echo "$i backup archives ";
75+
}
76+
?>
77+
listed</i></td>
78+
</tr>
79+
</table>

web/templates/admin/list_cron.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<?php
44
foreach ($data as $key => $value) {
5+
++$i;
56
if ($data[$key]['SUSPENDED'] == 'yes') {
67
$status = 'suspended';
78
$spnd_action = 'ususpend' ;
@@ -80,3 +81,16 @@
8081
}
8182
?>
8283
</table>
84+
<table class="data-count">
85+
<tr>
86+
<td><i>
87+
<?php
88+
if ( $i == 1) {
89+
echo "1 cron job ";
90+
} else {
91+
echo "$i cron jobs ";
92+
}
93+
?>
94+
listed</i></td>
95+
</tr>
96+
</table>

web/templates/admin/list_db.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<?php
44
foreach ($data as $key => $value) {
5+
++$i;
56
if ($data[$key]['SUSPENDED'] == 'yes') {
67
$status = 'suspended';
78
$spnd_action = 'ususpend' ;
@@ -64,3 +65,16 @@
6465
}
6566
?>
6667
</table>
68+
<table class="data-count">
69+
<tr>
70+
<td><i>
71+
<?php
72+
if ( $i == 1) {
73+
echo "1 database ";
74+
} else {
75+
echo "$i databases ";
76+
}
77+
?>
78+
listed</i></td>
79+
</tr>
80+
</table>

web/templates/admin/list_dns.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<?php
44
foreach ($data as $key => $value) {
5+
++$i;
56
if ($data[$key]['SUSPENDED'] == 'yes') {
67
$status = 'suspended';
78
$spnd_action = 'ususpend' ;
@@ -61,3 +62,16 @@
6162
}
6263
?>
6364
</table>
65+
<table class="data-count">
66+
<tr>
67+
<td><i>
68+
<?php
69+
if ( $i == 1) {
70+
echo "1 user dns domain ";
71+
} else {
72+
echo "$i dns domains ";
73+
}
74+
?>
75+
listed</i></td>
76+
</tr>
77+
</table>

web/templates/admin/list_dns_rec.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<?php
44
foreach ($data as $key => $value) {
5+
++$i;
56
if ($data[$key]['SUSPENDED'] == 'yes') {
67
$status = 'suspended';
78
$spnd_action = 'ususpend' ;
@@ -44,3 +45,16 @@
4445
}
4546
?>
4647
</table>
48+
<table class="data-count">
49+
<tr>
50+
<td><i>
51+
<?php
52+
if ( $i == 1) {
53+
echo "1 dns record ";
54+
} else {
55+
echo "$i dns records ";
56+
}
57+
?>
58+
listed</i></td>
59+
</tr>
60+
</table>

web/templates/admin/list_ip.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<?php
44
foreach ($data as $key => $value) {
5+
++$i;
56
?>
67

78
<tr class="data-row">
@@ -49,3 +50,16 @@
4950
}
5051
?>
5152
</table>
53+
<table class="data-count">
54+
<tr>
55+
<td><i>
56+
<?php
57+
if ( $i == 1) {
58+
echo "1 ip address ";
59+
} else {
60+
echo "$i ip addresses ";
61+
}
62+
?>
63+
listed</i></td>
64+
</tr>
65+
</table>

0 commit comments

Comments
 (0)