Skip to content

Commit 8dd441e

Browse files
committed
Fix issue with default packages not selected correctly
1 parent 81d077b commit 8dd441e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

web/add/web/index.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,27 +444,30 @@
444444
}else{
445445
$v_ssl_forcessl = 'no';
446446
}
447-
447+
// List user package
448+
exec (HESTIA_CMD."v-list-user ".$user." json", $output, $return_var);
449+
$user_config = json_decode(implode('', $output), true);
450+
unset($output);
448451
// List web templates and set default values
449452
exec (HESTIA_CMD."v-list-web-templates json", $output, $return_var);
450453
$templates = json_decode(implode('', $output), true);
451454
unset($output);
452-
$v_template = (!empty($_POST['v_template'])) ? $_POST['v_template'] : $user_config['WEB_TEMPLATE'];
455+
$v_template = (!empty($_POST['v_template'])) ? $_POST['v_template'] : $user_config[$user]['WEB_TEMPLATE'];
453456

454457
// List backend templates
455458
if (!empty($_SESSION['WEB_BACKEND'])) {
456459
exec (HESTIA_CMD."v-list-web-templates-backend json", $output, $return_var);
457460
$backend_templates = json_decode(implode('', $output), true);
458461
unset($output);
459-
$v_backend_template = (!empty($_POST['v_backend_template'])) ? $_POST['v_backend_template'] : $user_config['BACKEND_TEMPLATE'];
462+
$v_backend_template = (!empty($_POST['v_backend_template'])) ? $_POST['v_backend_template'] : $user_config[$user]['BACKEND_TEMPLATE'];
460463
}
461464

462465
// List proxy templates
463466
if (!empty($_SESSION['PROXY_SYSTEM'])) {
464467
exec (HESTIA_CMD."v-list-web-templates-proxy json", $output, $return_var);
465468
$proxy_templates = json_decode(implode('', $output), true);
466469
unset($output);
467-
$v_proxy_template = (!empty($_POST['v_proxy_template'])) ? $_POST['v_proxy_template'] : $user_config['PROXY_TEMPLATE'];
470+
$v_proxy_template = (!empty($_POST['v_proxy_template'])) ? $_POST['v_proxy_template'] : $user_config[$user]['PROXY_TEMPLATE'];
468471

469472
}
470473

0 commit comments

Comments
 (0)