fix setting of hsts values when security questions are asked; insert config-rebuild task if only hsts stuff changes; fix undefined variable regarding alias domain
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -777,7 +777,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
'termination_date' => $termination_date,
|
'termination_date' => $termination_date,
|
||||||
'issubof' => $issubof,
|
'issubof' => $issubof,
|
||||||
'letsencrypt' => $letsencrypt,
|
'letsencrypt' => $letsencrypt,
|
||||||
'hsts' => $hsts_maxage,
|
'hsts_maxage' => $hsts_maxage,
|
||||||
'hsts_sub' => $hsts_sub,
|
'hsts_sub' => $hsts_sub,
|
||||||
'hsts_preload' => $hsts_preload
|
'hsts_preload' => $hsts_preload
|
||||||
);
|
);
|
||||||
@@ -1402,6 +1402,11 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$letsencrypt = (int) $_POST['letsencrypt'];
|
$letsencrypt = (int) $_POST['letsencrypt'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HSTS
|
||||||
|
$hsts_maxage = isset($_POST['hsts_maxage']) ? (int)$_POST['hsts_maxage'] : 0;
|
||||||
|
$hsts_sub = isset($_POST['hsts_sub']) && (int)$_POST['hsts_sub'] == 1 ? 1 : 0;
|
||||||
|
$hsts_preload = isset($_POST['hsts_preload']) && (int)$_POST['hsts_preload'] == 1 ? 1 : 0;
|
||||||
|
|
||||||
$ssl_ipandports = array();
|
$ssl_ipandports = array();
|
||||||
if (isset($_POST['ssl_ipandport']) && ! is_array($_POST['ssl_ipandport'])) {
|
if (isset($_POST['ssl_ipandport']) && ! is_array($_POST['ssl_ipandport'])) {
|
||||||
$_POST['ssl_ipandport'] = unserialize($_POST['ssl_ipandport']);
|
$_POST['ssl_ipandport'] = unserialize($_POST['ssl_ipandport']);
|
||||||
@@ -1428,11 +1433,6 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// HSTS
|
|
||||||
$hsts_maxage = isset($_POST['hsts_maxage']) ? (int)$_POST['hsts_maxage'] : 0;
|
|
||||||
$hsts_sub = isset($_POST['hsts_sub']) && (int)$_POST['hsts_sub'] == 1 ? 1 : 0;
|
|
||||||
$hsts_preload = isset($_POST['hsts_preload']) && (int)$_POST['hsts_preload'] == 1 ? 1 : 0;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$ssl_redirect = 0;
|
$ssl_redirect = 0;
|
||||||
$letsencrypt = 0;
|
$letsencrypt = 0;
|
||||||
@@ -1594,7 +1594,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
'ipandport' => serialize($ipandports),
|
'ipandport' => serialize($ipandports),
|
||||||
'ssl_ipandport' => serialize($ssl_ipandports),
|
'ssl_ipandport' => serialize($ssl_ipandports),
|
||||||
'letsencrypt' => $letsencrypt,
|
'letsencrypt' => $letsencrypt,
|
||||||
'hsts' => $hsts_maxage,
|
'hsts_maxage' => $hsts_maxage,
|
||||||
'hsts_sub' => $hsts_sub,
|
'hsts_sub' => $hsts_sub,
|
||||||
'hsts_preload' => $hsts_preload
|
'hsts_preload' => $hsts_preload
|
||||||
);
|
);
|
||||||
@@ -1615,7 +1615,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$wwwserveralias = ($serveraliasoption == '1') ? '1' : '0';
|
$wwwserveralias = ($serveraliasoption == '1') ? '1' : '0';
|
||||||
$iswildcarddomain = ($serveraliasoption == '0') ? '1' : '0';
|
$iswildcarddomain = ($serveraliasoption == '0') ? '1' : '0';
|
||||||
|
|
||||||
if ($documentroot != $result['documentroot'] || $ssl_redirect != $result['ssl_redirect'] || $wwwserveralias != $result['wwwserveralias'] || $iswildcarddomain != $result['iswildcarddomain'] || $openbasedir != $result['openbasedir'] || $phpsettingid != $result['phpsettingid'] || $mod_fcgid_starter != $result['mod_fcgid_starter'] || $mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests'] || $specialsettings != $result['specialsettings'] || $aliasdomain != $result['aliasdomain'] || $issubof != $result['ismainbutsubto'] || $email_only != $result['email_only'] || ($speciallogfile != $result['speciallogfile'] && $speciallogverified == '1') || $letsencrypt != $result['letsencrypt']) {
|
if ($documentroot != $result['documentroot'] || $ssl_redirect != $result['ssl_redirect'] || $wwwserveralias != $result['wwwserveralias'] || $iswildcarddomain != $result['iswildcarddomain'] || $openbasedir != $result['openbasedir'] || $phpsettingid != $result['phpsettingid'] || $mod_fcgid_starter != $result['mod_fcgid_starter'] || $mod_fcgid_maxrequests != $result['mod_fcgid_maxrequests'] || $specialsettings != $result['specialsettings'] || $aliasdomain != $result['aliasdomain'] || $issubof != $result['ismainbutsubto'] || $email_only != $result['email_only'] || ($speciallogfile != $result['speciallogfile'] && $speciallogverified == '1') || $letsencrypt != $result['letsencrypt'] || $hsts_maxage != $result['hsts'] || $hsts_sub != $result['hsts_sub'] || $hsts_preload != $result['hsts_preload']) {
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -578,7 +578,7 @@ if ($page == 'overview') {
|
|||||||
$_doredirect = true;
|
$_doredirect = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$aliasdomain = intval($_POST['alias']);
|
$aliasdomain = isset($_POST['alias']) ? intval($_POST['alias']) : 0;
|
||||||
|
|
||||||
if (isset($_POST['selectserveralias'])) {
|
if (isset($_POST['selectserveralias'])) {
|
||||||
$iswildcarddomain = ($_POST['selectserveralias'] == '0') ? '1' : '0';
|
$iswildcarddomain = ($_POST['selectserveralias'] == '0') ? '1' : '0';
|
||||||
@@ -681,7 +681,11 @@ if ($page == 'overview') {
|
|||||||
|| $aliasdomain != $result['aliasdomain']
|
|| $aliasdomain != $result['aliasdomain']
|
||||||
|| $openbasedir_path != $result['openbasedir_path']
|
|| $openbasedir_path != $result['openbasedir_path']
|
||||||
|| $ssl_redirect != $result['ssl_redirect']
|
|| $ssl_redirect != $result['ssl_redirect']
|
||||||
|| $letsencrypt != $result['letsencrypt']) {
|
|| $letsencrypt != $result['letsencrypt']
|
||||||
|
|| $hsts_maxage != $result['hsts']
|
||||||
|
|| $hsts_sub != $result['hsts_sub']
|
||||||
|
|| $hsts_preload != $result['hsts_preload']
|
||||||
|
) {
|
||||||
$log->logAction(USR_ACTION, LOG_INFO, "edited domain '" . $idna_convert->decode($result['domain']) . "'");
|
$log->logAction(USR_ACTION, LOG_INFO, "edited domain '" . $idna_convert->decode($result['domain']) . "'");
|
||||||
|
|
||||||
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
$stmt = Database::prepare("UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
|
||||||
|
|||||||
Reference in New Issue
Block a user