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 @@
- +
diff --git a/web/templates/admin/add_db.html b/web/templates/admin/add_db.html index b864043b..a81415c8 100644 --- a/web/templates/admin/add_db.html +++ b/web/templates/admin/add_db.html @@ -44,7 +44,7 @@ document.v_add_db.v_password.value = randomstring; } -
+
@@ -54,7 +54,7 @@
- diff --git a/web/templates/admin/add_dns.html b/web/templates/admin/add_dns.html index c78393d3..cbbef75b 100644 --- a/web/templates/admin/add_dns.html +++ b/web/templates/admin/add_dns.html @@ -35,7 +35,7 @@ } -
+
+
diff --git a/web/templates/admin/add_dns_rec.html b/web/templates/admin/add_dns_rec.html index f79eb0b2..3083c929 100644 --- a/web/templates/admin/add_dns_rec.html +++ b/web/templates/admin/add_dns_rec.html @@ -24,7 +24,7 @@ -
+
diff --git a/web/templates/admin/add_firewall.html b/web/templates/admin/add_firewall.html index 9c7bb156..eb7b795c 100644 --- a/web/templates/admin/add_firewall.html +++ b/web/templates/admin/add_firewall.html @@ -35,7 +35,7 @@ } -
+
diff --git a/web/templates/admin/add_ip.html b/web/templates/admin/add_ip.html index 6bb0ec5f..94ec7423 100644 --- a/web/templates/admin/add_ip.html +++ b/web/templates/admin/add_ip.html @@ -35,7 +35,7 @@ } -
+
diff --git a/web/templates/admin/add_mail.html b/web/templates/admin/add_mail.html index 3f284b7d..afc9ca4c 100644 --- a/web/templates/admin/add_mail.html +++ b/web/templates/admin/add_mail.html @@ -24,7 +24,7 @@ -
+
diff --git a/web/templates/admin/add_mail_acc.html b/web/templates/admin/add_mail_acc.html index 65afefea..12c96262 100644 --- a/web/templates/admin/add_mail_acc.html +++ b/web/templates/admin/add_mail_acc.html @@ -45,7 +45,7 @@ } -
+
diff --git a/web/templates/admin/add_package.html b/web/templates/admin/add_package.html index 833b088e..27cb1e19 100644 --- a/web/templates/admin/add_package.html +++ b/web/templates/admin/add_package.html @@ -25,7 +25,7 @@ -
+
diff --git a/web/templates/admin/add_user.html b/web/templates/admin/add_user.html index 2913a949..05e14267 100644 --- a/web/templates/admin/add_user.html +++ b/web/templates/admin/add_user.html @@ -43,7 +43,7 @@ } -
+
diff --git a/web/templates/admin/add_web.html b/web/templates/admin/add_web.html index b8522c1a..ffbc386e 100644 --- a/web/templates/admin/add_web.html +++ b/web/templates/admin/add_web.html @@ -63,7 +63,7 @@ } -
+
@@ -284,7 +284,7 @@
class="ftptable ftptable-nrm" name="v_add_domain_ftp"> @@ -365,7 +365,7 @@
- # () + # ()
diff --git a/web/templates/admin/edit_web.html b/web/templates/admin/edit_web.html index dd2696ce..e70617d2 100644 --- a/web/templates/admin/edit_web.html +++ b/web/templates/admin/edit_web.html @@ -316,7 +316,7 @@
- # () + # ()
@@ -398,7 +398,7 @@
- # () + # ()
diff --git a/web/templates/admin/list_db.html b/web/templates/admin/list_db.html index 81e88386..e3de459d 100644 --- a/web/templates/admin/list_db.html +++ b/web/templates/admin/list_db.html @@ -45,10 +45,10 @@ if ($data[$key]['HOST'] != 'localhost' ) $http_host = $data[$key]['HOST']; if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin"; if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$http_host."/phpmyadmin/"; - if (($data[$key]['TYPE'] == 'mysql') && (!empty($sys['config']['DB_PMA_URL']))) $db_admin_link = $sys['config']['DB_PMA_URL']; + if (($data[$key]['TYPE'] == 'mysql') && (!empty($_SESSION['DB_PMA_URL']))) $db_admin_link = $_SESSION['DB_PMA_URL']; if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin"; if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$http_host."/phppgadmin/"; - if (($data[$key]['TYPE'] == 'pgsql') && (!empty($sys['config']['DB_PGA_URL']))) $db_admin_link = $sys['config']['DB_PGA_URL']; + if (($data[$key]['TYPE'] == 'pgsql') && (!empty($_SESSION['DB_PGA_URL']))) $db_admin_link = $_SESSION['DB_PGA_URL']; ?>
- # () + # ()
diff --git a/web/templates/admin/list_mail.html b/web/templates/admin/list_mail.html index 6aa12afc..7de94f24 100644 --- a/web/templates/admin/list_mail.html +++ b/web/templates/admin/list_mail.html @@ -32,7 +32,7 @@ $value) { ++$i; diff --git a/web/templates/admin/panel.html b/web/templates/admin/panel.html index 2ef51ade..d8bcea57 100644 --- a/web/templates/admin/panel.html +++ b/web/templates/admin/panel.html @@ -8,7 +8,9 @@ + + diff --git a/web/templates/user/list_db.html b/web/templates/user/list_db.html index 008560cf..b7f7fb99 100644 --- a/web/templates/user/list_db.html +++ b/web/templates/user/list_db.html @@ -43,10 +43,10 @@ if ($data[$key]['HOST'] != 'localhost' ) $http_host = $data[$key]['HOST']; if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin"; if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$http_host."/phpmyadmin/"; - if (($data[$key]['TYPE'] == 'mysql') && (!empty($sys['config']['DB_PMA_URL']))) $db_admin_link = $sys['config']['DB_PMA_URL']; + if (($data[$key]['TYPE'] == 'mysql') && (!empty($_SESSION['DB_PMA_URL']))) $db_admin_link = $_SESSION['DB_PMA_URL']; if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin"; if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$http_host."/phppgadmin/"; - if (($data[$key]['TYPE'] == 'pgsql') && (!empty($sys['config']['DB_PGA_URL']))) $db_admin_link = $sys['config']['DB_PGA_URL']; + if (($data[$key]['TYPE'] == 'pgsql') && (!empty($_SESSION['DB_PGA_URL']))) $db_admin_link = $_SESSION['DB_PGA_URL']; ?>
diff --git a/web/templates/user/list_mail.html b/web/templates/user/list_mail.html index c13bd1e2..7d45a00b 100644 --- a/web/templates/user/list_mail.html +++ b/web/templates/user/list_mail.html @@ -30,7 +30,7 @@ $value) { ++$i;