diff --git a/web/add/db/index.php b/web/add/db/index.php index a9d7e8fa..4164f290 100644 --- a/web/add/db/index.php +++ b/web/add/db/index.php @@ -64,17 +64,14 @@ if (!empty($_POST['ok'])) { // Get database manager url if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-list-sys-config json", $output, $return_var); - $sys = json_decode(implode('', $output), true); - unset($output); list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"] . ":"); if ($_POST['v_host'] != 'localhost' ) $http_host = $_POST['v_host']; if ($_POST['v_type'] == 'mysql') $db_admin = "phpMyAdmin"; if ($_POST['v_type'] == 'mysql') $db_admin_link = "http://".$http_host."/phpmyadmin/"; - if (($_POST['v_type'] == 'mysql') && (!empty($sys['config']['DB_PMA_URL']))) $db_admin_link = $sys['config']['DB_PMA_URL']; + if (($_POST['v_type'] == 'mysql') && (!empty($_SESSION['DB_PMA_URL']))) $db_admin_link = $_SESSION['DB_PMA_URL']; if ($_POST['v_type'] == 'pgsql') $db_admin = "phpPgAdmin"; if ($_POST['v_type'] == 'pgsql') $db_admin_link = "http://".$http_host."/phppgadmin/"; - if (($_POST['v_type'] == 'pgsql') && (!empty($sys['config']['DB_PGA_URL']))) $db_admin_link = $sys['config']['DB_PGA_URL']; + if (($_POST['v_type'] == 'pgsql') && (!empty($_SESSION['DB_PGA_URL']))) $db_admin_link = $_SESSION['DB_PGA_URL']; } // Email login credentials @@ -109,9 +106,7 @@ top_panel($user,$TAB); $v_db_email = $panel[$user]['CONTACT']; // List avaiable database types -exec (VESTA_CMD."v-list-database-types 'json'", $output, $return_var); -$db_types = json_decode(implode('', $output), true); -unset($output); +$db_types = split(",",$_SESSION['DB_SYSTEM']); // List available database servers $db_hosts = array(); diff --git a/web/add/mail/index.php b/web/add/mail/index.php index 41c0714d..518b2e7c 100644 --- a/web/add/mail/index.php +++ b/web/add/mail/index.php @@ -144,12 +144,9 @@ if (!empty($_POST['ok_acc'])) { // Get webmail url if (empty($_SESSION['error_msg'])) { - exec (VESTA_CMD."v-list-sys-config json", $output, $return_var); - $sys = json_decode(implode('', $output), true); - unset($output); list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"].":"); $webmail = "http://".$http_host."/webmail/"; - if (!empty($sys['config']['MAIL_URL'])) $webmail = $sys['config']['MAIL_URL']; + if (!empty($_SESSION['MAIL_URL'])) $webmail = $_SESSION['MAIL_URL']; } // Flush field values on success diff --git a/web/inc/main.php b/web/inc/main.php index 2ce46813..f3aafb9b 100644 --- a/web/inc/main.php +++ b/web/inc/main.php @@ -1,5 +1,12 @@ $value) { + $_SESSION[$key] = $value; +} + +// Set default language +if (empty($_SESSION['language'])) $_SESSION['language']=$_SESSION['LANGUAGE']; +if (empty($_SESSION['language'])) $_SESSION['language']='en'; + // Auth if (isset($_POST['user']) && isset($_POST['password'])) { $v_user = escapeshellarg($_POST['user']); @@ -33,17 +45,6 @@ if (isset($_POST['user']) && isset($_POST['password'])) { exec(VESTA_CMD ."v-check-user-password ".$v_user." ".$v_password." '".$_SERVER["REMOTE_ADDR"]."'", $output, $return_var); if ( $return_var > 0 ) { $ERROR = "".__('Invalid username or password').""; - - // Set system language - unset($output); - exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var); - $data = json_decode(implode('', $output), true); - if (!empty( $data['config']['LANGUAGE'])) { - $_SESSION['language'] = $data['config']['LANGUAGE']; - } else { - $_SESSION['language'] = 'en'; - } - require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n/'.$_SESSION['language'].'.php'); require_once('../templates/header.html'); require_once('../templates/login.html'); @@ -65,15 +66,6 @@ if (isset($_POST['user']) && isset($_POST['password'])) { } } } else { - // Set system language - exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var); - $data = json_decode(implode('', $output), true); - if (!empty( $data['config']['LANGUAGE'])) { - $_SESSION['language'] = $data['config']['LANGUAGE']; - } else { - $_SESSION['language'] = 'en'; - } - require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n/'.$_SESSION['language'].'.php'); require_once('../templates/header.html'); require_once('../templates/login.html'); diff --git a/web/reset/index.php b/web/reset/index.php index f27c396e..bd8ccdc5 100644 --- a/web/reset/index.php +++ b/web/reset/index.php @@ -70,27 +70,19 @@ if ((!empty($_POST['user'])) && (!empty($_POST['code'])) && (!empty($_POST['pass } } +// Set system language +exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var); +$data = json_decode(implode('', $output), true); +if (!empty( $data['config']['LANGUAGE'])) { + $_SESSION['language'] = $data['config']['LANGUAGE']; +} else { + $_SESSION['language'] = 'en'; +} if (empty($_GET['action'])) { - // Set system language - exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var); - $data = json_decode(implode('', $output), true); - if (!empty( $data['config']['LANGUAGE'])) { - $_SESSION['language'] = $data['config']['LANGUAGE']; - } else { - $_SESSION['language'] = 'en'; - } require_once '../templates/header.html'; require_once '../templates/reset_1.html'; } else { - // Set system language - exec (VESTA_CMD . "v-list-sys-config json", $output, $return_var); - $data = json_decode(implode('', $output), true); - if (!empty( $data['config']['LANGUAGE'])) { - $_SESSION['language'] = $data['config']['LANGUAGE']; - } else { - $_SESSION['language'] = 'en'; - } require_once '../templates/header.html'; if ($_GET['action'] == 'code' ) { require_once '../templates/reset_2.html'; diff --git a/web/templates/admin/add_cron.html b/web/templates/admin/add_cron.html index ac998b9c..c2604711 100644 --- a/web/templates/admin/add_cron.html +++ b/web/templates/admin/add_cron.html @@ -24,7 +24,7 @@