when ssl-ip/port is being removed from a main-domain, set ssl_redirect to 0 as it cannot be changed with no ssl-ip/port afterwards

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2014-02-11 15:39:24 +01:00
parent b5a3567238
commit b726a8528b

View File

@@ -1619,6 +1619,13 @@ if ($page == 'domains'
$_update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests; $_update_data['mod_fcgid_maxrequests'] = $mod_fcgid_maxrequests;
$_update_data['parentdomainid'] = $id; $_update_data['parentdomainid'] = $id;
// if we have no more ssl-ip's for this domain,
// all its subdomains must have "ssl-redirect = 0"
$update_sslredirect = '';
if (count($ssl_ipandports) == 1 && $ssl_ipandports[0] == -1) {
$update_sslredirect = ", `ssl_redirect = '0' ";
}
$_update_stmt = Database::prepare(" $_update_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_DOMAINS . "` SET UPDATE `" . TABLE_PANEL_DOMAINS . "` SET
`customerid` = :customerid, `customerid` = :customerid,
@@ -1627,7 +1634,7 @@ if ($page == 'domains'
`phpsettingid` = :phpsettingid, `phpsettingid` = :phpsettingid,
`mod_fcgid_starter` = :mod_fcgid_starter, `mod_fcgid_starter` = :mod_fcgid_starter,
`mod_fcgid_maxrequests` = :mod_fcgid_maxrequests `mod_fcgid_maxrequests` = :mod_fcgid_maxrequests
" . $upd_specialsettings . $updatechildren . " " . $upd_specialsettings . $updatechildren . $update_sslredirect . "
WHERE `parentdomainid` = :parentdomainid WHERE `parentdomainid` = :parentdomainid
"); ");
Database::pexecute($_update_stmt, $_update_data); Database::pexecute($_update_stmt, $_update_data);