From 650c3f85070389071d8abba7a72b44c3b99ded05 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Thu, 26 Jul 2012 23:14:58 +0300 Subject: [PATCH] user package listing --- bin/v_list_user_packages | 6 +- data/packages/default.pkg | 2 + data/packages/gainsboro.pkg | 2 + data/packages/palegreen.pkg | 2 + data/packages/slategrey.pkg | 2 + func/main.sh | 2 +- web/images/reload.png | Bin 0 -> 215 bytes web/images/update.png | Bin 0 -> 243 bytes web/list/packages/index.php | 46 +++++----- web/templates/admin/list_packages.html | 118 +++++++++++++++++++++++++ web/templates/admin/menu_packages.html | 16 ++++ web/templates/admin/panel.html | 3 +- 12 files changed, 168 insertions(+), 31 deletions(-) create mode 100644 web/images/reload.png create mode 100644 web/images/update.png create mode 100644 web/templates/admin/list_packages.html create mode 100644 web/templates/admin/menu_packages.html diff --git a/bin/v_list_user_packages b/bin/v_list_user_packages index 20370068..1cf32535 100755 --- a/bin/v_list_user_packages +++ b/bin/v_list_user_packages @@ -71,9 +71,9 @@ shell_list_pkgs() { #----------------------------------------------------------# # Defining fields -fields='$PACKAGE $TEMPLATE $WEB_DOMAINS $WEB_SSL $WEB_ALIASES $DATABASES - $MAIL_DOMAINS $MAIL_BOXES $MAIL_FORWARDERS $DNS_DOMAINS $DISK_QUOTA - $BANDWIDTH $NS $SHELL $BACKUPS' +fields='$PACKAGE $TEMPLATE $WEB_DOMAINS $WEB_ALIASES $DNS_DOMAINS $DNS_RECORDS + $MAIL_DOMAINS $MAIL_ACCOUNTS $DATABASES $CRON_JOBS $DISK_QUOTA $BANDWIDTH + $NS $SHELL $BACKUPS $TIME $DATE' # Listing domains case $format in diff --git a/data/packages/default.pkg b/data/packages/default.pkg index 0399cabe..815371c1 100644 --- a/data/packages/default.pkg +++ b/data/packages/default.pkg @@ -12,3 +12,5 @@ BANDWIDTH='100000' NS='ns1.localhost,ns2.localhost' SHELL='nologin' BACKUPS='3' +TIME='11:31:29' +DATE='2012-07-26' diff --git a/data/packages/gainsboro.pkg b/data/packages/gainsboro.pkg index 4529b9cc..e7d4402e 100644 --- a/data/packages/gainsboro.pkg +++ b/data/packages/gainsboro.pkg @@ -12,3 +12,5 @@ BANDWIDTH='10000' NS='ns1.localhost,ns2.localhost' SHELL='nologin' BACKUPS='1' +TIME='11:31:30' +DATE='2012-07-26' diff --git a/data/packages/palegreen.pkg b/data/packages/palegreen.pkg index 7c3200ca..8e71593a 100644 --- a/data/packages/palegreen.pkg +++ b/data/packages/palegreen.pkg @@ -12,3 +12,5 @@ BANDWIDTH='50000' NS='ns1.localhost,ns2.localhost' SHELL='nologin' BACKUPS='5' +TIME='11:31:31' +DATE='2012-07-26' diff --git a/data/packages/slategrey.pkg b/data/packages/slategrey.pkg index 0399cabe..e2f2664d 100644 --- a/data/packages/slategrey.pkg +++ b/data/packages/slategrey.pkg @@ -12,3 +12,5 @@ BANDWIDTH='100000' NS='ns1.localhost,ns2.localhost' SHELL='nologin' BACKUPS='3' +TIME='11:31:32' +DATE='2012-07-26' diff --git a/func/main.sh b/func/main.sh index 5f691303..1553af70 100755 --- a/func/main.sh +++ b/func/main.sh @@ -122,7 +122,7 @@ gen_password() { # Package existance check is_package_valid() { if [ ! -e "$VESTA/data/packages/$package.pkg" ]; then - echo "Error: $package is not exist" + echo "Error: package $package not exist" log_event "$E_NOTEXIST $EVENT" exit $E_NOTEXIST fi diff --git a/web/images/reload.png b/web/images/reload.png new file mode 100644 index 0000000000000000000000000000000000000000..44cdc0ccda3898496bd5bbe628201418b512a467 GIT binary patch literal 215 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJ;0V1_0*t`W&jKx9jP7LeL$-D%~CV9KNF#HF> z1$&oI28wVNctjR6FmMZlFeAgPITAoY_7YEDSN1#XQo7Pd+}~5}=@3Q17t`M}T=iF0n)?1l!Qz7rul4JaDjCj6aEVP4h~5jdg2B_(&t;ucLK6V$ C;zNu8 literal 0 HcmV?d00001 diff --git a/web/images/update.png b/web/images/update.png new file mode 100644 index 0000000000000000000000000000000000000000..9cf6bfa619617144de1e2cefe1ee0f32b7b7d26b GIT binary patch literal 243 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqjKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p>QL70(Y)*K0-AbW|YuPgfl=Gk`+Ho-U3d5|>NQ zDGD_uh`2uF|C6q=gJCvX^I6>s2131WTHXqjs)x-sQxcqg@OVap@#klEcNQNyyWudm z`kcTYpIoM2c+e&FeFszZp5Pm%Rd@bWIQ$FGIXhwI^0`j?6utyU99=(QgJY*NkG(->}*a6JepSWZWGXY22WQ%mvv4FO#qL~SKI&q literal 0 HcmV?d00001 diff --git a/web/list/packages/index.php b/web/list/packages/index.php index 32c28a1f..c4264303 100644 --- a/web/list/packages/index.php +++ b/web/list/packages/index.php @@ -1,34 +1,28 @@ 0 ) { - header("Location: /error/"); -} -$panel = json_decode(implode('', $output), true); -if ( $_SESSION['user'] == 'admin' ) { - require_once '../../templates/admin/panel.html'; -} else { - require_once '../../templates/header.html'; +// Panel +top_panel($user,$TAB); + +// Data +if ($_SESSION['user'] == 'admin') { + + exec (VESTA_CMD."v_list_user_packages json", $output, $return_var); + check_error($return_var); + $data = json_decode(implode('', $output), true); + $data = array_reverse($data); + unset($output); + + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/menu_packages.html'); + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_packages.html'); } -require_once '../../templates/footer.html'; +// Footer +include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/templates/admin/list_packages.html b/web/templates/admin/list_packages.html new file mode 100644 index 00000000..ef67c90e --- /dev/null +++ b/web/templates/admin/list_packages.html @@ -0,0 +1,118 @@ + + + $value) { + ++$i; +?> + + + + + + + + +
+ + + + +
">
active
+
+ + + + + +
propagate edit + + delete +
+

Are you sure you want to delete package?

+
+
+ + + + + + + +
+ + + + + + + + +
Defaul Template:
System Shell:
Bandwidth: +
Disk: +
+
+ + + + + + + + + + + +
Web Domains:
Web Aliases: per domain
Dns Domains:
Dns Records: per domain
Name Servers:
+ + + + + + + + + + + +
Mail Domains:
Mail Accounts: per domain
Databases:
Cron Jobs:
Backups:
+
+
+"; ?> + + + + + +
→ + + listed
+"; ?> +"; ?> diff --git a/web/templates/admin/menu_packages.html b/web/templates/admin/menu_packages.html new file mode 100644 index 00000000..7689b385 --- /dev/null +++ b/web/templates/admin/menu_packages.html @@ -0,0 +1,16 @@ + + + + + + + + +
diff --git a/web/templates/admin/panel.html b/web/templates/admin/panel.html index d682338e..91f4b751 100644 --- a/web/templates/admin/panel.html +++ b/web/templates/admin/panel.html @@ -2,9 +2,10 @@ + - +

Packages IP Adresses RRD GraphicsStatisticsStatistics History Log Log out