explict listing

This commit is contained in:
Serghey Rodin 2012-05-20 18:23:49 +03:00
parent 988b30fb87
commit d59de4c125
18 changed files with 196 additions and 13 deletions

View file

@ -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 <b>".$v_username."</b> has been created successfully.";
$_SESSION['ok_msg'] = "OK: user <b>".$_POST[v_username]."</b> has been created successfully.";
unset($v_username);
unset($v_password);
unset($v_email);

View file

@ -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; }

View file

@ -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){

View file

@ -36,7 +36,7 @@ document.v_add_user.v_password.value = randomstring;
<?php
foreach ($data as $key => $value) {
echo "\t\t\t\t<option value=\"".$key."\"";
if ((!empty($v_package)) && ( $key == $_POST['package'])){
if ((!empty($v_package)) && ( $key == $_POST['v_package'])){
echo 'selected' ;
}
echo ">".$key."</option>\n";

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
$web = 'no';
$dns = 'no';
$mail = 'no';
@ -63,3 +64,16 @@ foreach ($data as $key => $value) {
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 backup archive ";
} else {
echo "$i backup archives ";
}
?>
listed</i></td>
</tr>
</table>

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'ususpend' ;
@ -80,3 +81,16 @@ foreach ($data as $key => $value) {
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 cron job ";
} else {
echo "$i cron jobs ";
}
?>
listed</i></td>
</tr>
</table>

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'ususpend' ;
@ -64,3 +65,16 @@ foreach ($data as $key => $value) {
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 database ";
} else {
echo "$i databases ";
}
?>
listed</i></td>
</tr>
</table>

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'ususpend' ;
@ -61,3 +62,16 @@ foreach ($data as $key => $value) {
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 user dns domain ";
} else {
echo "$i dns domains ";
}
?>
listed</i></td>
</tr>
</table>

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'ususpend' ;
@ -44,3 +45,16 @@ foreach ($data as $key => $value) {
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 dns record ";
} else {
echo "$i dns records ";
}
?>
listed</i></td>
</tr>
</table>

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
?>
<tr class="data-row">
@ -49,3 +50,16 @@ foreach ($data as $key => $value) {
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 ip address ";
} else {
echo "$i ip addresses ";
}
?>
listed</i></td>
</tr>
</table>

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
?>
<tr class="data-row">
@ -29,3 +30,17 @@ foreach ($data as $key => $value) {
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 log record ";
} else {
echo "$i log records ";
}
?>
listed</i></td>
</tr>
</table>

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'ususpend' ;
@ -67,3 +68,16 @@ foreach ($data as $key => $value) {
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 mail domain ";
} else {
echo "$i mail domains ";
}
?>
listed</i></td>
</tr>
</table>

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'ususpend' ;
@ -59,3 +60,15 @@ foreach ($data as $key => $value) {
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 mail account ";
} else {
echo "$i mail accounts ";
}
?>
listed</i></td>
</tr>

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
?>
<tr class="data-row">
@ -75,3 +76,16 @@ foreach ($data as $key => $value) {
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 month ";
} else {
echo "$i months ";
}
?>
listed</i></td>
</tr>
</table>

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'unsuspend' ;
@ -175,4 +176,18 @@ foreach ($data as $key => $value) {
<?php
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 user account ";
} else {
echo "$i user accounts ";
}
?>
listed</i></td>
</tr>
</table>

View file

@ -2,6 +2,7 @@
<?php
foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'ususpend' ;
@ -68,3 +69,17 @@ foreach ($data as $key => $value) {
}
?>
</table>
<table class="data-count">
<tr>
<td><i>
<?php
if ( $i == 1) {
echo "1 web domain ";
} else {
echo "$i web domains ";
}
?>
listed</i></td>
</tr>
</table>

View file

@ -1,6 +1,6 @@
<table class="sub-menu">
<tr>
<td style="padding: 10px 2px 28px 0;" ><a class="add-name"><i>Adding New User Account: </i></a>
<td style="padding: 10px 2px 28px 0;" ><a class="add-name"><i>Adding New User Account </i></a>
<?php
if (!empty($_SESSION['error_msg'])) {
echo "<a class=\"add-error\"><i>".$_SESSION['error_msg']."</i></a>";

View file

@ -55,7 +55,7 @@ if (!empty($_SESSION['look'])) {
.top-link:active{
text-decoration: underline;
color: #e5a907
color: #e5a907;
}
.top-slink {
@ -223,6 +223,8 @@ if (!empty($_SESSION['look'])) {
margin-left: auto;
margin-right: auto;
width: 990px;
color: #e5a907;
font-family: Georgia, serif;
font-size: 12pt;
text-align: left;
@ -327,6 +329,15 @@ if (!empty($_SESSION['look'])) {
text-decoration: none;
}
.data-count {
background: #EBE9DC;
color: #5C4D45;
font-size:18 pt;
font-family: Georgia;
margin: 22px 0 0 0;
padding: 0 12px 0 162px;
}
.chart1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;