mirror of
https://github.com/myvesta/vesta
synced 2025-08-20 21:34:12 -07:00
Simplifying code, avoiding check for PHP version
This commit is contained in:
parent
d944a44c7b
commit
b80bad79b2
25 changed files with 57 additions and 115 deletions
|
@ -89,11 +89,7 @@ function detect_user_language($fallback='en') {
|
|||
$accept_langs_sorted[$code] = (double)$q;
|
||||
}
|
||||
}
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
arsort($accept_langs_sorted);
|
||||
} else {
|
||||
if (!empty($accept_langs_sorted)) { arsort($accept_langs_sorted); }
|
||||
}
|
||||
if (!empty($accept_langs_sorted)) arsort($accept_langs_sorted);
|
||||
|
||||
// List languages
|
||||
exec (VESTA_CMD."v-list-sys-languages json", $output, $return_var);
|
||||
|
|
|
@ -108,14 +108,8 @@ if (isset($_SESSION['look']) && ( $_SESSION['look'] != 'admin' )) {
|
|||
|
||||
function get_favourites(){
|
||||
exec (VESTA_CMD."v-list-user-favourites ".$_SESSION['user']." json", $output, $return_var);
|
||||
// $data = json_decode(implode('', $output).'}', true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
$data = array_reverse($data, true);
|
||||
} else {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
$data = is_array($data) ? array_reverse($data, true) : array();
|
||||
}
|
||||
$favourites = array();
|
||||
|
||||
foreach($data['Favourites'] as $key => $favourite){
|
||||
|
@ -193,24 +187,16 @@ function top_panel($user, $TAB) {
|
|||
header("Location: /error/");
|
||||
exit;
|
||||
}
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$panel = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$panel = json_decode(implode('', $output), true);
|
||||
if (!is_array($panel)) { $panel = array(); }
|
||||
}
|
||||
if (!is_array($panel)) $panel = array();
|
||||
unset($output);
|
||||
|
||||
|
||||
// getting notifications
|
||||
$command = VESTA_CMD."v-list-user-notifications '".$user."' 'json'";
|
||||
exec ($command, $output, $return_var);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$notifications = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$notifications = json_decode(implode('', $output), true);
|
||||
if (!is_array($notifications)) { $notifications = array(); }
|
||||
}
|
||||
if (!is_array($notifications)) $notifications = array();
|
||||
foreach($notifications as $message){
|
||||
if(isset($message['ACK']) && $message['ACK'] == 'no'){
|
||||
$panel[$user]['NOTIFICATIONS'] = 'yes';
|
||||
|
@ -229,15 +215,11 @@ function top_panel($user, $TAB) {
|
|||
|
||||
function translate_date($date){
|
||||
$date = strtotime($date);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
return strftime("%d ", $date).__(strftime("%b", $date)).strftime(" %Y", $date);
|
||||
} else {
|
||||
$day = date('d', $date);
|
||||
$mon = date('M', $date);
|
||||
$year = date('Y', $date);
|
||||
return $day.' '.__($mon).' '.$year;
|
||||
}
|
||||
}
|
||||
|
||||
function humanize_time($usage) {
|
||||
if ( $usage > 60 ) {
|
||||
|
|
|
@ -9,14 +9,14 @@ include($_SERVER['DOCUMENT_ROOT'].'/inc/main.php');
|
|||
if (empty($_GET['backup'])){
|
||||
exec (VESTA_CMD."v-list-user-backups $user json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data,true); } else { $data = is_array($data) ? array_reverse($data,true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data,true) : array();
|
||||
unset($output);
|
||||
|
||||
render_page($user, $TAB, 'list_backup');
|
||||
} else {
|
||||
exec (VESTA_CMD."v-list-user-backup $user ".escapeshellarg($_GET['backup'])." json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data,true); } else { $data = is_array($data) ? array_reverse($data,true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data,true) : array();
|
||||
unset($output);
|
||||
|
||||
render_page($user, $TAB, 'list_backup_detail');
|
||||
|
|
|
@ -8,7 +8,7 @@ include($_SERVER['DOCUMENT_ROOT'].'/inc/main.php');
|
|||
// Data
|
||||
exec (VESTA_CMD."v-list-cron-jobs $user json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data,true); } else { $data = is_array($data) ? array_reverse($data,true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data,true) : array();
|
||||
unset($output);
|
||||
|
||||
// Render page
|
||||
|
|
|
@ -8,7 +8,7 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
|||
// Data
|
||||
exec (VESTA_CMD."v-list-databases $user json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data, true); } else { $data = is_array($data) ? array_reverse($data, true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data, true) : array();
|
||||
unset($output);
|
||||
|
||||
// Render page
|
||||
|
|
|
@ -22,7 +22,7 @@ if (empty($panel)) {
|
|||
exit;
|
||||
}
|
||||
$panel = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '!=') && !is_array($panel)) { $panel = array(); }
|
||||
if (!is_array($panel)) $panel = array();
|
||||
}
|
||||
|
||||
$path_a = !empty($_REQUEST['dir_a']) ? htmlentities($_REQUEST['dir_a']) : '';
|
||||
|
|
|
@ -9,14 +9,14 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
|||
if (empty($_GET['domain'])){
|
||||
exec (VESTA_CMD."v-list-dns-domains ".escapeshellarg($user)." json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data, true); } else { $data = is_array($data) ? array_reverse($data, true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data, true) : array();
|
||||
unset($output);
|
||||
|
||||
render_page($user, $TAB, 'list_dns');
|
||||
} else {
|
||||
exec (VESTA_CMD."v-list-dns-records ".escapeshellarg($user)." ".escapeshellarg($_GET['domain'])." json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data, true); } else { $data = is_array($data) ? array_reverse($data, true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data, true) : array();
|
||||
unset($output);
|
||||
|
||||
render_page($user, $TAB, 'list_dns_rec');
|
||||
|
|
|
@ -14,7 +14,7 @@ if ($_SESSION['user'] != 'admin') {
|
|||
// Data
|
||||
exec (VESTA_CMD."v-list-firewall-ban json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data, true); } else { $data = is_array($data) ? array_reverse($data, true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data, true) : array();
|
||||
unset($output);
|
||||
|
||||
// Render page
|
||||
|
|
|
@ -15,7 +15,7 @@ if ($_SESSION['user'] != 'admin') {
|
|||
// Data
|
||||
exec (VESTA_CMD."v-list-sys-ips json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data, true); } else { $data = is_array($data) ? array_reverse($data, true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data, true) : array();
|
||||
unset($output);
|
||||
|
||||
// Render page
|
||||
|
|
|
@ -9,14 +9,14 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
|||
if (empty($_GET['domain'])){
|
||||
exec (VESTA_CMD."v-list-mail-domains ".escapeshellarg($user)." json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data, true); } else { $data = is_array($data) ? array_reverse($data, true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data, true) : array();
|
||||
unset($output);
|
||||
|
||||
render_page($user, $TAB, 'list_mail');
|
||||
} else {
|
||||
exec (VESTA_CMD."v-list-mail-accounts ".escapeshellarg($user)." ".escapeshellarg($_GET['domain'])." json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data, true); } else { $data = is_array($data) ? array_reverse($data, true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data, true) : array();
|
||||
unset($output);
|
||||
|
||||
render_page($user, $TAB, 'list_mail_acc');
|
||||
|
|
|
@ -9,7 +9,7 @@ if($_REQUEST['ajax'] == 1){
|
|||
// Data
|
||||
exec (VESTA_CMD."v-list-user-notifications $user json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data,true); } else { $data = is_array($data) ? array_reverse($data,true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data,true) : array();
|
||||
foreach($data as $key => $note){
|
||||
$note['ID'] = $key;
|
||||
$data[$key] = $note;
|
||||
|
@ -25,7 +25,7 @@ $TAB = 'NOTIFICATIONS';
|
|||
// Data
|
||||
exec (VESTA_CMD."v-list-user-notifications $user json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data,true); } else { $data = is_array($data) ? array_reverse($data,true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data,true) : array();
|
||||
|
||||
// Render page
|
||||
render_page($user, $TAB, 'list_notifications');
|
||||
|
|
|
@ -15,7 +15,7 @@ if ($_SESSION['user'] != 'admin') {
|
|||
// Data
|
||||
exec (VESTA_CMD."v-list-user-packages json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '!=') && !is_array($data)) { $data = array(); }
|
||||
if (!is_array($data)) $data = array();
|
||||
unset($output);
|
||||
|
||||
// Render page
|
||||
|
|
|
@ -18,7 +18,7 @@ if (!empty($_GET['period'])) {
|
|||
// Data
|
||||
exec (VESTA_CMD."v-list-sys-rrd json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '!=') && !is_array($data)) { $data = array(); }
|
||||
if (!is_array($data)) $data = array();
|
||||
unset($output);
|
||||
|
||||
// Render page
|
||||
|
|
|
@ -116,11 +116,11 @@ if (isset($_GET['db'])) {
|
|||
// Data
|
||||
exec (VESTA_CMD."v-list-sys-info json", $output, $return_var);
|
||||
$sys = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '!=') && !is_array($sys)) { $sys = array(); }
|
||||
if (!is_array($sys)) $sys = array();
|
||||
unset($output);
|
||||
exec (VESTA_CMD."v-list-sys-services json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '!=') && !is_array($data)) { $data = array(); }
|
||||
if (!is_array($data)) $data = array();
|
||||
unset($output);
|
||||
|
||||
// Render page
|
||||
|
|
|
@ -10,13 +10,13 @@ if ($user == 'admin') {
|
|||
if (empty($_GET['user'])) {
|
||||
exec (VESTA_CMD."v-list-users-stats json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data, true); } else { $data = is_array($data) ? array_reverse($data, true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data, true) : array();
|
||||
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);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data, true); } else { $data = is_array($data) ? array_reverse($data, true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data, true) : array();
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ if ($user == 'admin') {
|
|||
} else {
|
||||
exec (VESTA_CMD."v-list-user-stats $user json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data, true); } else { $data = is_array($data) ? array_reverse($data, true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data, true) : array();
|
||||
unset($output);
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ if ($_SESSION['user'] != 'admin') {
|
|||
// Data
|
||||
exec (VESTA_CMD."v-list-sys-vesta-updates json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '!=') && !is_array($data)) { $data = array(); }
|
||||
if (!is_array($data)) $data = array();
|
||||
unset($output);
|
||||
exec (VESTA_CMD."v-list-sys-vesta-autoupdate plain", $output, $return_var);
|
||||
$autoupdate = $output['0'];
|
||||
|
|
|
@ -12,7 +12,7 @@ if ($user == 'admin') {
|
|||
exec (VESTA_CMD . "v-list-user ".$user." json", $output, $return_var);
|
||||
}
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data,true); } else { $data = is_array($data) ? array_reverse($data,true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data,true) : array();
|
||||
|
||||
// Check and get changelog if needed
|
||||
if ($user == 'admin') {
|
||||
|
|
|
@ -8,7 +8,7 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
|||
// Data
|
||||
exec (VESTA_CMD."v-list-web-domains $user json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data,true); } else { $data = is_array($data) ? array_reverse($data,true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data,true) : array();
|
||||
$ips = json_decode(shell_exec(VESTA_CMD.'v-list-sys-ips json'), true);
|
||||
|
||||
// Render page
|
||||
|
|
|
@ -27,12 +27,8 @@ if (isset($_SESSION['user'])) {
|
|||
if ($_SESSION['user'] == 'admin' && !empty($_GET['loginas'])) {
|
||||
exec (VESTA_CMD . "v-list-user ".escapeshellarg($_GET['loginas'])." json", $output, $return_var);
|
||||
if ( $return_var == 0 ) {
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (!is_array($data)) { $data = array(); }
|
||||
}
|
||||
reset($data);
|
||||
$_SESSION['look'] = key($data);
|
||||
$_SESSION['look_alert'] = 'yes';
|
||||
|
@ -56,12 +52,8 @@ if (isset($_POST['user']) && isset($_POST['password'])) {
|
|||
// Get user's salt
|
||||
$output = '';
|
||||
exec (VESTA_CMD."v-get-user-salt ".$v_user." ".$v_ip." json" , $output, $return_var);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$pam = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$pam = json_decode(implode('', $output), true);
|
||||
if (!is_array($pam)) { $pam = array(); }
|
||||
}
|
||||
if (!is_array($pam)) $pam = array();
|
||||
if ( $return_var > 0 ) {
|
||||
$ERROR = "<a class=\"error\">".__('Invalid username or password')."</a>";
|
||||
} else {
|
||||
|
@ -104,12 +96,8 @@ if (isset($_POST['user']) && isset($_POST['password'])) {
|
|||
|
||||
// Get user speciefic parameters
|
||||
exec (VESTA_CMD . "v-list-user ".$v_user." json", $output, $return_var);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (!is_array($data)) { $data = array(); }
|
||||
}
|
||||
if (!is_array($data)) $data = array();
|
||||
|
||||
// Define session user
|
||||
$_SESSION['user'] = key($data);
|
||||
|
@ -121,12 +109,8 @@ if (isset($_POST['user']) && isset($_POST['password'])) {
|
|||
// Define language
|
||||
$output = '';
|
||||
exec (VESTA_CMD."v-list-sys-languages json", $output, $return_var);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$languages = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$languages = json_decode(implode('', $output), true);
|
||||
if (!is_array($languages)) { $languages = array(); }
|
||||
}
|
||||
if (!is_array($languages)) $languages = array();
|
||||
if (in_array($data[$v_user]['LANGUAGE'], $languages)){
|
||||
$_SESSION['language'] = $data[$v_user]['LANGUAGE'];
|
||||
} else {
|
||||
|
@ -155,12 +139,8 @@ if (isset($_POST['user']) && isset($_POST['password'])) {
|
|||
|
||||
// Check system configuration
|
||||
exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (!is_array($data)) { $data = array('config' => array()); }
|
||||
}
|
||||
if (!is_array($data)) $data = array('config' => array());
|
||||
$sys_arr = $data['config'];
|
||||
foreach ($sys_arr as $key => $value) {
|
||||
$_SESSION[$key] = $value;
|
||||
|
@ -170,22 +150,14 @@ foreach ($sys_arr as $key => $value) {
|
|||
if (empty($_SESSION['language'])) {
|
||||
$output = '';
|
||||
exec (VESTA_CMD."v-list-sys-config json", $output, $return_var);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$config = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$config = json_decode(implode('', $output), true);
|
||||
if (!is_array($config)) { $config = array('config' => array('LANGUAGE' => 'en')); }
|
||||
}
|
||||
if (!is_array($config)) $config = array('config' => array('LANGUAGE' => 'en'));
|
||||
$lang = $config['config']['LANGUAGE'];
|
||||
|
||||
$output = '';
|
||||
exec (VESTA_CMD."v-list-sys-languages json", $output, $return_var);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$languages = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$languages = json_decode(implode('', $output), true);
|
||||
if (!is_array($languages)) { $languages = array(); }
|
||||
}
|
||||
if (!is_array($languages)) $languages = array();
|
||||
if(in_array($lang, $languages)){
|
||||
$_SESSION['language'] = $lang;
|
||||
}
|
||||
|
|
|
@ -24,12 +24,8 @@ if ((!empty($_POST['user'])) && (empty($_POST['code']))) {
|
|||
$cmd="/usr/bin/sudo /usr/local/vesta/bin/v-list-user";
|
||||
exec ($cmd." ".$v_user." json", $output, $return_var);
|
||||
if ( $return_var == 0 ) {
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (!is_array($data)) { $data = array(); }
|
||||
}
|
||||
unset($output);
|
||||
exec("/usr/bin/sudo /usr/local/vesta/bin/v-get-user-value ".$v_user." RKEYEXP", $output, $return_var);
|
||||
$rkeyexp = trim(implode('', $output));
|
||||
|
@ -89,12 +85,8 @@ if ((!empty($_POST['user'])) && (!empty($_POST['code'])) && (!empty($_POST['pass
|
|||
$cmd="/usr/bin/sudo /usr/local/vesta/bin/v-list-user";
|
||||
exec ($cmd." ".$v_user." json", $output, $return_var);
|
||||
if ( $return_var == 0 ) {
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (!is_array($data)) { $data = array(); }
|
||||
}
|
||||
unset($output);
|
||||
$rkey = $data[$user]['RKEY'];
|
||||
if (hash_equals($rkey, $_POST['code'])) {
|
||||
|
|
|
@ -28,7 +28,7 @@ $command = $_SESSION['user'] == 'admin'
|
|||
|
||||
exec (VESTA_CMD . $command, $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '!=') && !is_array($data)) { $data = array(); }
|
||||
if (!is_array($data)) $data = array();
|
||||
|
||||
// Render page
|
||||
render_page($user, $TAB, 'list_search');
|
||||
|
|
|
@ -253,7 +253,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="vst-text step-top">
|
||||
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ftp" <?php if (!empty($v_ftp) && (version_compare(PHP_VERSION, '5.6', '==') ? count($v_ftp_users) : (is_array($v_ftp_users) && count($v_ftp_users)))) echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_additional_ftp_accounts(this)"> <?php print __('Additional FTP Account');?></label>
|
||||
<label><input type="checkbox" size="20" class="vst-checkbox" name="v_ftp" <?php if (!empty($v_ftp) && (is_array($v_ftp_users) && count($v_ftp_users))) echo "checked=yes" ?> onclick="App.Actions.WEB.toggle_additional_ftp_accounts(this)"> <?php print __('Additional FTP Account');?></label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
<!-- /.l-unit__col -->
|
||||
<div class="l-unit__col l-unit__col--right">
|
||||
<div class="l-unit__name separate">
|
||||
<?php if (version_compare(PHP_VERSION, '5.6', '==')) { echo __(strftime("%b", strtotime($key))).strftime(" %Y", strtotime($key)); } else { echo __(date('M', strtotime($key))).date(' Y', strtotime($key)); } ?>
|
||||
<?php echo __(date('M', strtotime($key))).date(' Y', strtotime($key)); ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
$output='';
|
||||
exec (VESTA_CMD . "v-list-user ".$GLOBALS['CURRENT_USER_FINAL']." json", $output, $return_var);
|
||||
$data = json_decode(implode('', $output), true);
|
||||
if (version_compare(PHP_VERSION, '5.6', '==')) { $data = array_reverse($data,true); } else { $data = is_array($data) ? array_reverse($data,true) : array(); }
|
||||
$data = is_array($data) ? array_reverse($data,true) : array();
|
||||
//print_r($data); exit;
|
||||
$key=$GLOBALS['CURRENT_USER_FINAL'];
|
||||
if ($data[$key]['DISK_QUOTA']=='unlimited') echo __('unlimited');
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
<!-- /.l-unit__col -->
|
||||
<div class="l-unit__col l-unit__col--right">
|
||||
<div class="l-unit__name separate">
|
||||
<?php if (version_compare(PHP_VERSION, '5.6', '==')) { echo __(strftime("%b", strtotime($key))).strftime(" %Y", strtotime($key)); } else { echo __(date('M', strtotime($key))).date(' Y', strtotime($key)); } ?>
|
||||
<?php echo __(date('M', strtotime($key))).date(' Y', strtotime($key)); ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue