Skip to content

Commit ee1fb98

Browse files
committed
preserve keys in array_reverse()
1 parent 32e2b0a commit ee1fb98

File tree

11 files changed

+17
-17
lines changed

11 files changed

+17
-17
lines changed

bin/v-list-user-packages

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ source $VESTA/func/main.sh
1919
json_list_pkgs() {
2020
echo '{'
2121
fileds_count=$(echo "$fields" | wc -w)
22-
for package in $(ls $VESTA/data/packages); do
22+
for package in $(ls -t $VESTA/data/packages); do
2323
PACKAGE=${package/.pkg/}
2424
pkg_data=$(cat $VESTA/data/packages/$package)
2525
eval $pkg_data
@@ -51,7 +51,7 @@ json_list_pkgs() {
5151

5252
# Shell fnction
5353
shell_list_pkgs() {
54-
for package in $(ls $VESTA/data/packages); do
54+
for package in $(ls -t $VESTA/data/packages); do
5555
PACKAGE=${package/.pkg/}
5656
pkg_descr=$(cat $VESTA/data/packages/$package)
5757
eval $pkg_descr

web/list/backup/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// Data
1515
exec (VESTA_CMD."v-list-user-backups $user json", $output, $return_var);
1616
$data = json_decode(implode('', $output), true);
17-
$data = array_reverse($data);
17+
$data = array_reverse($data,true);
1818
unset($output);
1919
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_backup.html');
2020

web/list/cron/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// Data
1616
exec (VESTA_CMD."v-list-cron-jobs $user json", $output, $return_var);
1717
$data = json_decode(implode('', $output), true);
18-
$data = array_reverse($data);
18+
$data = array_reverse($data,true);
1919
unset($output);
2020

2121
if ($_SESSION['user'] == 'admin') {

web/list/db/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// Data
1515
exec (VESTA_CMD."v-list-databases $user json", $output, $return_var);
1616
$data = json_decode(implode('', $output), true);
17-
$data = array_reverse($data);
17+
$data = array_reverse($data, true);
1818
unset($output);
1919

2020
if ($_SESSION['user'] == 'admin') {

web/list/dns/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
if (empty($_GET['domain'])){
1616
exec (VESTA_CMD."v-list-dns-domains $user json", $output, $return_var);
1717
$data = json_decode(implode('', $output), true);
18-
$data = array_reverse($data);
18+
$data = array_reverse($data, true);
1919
unset($output);
2020
if ($_SESSION['user'] == 'admin') {
2121
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_dns.html');
@@ -25,7 +25,7 @@
2525
} else {
2626
exec (VESTA_CMD."v-list-dns-domain-records '".$user."' '".$_GET['domain']."' 'json'", $output, $return_var);
2727
$data = json_decode(implode('', $output), true);
28-
$data = array_reverse($data);
28+
$data = array_reverse($data, true);
2929
unset($output);
3030
if ($_SESSION['user'] == 'admin') {
3131
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_dns_rec.html');

web/list/ip/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
if ($_SESSION['user'] == 'admin') {
1616
exec (VESTA_CMD."v-list-sys-ips json", $output, $return_var);
1717
$data = json_decode(implode('', $output), true);
18-
$data = array_reverse($data);
18+
$data = array_reverse($data, true);
1919
unset($output);
2020
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_ip.html');
2121
}

web/list/mail/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
if (empty($_GET['domain'])){
1616
exec (VESTA_CMD."v-list-mail-domains $user json", $output, $return_var);
1717
$data = json_decode(implode('', $output), true);
18-
$data = array_reverse($data);
18+
$data = array_reverse($data, true);
1919
unset($output);
2020
if ($_SESSION['user'] == 'admin') {
2121
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail.html');
@@ -25,7 +25,7 @@
2525
} else {
2626
exec (VESTA_CMD."v-list-mail-accounts '".$user."' '".$_GET['domain']."' json", $output, $return_var);
2727
$data = json_decode(implode('', $output), true);
28-
$data = array_reverse($data);
28+
$data = array_reverse($data, true);
2929
unset($output);
3030
if ($_SESSION['user'] == 'admin') {
3131
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_mail_acc.html');

web/list/package/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
if ($_SESSION['user'] == 'admin') {
1616
exec (VESTA_CMD."v-list-user-packages json", $output, $return_var);
1717
$data = json_decode(implode('', $output), true);
18-
$data = array_reverse($data);
18+
//$data = array_reverse($data, true);
1919
unset($output);
2020
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_packages.html');
2121
}

web/list/stats/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
if (empty($_GET['user'])) {
1717
exec (VESTA_CMD."v-list-users-stats json", $output, $return_var);
1818
$data = json_decode(implode('', $output), true);
19-
$data = array_reverse($data);
19+
$data = array_reverse($data, true);
2020
unset($output);
2121
} else {
2222
$v_user = escapeshellarg($_GET['user']);
2323
exec (VESTA_CMD."v-list-user-stats $v_user json", $output, $return_var);
2424
$data = json_decode(implode('', $output), true);
25-
$data = array_reverse($data);
25+
$data = array_reverse($data, true);
2626
unset($output);
2727
}
2828

@@ -34,7 +34,7 @@
3434
} else {
3535
exec (VESTA_CMD."v-list-user-stats $user json", $output, $return_var);
3636
$data = json_decode(implode('', $output), true);
37-
$data = array_reverse($data);
37+
$data = array_reverse($data, true);
3838
unset($output);
3939
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_stats.html');
4040
}

web/list/user/index.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
if ($user == 'admin') $cmd = "v-list-users json";
1818
exec (VESTA_CMD.$cmd, $output, $return_var);
1919
$data = json_decode(implode('', $output), true);
20-
$data = array_reverse($data);
20+
$data = array_reverse($data,true);
2121
display_error_block();
2222
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_user.html');
2323
} else {
2424
exec (VESTA_CMD."v-list-user ".$user." json", $output, $return_var);
2525
$data = json_decode(implode('', $output), true);
26-
$data = array_reverse($data);
26+
//$data = array_reverse($data,true);
2727
display_error_block();
2828
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_user.html');
2929
}

0 commit comments

Comments
 (0)