only show 'SSL redirect' checkbox for customers when there really is a ip/port combination for SSL; fixes #1179
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -396,7 +396,13 @@ elseif($page == 'domains')
|
||||
}
|
||||
}
|
||||
|
||||
//$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
|
||||
// check if we at least have one ssl-ip/port, #1179
|
||||
$ssl_ipsandports = '';
|
||||
$resultX = $db->query_first("SELECT COUNT(*) as countSSL FROM `panel_ipsandports` WHERE `ssl`='1'");
|
||||
if (isset($resultX['countSSL']) && (int)$resultX['countSSL'] > 0) {
|
||||
$ssl_ipsandports = 'notempty';
|
||||
}
|
||||
|
||||
$openbasedir = makeoption($lng['domain']['docroot'], 0, NULL, true) . makeoption($lng['domain']['homedir'], 1, NULL, true);
|
||||
$pathSelect = makePathfield($userinfo['documentroot'], $userinfo['guid'], $userinfo['guid'], $settings['panel']['pathedit']);
|
||||
|
||||
@@ -602,11 +608,13 @@ elseif($page == 'domains')
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
$ssl_redirect = makeyesno('ssl_redirect', '1', '0', $result['ssl_redirect']);
|
||||
$iswildcarddomain = makeyesno('iswildcarddomain', '1', '0', $result['iswildcarddomain']);
|
||||
$isemaildomain = makeyesno('isemaildomain', '1', '0', $result['isemaildomain']);
|
||||
*/
|
||||
// check if we at least have one ssl-ip/port, #1179
|
||||
$ssl_ipsandports = '';
|
||||
$resultX = $db->query_first("SELECT COUNT(*) as countSSL FROM `panel_ipsandports` WHERE `ssl`='1'");
|
||||
if (isset($resultX['countSSL']) && (int)$resultX['countSSL'] > 0) {
|
||||
$ssl_ipsandports = 'notempty';
|
||||
}
|
||||
|
||||
$openbasedir = makeoption($lng['domain']['docroot'], 0, $result['openbasedir_path'], true) . makeoption($lng['domain']['homedir'], 1, $result['openbasedir_path'], true);
|
||||
|
||||
$result_ipandport = $db->query_first("SELECT `ip` FROM `".TABLE_PANEL_IPSANDPORTS."` WHERE `id`='".(int)$result['ipandport']."'");
|
||||
|
||||
@@ -61,13 +61,13 @@ return array(
|
||||
'select_var' => isset($redirectcode) ? $redirectcode : null
|
||||
),
|
||||
'ssl_redirect' => array(
|
||||
'visible' => ($settings['system']['use_ssl'] == '1' ? true : false),
|
||||
'visible' => ($settings['system']['use_ssl'] == '1' ? ($ssl_ipsandports != '' ? true : false) : false),
|
||||
'label' => 'SSL Redirect',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
array ('label' => $lng['panel']['yes'], 'value' => '1')
|
||||
),
|
||||
'value' => array($result['ssl_redirect'])
|
||||
'value' => array()
|
||||
),
|
||||
'openbasedir_path' => array(
|
||||
'label' => $lng['domain']['openbasedirpath'],
|
||||
|
||||
@@ -79,7 +79,7 @@ return array(
|
||||
'value' => array($result['isemaildomain'])
|
||||
),
|
||||
'ssl_redirect' => array(
|
||||
'visible' => ($settings['system']['use_ssl'] == '1' ? true : false),
|
||||
'visible' => ($settings['system']['use_ssl'] == '1' ? ($ssl_ipsandports != '' ? true : false) : false),
|
||||
'label' => 'SSL Redirect',
|
||||
'type' => 'checkbox',
|
||||
'values' => array(
|
||||
|
||||
Reference in New Issue
Block a user