Skip to content

Commit 3aa8bb4

Browse files
committed
Hestia system config was read only on login and cached as Session data
1 parent 7414103 commit 3aa8bb4

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

web/inc/main.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090

9191
if (isset($_SESSION['user'])) {
9292
$user = $_SESSION['user'];
93+
load_hestia_config();
9394
}
9495

9596
if (isset($_SESSION['look']) && ( $_SESSION['look'] != 'admin' )) {
@@ -361,4 +362,14 @@ function is_it_mysql_or_mariadb() {
361362
$mysqltype='mysql';
362363
if (isset($data['mariadb'])) $mysqltype='mariadb';
363364
return $mysqltype;
364-
}
365+
}
366+
367+
function load_hestia_config() {
368+
// Check system configuration
369+
exec (HESTIA_CMD . "v-list-sys-config json", $output, $return_var);
370+
$data = json_decode(implode('', $output), true);
371+
$sys_arr = $data['config'];
372+
foreach ($sys_arr as $key => $value) {
373+
$_SESSION[$key] = $value;
374+
}
375+
}

web/login/index.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,7 @@
148148
}
149149

150150
// Check system configuration
151-
exec (HESTIA_CMD . "v-list-sys-config json", $output, $return_var);
152-
$data = json_decode(implode('', $output), true);
153-
$sys_arr = $data['config'];
154-
foreach ($sys_arr as $key => $value) {
155-
$_SESSION[$key] = $value;
156-
}
151+
load_hestia_config();
157152

158153
// Detect language
159154
if (empty($_SESSION['language'])) {

0 commit comments

Comments
 (0)