Permalink
Browse files

preserve keys in array_reverse()

  • Loading branch information...
serghey-rodin committed Feb 20, 2013
1 parent 32e2b0a commit ee1fb98337e97c2acdc5bc184bc4e98695508779
View
@@ -19,7 +19,7 @@ source $VESTA/func/main.sh
json_list_pkgs() {
echo '{'
fileds_count=$(echo "$fields" | wc -w)
for package in $(ls $VESTA/data/packages); do
for package in $(ls -t $VESTA/data/packages); do
PACKAGE=${package/.pkg/}
pkg_data=$(cat $VESTA/data/packages/$package)
eval $pkg_data
@@ -51,7 +51,7 @@ json_list_pkgs() {
# Shell fnction
shell_list_pkgs() {
for package in $(ls $VESTA/data/packages); do
for package in $(ls -t $VESTA/data/packages); do
PACKAGE=${package/.pkg/}
pkg_descr=$(cat $VESTA/data/packages/$package)
eval $pkg_descr
@@ -14,7 +14,7 @@
// Data
exec (VESTA_CMD."v-list-user-backups $user json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data,true);
unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_backup.html');
View
@@ -15,7 +15,7 @@
// Data
exec (VESTA_CMD."v-list-cron-jobs $user json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data,true);
unset($output);
if ($_SESSION['user'] == 'admin') {
View
@@ -14,7 +14,7 @@
// Data
exec (VESTA_CMD."v-list-databases $user json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data, true);
unset($output);
if ($_SESSION['user'] == 'admin') {
View
@@ -15,7 +15,7 @@
if (empty($_GET['domain'])){
exec (VESTA_CMD."v-list-dns-domains $user json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data, true);
unset($output);
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_dns.html');
@@ -25,7 +25,7 @@
} else {
exec (VESTA_CMD."v-list-dns-domain-records '".$user."' '".$_GET['domain']."' 'json'", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data, true);
unset($output);
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_dns_rec.html');
View
@@ -15,7 +15,7 @@
if ($_SESSION['user'] == 'admin') {
exec (VESTA_CMD."v-list-sys-ips json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data, true);
unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_ip.html');
}
View
@@ -15,7 +15,7 @@
if (empty($_GET['domain'])){
exec (VESTA_CMD."v-list-mail-domains $user json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data, true);
unset($output);
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail.html');
@@ -25,7 +25,7 @@
} else {
exec (VESTA_CMD."v-list-mail-accounts '".$user."' '".$_GET['domain']."' json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data, true);
unset($output);
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail_acc.html');
@@ -15,7 +15,7 @@
if ($_SESSION['user'] == 'admin') {
exec (VESTA_CMD."v-list-user-packages json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
//$data = array_reverse($data, true);
unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_packages.html');
}
View
@@ -16,13 +16,13 @@
if (empty($_GET['user'])) {
exec (VESTA_CMD."v-list-users-stats json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data, true);
unset($output);
} else {
$v_user = escapeshellarg($_GET['user']);
exec (VESTA_CMD."v-list-user-stats $v_user json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data, true);
unset($output);
}
@@ -34,7 +34,7 @@
} else {
exec (VESTA_CMD."v-list-user-stats $user json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data, true);
unset($output);
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_stats.html');
}
View
@@ -17,13 +17,13 @@
if ($user == 'admin') $cmd = "v-list-users json";
exec (VESTA_CMD.$cmd, $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data,true);
display_error_block();
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_user.html');
} else {
exec (VESTA_CMD."v-list-user ".$user." json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
//$data = array_reverse($data,true);
display_error_block();
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_user.html');
}
View
@@ -14,7 +14,7 @@
// Data
exec (VESTA_CMD."v-list-web-domains $user json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
$data = array_reverse($data,true);
if ($_SESSION['user'] == 'admin') {
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_web.html');
} else {

0 comments on commit ee1fb98

Please sign in to comment.