Compare commits
29 Commits
0.9.38-rc1
...
0.9.38.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9540cb158c | ||
|
|
1984aced9d | ||
|
|
ca2949da71 | ||
|
|
eb8449fd79 | ||
|
|
547140bafb | ||
|
|
d245bca445 | ||
|
|
5f899a5510 | ||
|
|
432645431c | ||
|
|
7e4164da26 | ||
|
|
fad607c6e8 | ||
|
|
d6b56262ce | ||
|
|
c409d8a6ba | ||
|
|
4274b8a737 | ||
|
|
60c1babd93 | ||
|
|
ec6ddd054d | ||
|
|
76c200a56c | ||
|
|
a44be363a6 | ||
|
|
304926260f | ||
|
|
462fca7328 | ||
|
|
884b2ed913 | ||
|
|
af77453bfe | ||
|
|
fa45de6586 | ||
|
|
b4e8458076 | ||
|
|
979b1b0ad8 | ||
|
|
2bee58166b | ||
|
|
3597a89da3 | ||
|
|
f406962dfd | ||
|
|
ce31a0b3fd | ||
|
|
fc2ae594cb |
@@ -234,6 +234,7 @@ return array(
|
|||||||
'type' => 'option',
|
'type' => 'option',
|
||||||
'default' => '',
|
'default' => '',
|
||||||
'option_mode' => 'multiple',
|
'option_mode' => 'multiple',
|
||||||
|
'option_emptyallowed' => true,
|
||||||
'option_options' => array(
|
'option_options' => array(
|
||||||
'email' => $lng['menue']['email']['email'],
|
'email' => $lng['menue']['email']['email'],
|
||||||
'mysql' => $lng['menue']['mysql']['mysql'],
|
'mysql' => $lng['menue']['mysql']['mysql'],
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ return array(
|
|||||||
'varname' => 'le_froxlor_enabled',
|
'varname' => 'le_froxlor_enabled',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingClearCertificates',
|
||||||
'visible' => Settings::Get('system.leenabled')
|
'visible' => Settings::Get('system.leenabled')
|
||||||
),
|
),
|
||||||
'system_le_froxlor_redirect' => array(
|
'system_le_froxlor_redirect' => array(
|
||||||
|
|||||||
@@ -179,6 +179,17 @@ return array(
|
|||||||
'nginx'
|
'nginx'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
'system_nginx_http2_support' => array(
|
||||||
|
'label' => $lng['serversettings']['nginx_http2_support'],
|
||||||
|
'settinggroup' => 'system',
|
||||||
|
'varname' => 'nginx_http2_support',
|
||||||
|
'type' => 'bool',
|
||||||
|
'default' => false,
|
||||||
|
'save_method' => 'storeSettingField',
|
||||||
|
'websrv_avail' => array(
|
||||||
|
'nginx'
|
||||||
|
)
|
||||||
|
),
|
||||||
'system_nginx_php_backend' => array(
|
'system_nginx_php_backend' => array(
|
||||||
'label' => $lng['serversettings']['nginx_php_backend'],
|
'label' => $lng['serversettings']['nginx_php_backend'],
|
||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
@@ -260,11 +271,7 @@ return array(
|
|||||||
'varname' => 'enabled',
|
'varname' => 'enabled',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'default' => false,
|
'default' => false,
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField'
|
||||||
'websrv_avail' => array(
|
|
||||||
'apache2',
|
|
||||||
'lighttpd'
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
'customredirect_default' => array(
|
'customredirect_default' => array(
|
||||||
'label' => $lng['serversettings']['customredirect_default'],
|
'label' => $lng['serversettings']['customredirect_default'],
|
||||||
@@ -274,11 +281,7 @@ return array(
|
|||||||
'default' => '1',
|
'default' => '1',
|
||||||
'option_mode' => 'one',
|
'option_mode' => 'one',
|
||||||
'option_options_method' => 'getRedirectCodes',
|
'option_options_method' => 'getRedirectCodes',
|
||||||
'save_method' => 'storeSettingField',
|
'save_method' => 'storeSettingField'
|
||||||
'websrv_avail' => array(
|
|
||||||
'apache2',
|
|
||||||
'lighttpd'
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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
|
||||||
);
|
);
|
||||||
@@ -1081,8 +1081,12 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
} elseif ($action == 'edit' && $id != 0) {
|
} elseif ($action == 'edit' && $id != 0) {
|
||||||
|
|
||||||
$result_stmt = Database::prepare("
|
$result_stmt = Database::prepare("
|
||||||
SELECT `d`.*, `c`.`customerid` FROM `" . TABLE_PANEL_DOMAINS . "` `d` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`)
|
SELECT `d`.*, `c`.`customerid`
|
||||||
WHERE `d`.`parentdomainid` = '0' AND `d`.`id` = :id" . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid"));
|
FROM `" . TABLE_PANEL_DOMAINS . "` `d`
|
||||||
|
LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING(`customerid`)
|
||||||
|
WHERE `d`.`parentdomainid` = '0'
|
||||||
|
AND `d`.`id` = :id" . ($userinfo['customers_see_all'] ? '' : " AND `d`.`adminid` = :adminid")
|
||||||
|
);
|
||||||
$params = array(
|
$params = array(
|
||||||
'id' => $id
|
'id' => $id
|
||||||
);
|
);
|
||||||
@@ -1227,7 +1231,7 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$adminid = $result['adminid'];
|
$adminid = $result['adminid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$aliasdomain = intval($_POST['alias']);
|
$aliasdomain = isset($_POST['alias']) ? intval($_POST['alias']) : 0;
|
||||||
$issubof = intval($_POST['issubof']);
|
$issubof = intval($_POST['issubof']);
|
||||||
$subcanemaildomain = intval($_POST['subcanemaildomain']);
|
$subcanemaildomain = intval($_POST['subcanemaildomain']);
|
||||||
$caneditdomain = isset($_POST['caneditdomain']) ? intval($_POST['caneditdomain']) : 0;
|
$caneditdomain = isset($_POST['caneditdomain']) ? intval($_POST['caneditdomain']) : 0;
|
||||||
@@ -1398,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']);
|
||||||
@@ -1424,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;
|
||||||
@@ -1590,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
|
||||||
);
|
);
|
||||||
@@ -1611,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');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1640,6 +1644,16 @@ if ($page == 'domains' || $page == 'overview') {
|
|||||||
$log->logAction(ADM_ACTION, LOG_NOTICE, "deleted domain #" . $id . " from mail-tables");
|
$log->logAction(ADM_ACTION, LOG_NOTICE, "deleted domain #" . $id . " from mail-tables");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check whether LE has been disabled, so we remove the certificate
|
||||||
|
if ($letsencrypt == '0' && $result['letsencrypt'] == '1') {
|
||||||
|
$del_stmt = Database::prepare("
|
||||||
|
DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :id
|
||||||
|
");
|
||||||
|
Database::pexecute($del_stmt, array(
|
||||||
|
'id' => $id
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
$updatechildren = '';
|
$updatechildren = '';
|
||||||
|
|
||||||
if ($subcanemaildomain == '0' && $result['subcanemaildomain'] != '0') {
|
if ($subcanemaildomain == '0' && $result['subcanemaildomain'] != '0') {
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -720,11 +724,20 @@ if ($page == 'overview') {
|
|||||||
// trigger when domain id for alias destination has changed: both for old and new destination
|
// trigger when domain id for alias destination has changed: both for old and new destination
|
||||||
triggerLetsEncryptCSRForAliasDestinationDomain($result['aliasdomain'], $log);
|
triggerLetsEncryptCSRForAliasDestinationDomain($result['aliasdomain'], $log);
|
||||||
triggerLetsEncryptCSRForAliasDestinationDomain($aliasdomain, $log);
|
triggerLetsEncryptCSRForAliasDestinationDomain($aliasdomain, $log);
|
||||||
} else
|
} elseif ($result['wwwserveralias'] != $wwwserveralias || $result['letsencrypt'] != $letsencrypt) {
|
||||||
if ($result['wwwserveralias'] != $wwwserveralias || $result['letsencrypt'] != $letsencrypt) {
|
// or when wwwserveralias or letsencrypt was changed
|
||||||
// or when wwwserveralias or letsencrypt was changed
|
triggerLetsEncryptCSRForAliasDestinationDomain($aliasdomain, $log);
|
||||||
triggerLetsEncryptCSRForAliasDestinationDomain($aliasdomain, $log);
|
}
|
||||||
}
|
|
||||||
|
// check whether LE has been disabled, so we remove the certificate
|
||||||
|
if ($letsencrypt == '0' && $result['letsencrypt'] == '1') {
|
||||||
|
$del_stmt = Database::prepare("
|
||||||
|
DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = :id
|
||||||
|
");
|
||||||
|
Database::pexecute($del_stmt, array(
|
||||||
|
'id' => $id
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
inserttask('1');
|
inserttask('1');
|
||||||
|
|
||||||
|
|||||||
@@ -496,6 +496,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('system', 'ssl_cert_chainfile', ''),
|
('system', 'ssl_cert_chainfile', ''),
|
||||||
('system', 'ssl_cipher_list', 'ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128'),
|
('system', 'ssl_cipher_list', 'ECDH+AESGCM:ECDH+AES256:!aNULL:!MD5:!DSS:!DH:!AES128'),
|
||||||
('system', 'nginx_php_backend', '127.0.0.1:8888'),
|
('system', 'nginx_php_backend', '127.0.0.1:8888'),
|
||||||
|
('system', 'nginx_http2_support', '0'),
|
||||||
('system', 'perl_server', 'unix:/var/run/nginx/cgiwrap-dispatch.sock'),
|
('system', 'perl_server', 'unix:/var/run/nginx/cgiwrap-dispatch.sock'),
|
||||||
('system', 'phpreload_command', ''),
|
('system', 'phpreload_command', ''),
|
||||||
('system', 'apache24', '0'),
|
('system', 'apache24', '0'),
|
||||||
@@ -575,8 +576,9 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES
|
|||||||
('panel', 'password_numeric', '0'),
|
('panel', 'password_numeric', '0'),
|
||||||
('panel', 'password_special_char_required', '0'),
|
('panel', 'password_special_char_required', '0'),
|
||||||
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
('panel', 'password_special_char', '!?<>§$%+#=@'),
|
||||||
('panel', 'version', '0.9.38-rc1'),
|
('panel', 'customer_hide_options', ''),
|
||||||
('panel', 'db_version', '201610070');
|
('panel', 'version', '0.9.38.1'),
|
||||||
|
('panel', 'db_version', '201611180');
|
||||||
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `panel_tasks`;
|
DROP TABLE IF EXISTS `panel_tasks`;
|
||||||
|
|||||||
@@ -3507,3 +3507,30 @@ if (isFroxlorVersion('0.9.37')) {
|
|||||||
showUpdateStep("Updating from 0.9.37 to 0.9.38-rc1", false);
|
showUpdateStep("Updating from 0.9.37 to 0.9.38-rc1", false);
|
||||||
updateToVersion('0.9.38-rc1');
|
updateToVersion('0.9.38-rc1');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.38-rc1')) {
|
||||||
|
|
||||||
|
showUpdateStep("Updating from 0.9.38-rc1 to 0.9.38-rc2", false);
|
||||||
|
updateToVersion('0.9.38-rc2');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.38-rc2')) {
|
||||||
|
|
||||||
|
showUpdateStep("Updating from 0.9.38-rc2 to 0.9.38 final", false);
|
||||||
|
updateToVersion('0.9.38');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isDatabaseVersion('201610070')) {
|
||||||
|
|
||||||
|
showUpdateStep("Add Nginx http2 setting");
|
||||||
|
Settings::AddNew("system.nginx_http2_support", 0);
|
||||||
|
lastStepStatus(0);
|
||||||
|
|
||||||
|
updateToDbVersion('201611180');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isFroxlorVersion('0.9.38')) {
|
||||||
|
|
||||||
|
showUpdateStep("Updating from 0.9.38 to 0.9.38.1", false);
|
||||||
|
updateToVersion('0.9.38.1');
|
||||||
|
}
|
||||||
|
|||||||
@@ -135,15 +135,6 @@ class phpinterface_fcgid {
|
|||||||
$openbasedir .= appendOpenBasedirPath($this->getTempDir());
|
$openbasedir .= appendOpenBasedirPath($this->getTempDir());
|
||||||
$openbasedir .= $_phpappendopenbasedir;
|
$openbasedir .= $_phpappendopenbasedir;
|
||||||
|
|
||||||
$openbasedir = explode(':', $openbasedir);
|
|
||||||
$clean_openbasedir = array();
|
|
||||||
foreach ($openbasedir as $number => $path) {
|
|
||||||
if (trim($path) != '/') {
|
|
||||||
$clean_openbasedir[] = makeCorrectDir($path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$openbasedir = implode(':', $clean_openbasedir);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$openbasedir = 'none';
|
$openbasedir = 'none';
|
||||||
$openbasedirc = ';';
|
$openbasedirc = ';';
|
||||||
|
|||||||
@@ -267,15 +267,6 @@ class phpinterface_fpm {
|
|||||||
|
|
||||||
$openbasedir .= appendOpenBasedirPath($this->getTempDir());
|
$openbasedir .= appendOpenBasedirPath($this->getTempDir());
|
||||||
$openbasedir .= $_phpappendopenbasedir;
|
$openbasedir .= $_phpappendopenbasedir;
|
||||||
|
|
||||||
$openbasedir = explode(':', $openbasedir);
|
|
||||||
$clean_openbasedir = array();
|
|
||||||
foreach ($openbasedir as $number => $path) {
|
|
||||||
if (trim($path) != '/') {
|
|
||||||
$clean_openbasedir[] = makeCorrectDir($path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$openbasedir = implode(':', $clean_openbasedir);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$fpm_config.= 'php_admin_value[session.save_path] = ' . makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/') . "\n";
|
$fpm_config.= 'php_admin_value[session.save_path] = ' . makeCorrectDir(Settings::Get('phpfpm.tmpdir') . '/' . $this->_domain['loginname'] . '/') . "\n";
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ return array(
|
|||||||
'int_max' => 94608000, // 3-years
|
'int_max' => 94608000, // 3-years
|
||||||
'value' => 0
|
'value' => 0
|
||||||
),
|
),
|
||||||
'hsts_incsub' => array(
|
'hsts_sub' => array(
|
||||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||||
'label' => $lng['admin']['domain_hsts_incsub']['title'],
|
'label' => $lng['admin']['domain_hsts_incsub']['title'],
|
||||||
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
|
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ return array(
|
|||||||
'int_max' => 94608000, // 3-years
|
'int_max' => 94608000, // 3-years
|
||||||
'value' => $result['hsts']
|
'value' => $result['hsts']
|
||||||
),
|
),
|
||||||
'hsts_incsub' => array(
|
'hsts_sub' => array(
|
||||||
'visible' => ($ssl_ipsandports != '' ? true : false),
|
'visible' => ($ssl_ipsandports != '' ? true : false),
|
||||||
'label' => $lng['admin']['domain_hsts_incsub']['title'],
|
'label' => $lng['admin']['domain_hsts_incsub']['title'],
|
||||||
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
|
'desc' => $lng['admin']['domain_hsts_incsub']['description'],
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ return array(
|
|||||||
'type' => 'text'
|
'type' => 'text'
|
||||||
),
|
),
|
||||||
'redirectcode' => array(
|
'redirectcode' => array(
|
||||||
'visible' => ((Settings::Get('system.webserver') == 'apache2' && Settings::Get('customredirect.enabled') == '1') ? true : false),
|
'visible' => (Settings::Get('customredirect.enabled') == '1' ? true : false),
|
||||||
'label' => $lng['domains']['redirectifpathisurl'],
|
'label' => $lng['domains']['redirectifpathisurl'],
|
||||||
'desc' => $lng['domains']['redirectifpathisurlinfo'],
|
'desc' => $lng['domains']['redirectifpathisurlinfo'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ return array(
|
|||||||
'value' => $urlvalue
|
'value' => $urlvalue
|
||||||
),
|
),
|
||||||
'redirectcode' => array(
|
'redirectcode' => array(
|
||||||
'visible' => ((Settings::Get('system.webserver') == 'apache2' && Settings::Get('customredirect.enabled') == '1') ? true : false),
|
'visible' => (Settings::Get('customredirect.enabled') == '1' ? true : false),
|
||||||
'label' => $lng['domains']['redirectifpathisurl'],
|
'label' => $lng['domains']['redirectifpathisurl'],
|
||||||
'desc' => $lng['domains']['redirectifpathisurlinfo'],
|
'desc' => $lng['domains']['redirectifpathisurlinfo'],
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
|
|||||||
@@ -275,13 +275,11 @@ function createDomainZone($domain_id, $froxlorhostname = false, $isMainButSubTo
|
|||||||
Database::pexecute($upd_stmt, array('serial' => $domain['bindserial'], 'id' => $domain['id']));
|
Database::pexecute($upd_stmt, array('serial' => $domain['bindserial'], 'id' => $domain['id']));
|
||||||
}
|
}
|
||||||
|
|
||||||
$soa_content = $primary_ns . " " . escapeSoaAdminMail(Settings::Get('panel.adminmail')) . " (" . PHP_EOL;
|
// PowerDNS does not like multi-line-format
|
||||||
$soa_content .= $domain['bindserial'] . "\t; serial" . PHP_EOL;
|
$soa_content = $primary_ns . " " . escapeSoaAdminMail(Settings::Get('panel.adminmail')) . " ";
|
||||||
|
$soa_content .= $domain['bindserial'] . " ";
|
||||||
// TODO for now, dummy time-periods
|
// TODO for now, dummy time-periods
|
||||||
$soa_content .= "1800\t; refresh (30 mins)" . PHP_EOL;
|
$soa_content .= "1800 900 604800 1200";
|
||||||
$soa_content .= "900\t; retry (15 mins)" . PHP_EOL;
|
|
||||||
$soa_content .= "604800\t; expire (7 days)" . PHP_EOL;
|
|
||||||
$soa_content .= "1200\t)\t; minimum (20 mins)";
|
|
||||||
|
|
||||||
$soa_record = new DnsEntry('@', 'SOA', $soa_content);
|
$soa_record = new DnsEntry('@', 'SOA', $soa_content);
|
||||||
array_unshift($zonerecords, $soa_record);
|
array_unshift($zonerecords, $soa_record);
|
||||||
|
|||||||
@@ -17,27 +17,57 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of found directories
|
* Returns an array of found directories
|
||||||
*
|
*
|
||||||
* This function checks every found directory if they match either $uid or $gid, if they do
|
* This function checks every found directory if they match either $uid or $gid, if they do
|
||||||
* the found directory is valid. It uses recursive-iterators to find subdirectories.
|
* the found directory is valid. It uses recursive-iterators to find subdirectories.
|
||||||
*
|
*
|
||||||
* @param string $path the path to start searching in
|
* @param string $path
|
||||||
* @param int $uid the uid which must match the found directories
|
* the path to start searching in
|
||||||
* @param int $gid the gid which must match the found direcotries
|
* @param int $uid
|
||||||
|
* the uid which must match the found directories
|
||||||
|
* @param int $gid
|
||||||
|
* the gid which must match the found direcotries
|
||||||
*
|
*
|
||||||
* @return array Array of found valid paths
|
* @return array Array of found valid paths
|
||||||
*/
|
*/
|
||||||
function findDirs($path, $uid, $gid) {
|
function findDirs($path, $uid, $gid)
|
||||||
|
{
|
||||||
$_fileList = array ();
|
$_fileList = array();
|
||||||
$path = makeCorrectDir($path);
|
$path = makeCorrectDir($path);
|
||||||
|
|
||||||
// valid directory?
|
// valid directory?
|
||||||
if (is_dir($path)) {
|
if (is_dir($path)) {
|
||||||
|
|
||||||
|
// Will exclude everything under these directories
|
||||||
|
$exclude = array(
|
||||||
|
'awstats',
|
||||||
|
'webalizer'
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param SplFileInfo $file
|
||||||
|
* @param mixed $key
|
||||||
|
* @param RecursiveCallbackFilterIterator $iterator
|
||||||
|
* @return bool True if you need to recurse or if the item is acceptable
|
||||||
|
*/
|
||||||
|
$filter = function ($file, $key, $iterator) use ($exclude) {
|
||||||
|
if (in_array($file->getFilename(), $exclude)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
// create RecursiveIteratorIterator
|
// create RecursiveIteratorIterator
|
||||||
$its = new RecursiveIteratorIterator(new IgnorantRecursiveDirectoryIterator($path));
|
$its = new RecursiveIteratorIterator(
|
||||||
|
new RecursiveCallbackFilterIterator(
|
||||||
|
new IgnorantRecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),
|
||||||
|
$filter
|
||||||
|
)
|
||||||
|
);
|
||||||
// we can limit the recursion-depth, but will it be helpful or
|
// we can limit the recursion-depth, but will it be helpful or
|
||||||
// will people start asking "why do I only see 2 subdirectories, i want to use /a/b/c"
|
// will people start asking "why do I only see 2 subdirectories, i want to use /a/b/c"
|
||||||
// let's keep this in mind and see whether it will be useful
|
// let's keep this in mind and see whether it will be useful
|
||||||
@@ -50,24 +80,27 @@ function findDirs($path, $uid, $gid) {
|
|||||||
$_fileList[] = makeCorrectDir(dirname($fullFileName));
|
$_fileList[] = makeCorrectDir(dirname($fullFileName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$_fileList[] = $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
return array_unique($_fileList);
|
return array_unique($_fileList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you use RecursiveDirectoryIterator with RecursiveIteratorIterator and run
|
* If you use RecursiveDirectoryIterator with RecursiveIteratorIterator and run
|
||||||
* into UnexpectedValueException you may use this little hack to ignore those
|
* into UnexpectedValueException you may use this little hack to ignore those
|
||||||
* directories, such as lost+found on linux.
|
* directories, such as lost+found on linux.
|
||||||
* (User "antennen" @ http://php.net/manual/en/class.recursivedirectoryiterator.php#101654)
|
* (User "antennen" @ http://php.net/manual/en/class.recursivedirectoryiterator.php#101654)
|
||||||
**/
|
*/
|
||||||
class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator {
|
class IgnorantRecursiveDirectoryIterator extends RecursiveDirectoryIterator
|
||||||
function getChildren() {
|
{
|
||||||
try {
|
|
||||||
return new IgnorantRecursiveDirectoryIterator($this->getPathname());
|
function getChildren()
|
||||||
} catch(UnexpectedValueException $e) {
|
{
|
||||||
return new RecursiveArrayIterator(array());
|
try {
|
||||||
}
|
return new IgnorantRecursiveDirectoryIterator($this->getPathname());
|
||||||
}
|
} catch (UnexpectedValueException $e) {
|
||||||
|
return new RecursiveArrayIterator(array());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
function makeCorrectDir($dir) {
|
function makeCorrectDir($dir) {
|
||||||
|
|
||||||
assert('is_string($dir) && strlen($dir) > 0 /* $dir does not look like an actual folder name */');
|
assert('is_string($dir) && strlen($dir) > 0', 'Value "' . $dir .'" does not look like an actual folder name');
|
||||||
|
|
||||||
$dir = trim($dir);
|
$dir = trim($dir);
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,12 @@ function makePathfield($path, $uid, $gid, $value = '', $dom = false) {
|
|||||||
$_field = '';
|
$_field = '';
|
||||||
foreach ($dirList as $key => $dir) {
|
foreach ($dirList as $key => $dir) {
|
||||||
if (strpos($dir, $path) === 0) {
|
if (strpos($dir, $path) === 0) {
|
||||||
$dir = makeCorrectDir(substr($dir, strlen($path)));
|
$dir = substr($dir, strlen($path));
|
||||||
|
// docroot cut off of current directory == empty -> directory is the docroot
|
||||||
|
if (empty($dir)) {
|
||||||
|
$dir = '/';
|
||||||
|
}
|
||||||
|
$dir = makeCorrectDir($dir);
|
||||||
}
|
}
|
||||||
$_field.= makeoption($dir, $dir, $value);
|
$_field.= makeoption($dir, $dir, $value);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
function validateFormFieldOption($fieldname, $fielddata, $newfieldvalue)
|
function validateFormFieldOption($fieldname, $fielddata, $newfieldvalue)
|
||||||
{
|
{
|
||||||
$returnvalue = true;
|
$returnvalue = true;
|
||||||
|
|
||||||
if(isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple')
|
if(isset($fielddata['option_mode']) && $fielddata['option_mode'] == 'multiple')
|
||||||
{
|
{
|
||||||
$options = explode(',', $newfieldvalue);
|
$options = explode(',', $newfieldvalue);
|
||||||
@@ -33,13 +33,16 @@ function validateFormFieldOption($fieldname, $fielddata, $newfieldvalue)
|
|||||||
{
|
{
|
||||||
$returnvalue = isset($fielddata['option_options'][$newfieldvalue]);
|
$returnvalue = isset($fielddata['option_options'][$newfieldvalue]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($returnvalue === true)
|
if($returnvalue === true)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (isset($fielddata['option_emptyallowed']) && $fielddata['option_emptyallowed']) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return 'not in option';
|
return 'not in option';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ function validateFormFieldString($fieldname, $fielddata, $newfieldvalue)
|
|||||||
$newfieldvalue = '';
|
$newfieldvalue = '';
|
||||||
$returnvalue = 'stringmustntbeempty';
|
$returnvalue = 'stringmustntbeempty';
|
||||||
} else {
|
} else {
|
||||||
$newfieldvalue = validate_ip2($newfieldvalue, true, true, true);
|
$newfieldvalue = validate_ip2($newfieldvalue, true, 'invalidip', true, true, true);
|
||||||
$returnvalue = ($newfieldvalue !== false ? true : 'invalidip');
|
$returnvalue = ($newfieldvalue !== false ? true : 'invalidip');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file is part of the Froxlor project.
|
||||||
|
* Copyright (c) 2003-2009 the SysCP Team (see authors).
|
||||||
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the COPYING
|
||||||
|
* file that was distributed with this source code. You can also view the
|
||||||
|
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
*
|
||||||
|
* @copyright (c) the authors
|
||||||
|
* @author Froxlor team <team@froxlor.org> (2010-)
|
||||||
|
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
|
||||||
|
* @package Functions
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
function storeSettingClearCertificates($fieldname, $fielddata, $newfieldvalue) {
|
||||||
|
|
||||||
|
$returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue);
|
||||||
|
|
||||||
|
if ($returnvalue !== false
|
||||||
|
&& is_array($fielddata)
|
||||||
|
&& isset($fielddata['settinggroup'])
|
||||||
|
&& $fielddata['settinggroup'] == 'system'
|
||||||
|
&& isset($fielddata['varname'])
|
||||||
|
&& $fielddata['varname'] == 'le_froxlor_enabled'
|
||||||
|
&& $newfieldvalue == '0'
|
||||||
|
) {
|
||||||
|
Database::query("
|
||||||
|
DELETE FROM `" . TABLE_PANEL_DOMAIN_SSL_SETTINGS . "` WHERE `domainid` = '0'
|
||||||
|
");
|
||||||
|
}
|
||||||
|
|
||||||
|
return $returnvalue;
|
||||||
|
}
|
||||||
@@ -21,40 +21,43 @@
|
|||||||
* to a line for a open_basedir directive
|
* to a line for a open_basedir directive
|
||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* the path to check and append
|
* the path to check and append
|
||||||
* @param boolean $first
|
* @param boolean $first
|
||||||
* if true, no ':' will be prefixed to the path
|
* if true, no ':' will be prefixed to the path
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function appendOpenBasedirPath($path = '', $first = false)
|
function appendOpenBasedirPath($path = '', $first = false)
|
||||||
{
|
{
|
||||||
if ($path != '' && $path != '/'
|
if ($path != '' && $path != '/' &&
|
||||||
&& (! preg_match("#^/dev#i", $path) || preg_match("#^/dev/urandom#i", $path))
|
(! preg_match("#^/dev#i", $path) || preg_match("#^/dev/urandom#i", $path))
|
||||||
&& ! preg_match("#^/proc#i", $path)
|
&& ! preg_match("#^/proc#i", $path)
|
||||||
&& ! preg_match("#^/etc#i", $path)
|
&& ! preg_match("#^/etc#i", $path)
|
||||||
&& ! preg_match("#^/sys#i", $path)
|
&& ! preg_match("#^/sys#i", $path)
|
||||||
&& ! preg_match("#:#", $path)
|
&& ! preg_match("#:#", $path)) {
|
||||||
) {
|
|
||||||
|
if (preg_match("#^/dev/urandom#i", $path)) {
|
||||||
$path = makeCorrectDir($path);
|
$path = makeCorrectFile($path);
|
||||||
|
} else {
|
||||||
// check for php-version that requires the trailing
|
$path = makeCorrectDir($path);
|
||||||
// slash to be removed as it does not allow the usage
|
}
|
||||||
// of the subfolders within the given folder, fixes #797
|
|
||||||
if ((PHP_MINOR_VERSION == 2 && PHP_VERSION_ID >= 50216) || PHP_VERSION_ID >= 50304) {
|
// check for php-version that requires the trailing
|
||||||
// check trailing slash
|
// slash to be removed as it does not allow the usage
|
||||||
if (substr($path, - 1, 1) == '/') {
|
// of the subfolders within the given folder, fixes #797
|
||||||
// remove it
|
if ((PHP_MINOR_VERSION == 2 && PHP_VERSION_ID >= 50216) || PHP_VERSION_ID >= 50304) {
|
||||||
$path = substr($path, 0, - 1);
|
// check trailing slash
|
||||||
}
|
if (substr($path, - 1, 1) == '/') {
|
||||||
}
|
// remove it
|
||||||
|
$path = substr($path, 0, - 1);
|
||||||
if ($first) {
|
}
|
||||||
return $path;
|
}
|
||||||
}
|
|
||||||
|
if ($first) {
|
||||||
return ':' . $path;
|
return $path;
|
||||||
}
|
}
|
||||||
return '';
|
|
||||||
|
return ':' . $path;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,23 +49,43 @@ function validate_ip($ip, $return_bool = false, $lng = 'invalidip') {
|
|||||||
* @param string $lng index for error-message (if $return_bool is false)
|
* @param string $lng index for error-message (if $return_bool is false)
|
||||||
* @param bool $allow_localhost whether to allow 127.0.0.1
|
* @param bool $allow_localhost whether to allow 127.0.0.1
|
||||||
* @param bool $allow_priv whether to allow private network addresses
|
* @param bool $allow_priv whether to allow private network addresses
|
||||||
|
* @param bool $allow_cidr whether to allow CIDR values e.g. 10.10.10.10/16
|
||||||
*
|
*
|
||||||
* @return string|bool ip address on success, false on failure
|
* @return string|bool ip address on success, false on failure
|
||||||
*/
|
*/
|
||||||
function validate_ip2($ip, $return_bool = false, $lng = 'invalidip', $allow_localhost = false, $allow_priv = false) {
|
function validate_ip2($ip, $return_bool = false, $lng = 'invalidip', $allow_localhost = false, $allow_priv = false, $allow_cidr = false) {
|
||||||
|
|
||||||
$filter_lan = $allow_priv ? FILTER_FLAG_NO_RES_RANGE : (FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE);
|
$cidr = "";
|
||||||
|
if ($allow_cidr) {
|
||||||
|
$org_ip = $ip;
|
||||||
|
$ip_cidr = explode("/", $ip);
|
||||||
|
if (count($ip_cidr) == 2) {
|
||||||
|
$ip = $ip_cidr[0];
|
||||||
|
$cidr = "/".$ip_cidr[1];
|
||||||
|
} else {
|
||||||
|
$ip = $org_ip;
|
||||||
|
}
|
||||||
|
} elseif (strpos($ip, "/") !== false) {
|
||||||
|
if ($return_bool) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
standard_error($lng, $ip);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$filter_lan = $allow_priv ? FILTER_FLAG_NO_RES_RANGE : (FILTER_FLAG_NO_RES_RANGE | FILTER_FLAG_NO_PRIV_RANGE);
|
||||||
|
|
||||||
if ((filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)
|
if ((filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)
|
||||||
|| filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4))
|
|| filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4))
|
||||||
&& filter_var($ip, FILTER_VALIDATE_IP, $filter_lan)
|
&& filter_var($ip, FILTER_VALIDATE_IP, $filter_lan)
|
||||||
) {
|
) {
|
||||||
return $ip;
|
return $ip.$cidr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// special case where localhost ip is allowed (mysql-access-hosts for example)
|
// special case where localhost ip is allowed (mysql-access-hosts for example)
|
||||||
if ($allow_localhost && $ip == '127.0.0.1') {
|
if ($allow_localhost && $ip == '127.0.0.1') {
|
||||||
return $ip;
|
return $ip.$cidr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($return_bool) {
|
if ($return_bool) {
|
||||||
|
|||||||
@@ -16,10 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Main version variable
|
// Main version variable
|
||||||
$version = '0.9.38-rc1';
|
$version = '0.9.38.1';
|
||||||
|
|
||||||
// Database version (YYYYMMDDC where C is a daily counter)
|
// Database version (YYYYMMDDC where C is a daily counter)
|
||||||
$dbversion = '201610070';
|
$dbversion = '201611180';
|
||||||
|
|
||||||
// Distribution branding-tag (used for Debian etc.)
|
// Distribution branding-tag (used for Debian etc.)
|
||||||
$branding = '';
|
$branding = '';
|
||||||
|
|||||||
@@ -2062,3 +2062,6 @@ $lng['admin']['domain_hsts_incsub']['title'] = 'Include HSTS for any subdomain';
|
|||||||
$lng['admin']['domain_hsts_incsub']['description'] = 'The optional "includeSubDomains" directive, if present, signals the UA that the HSTS Policy applies to this HSTS Host as well as any subdomains of the host\'s domain name.';
|
$lng['admin']['domain_hsts_incsub']['description'] = 'The optional "includeSubDomains" directive, if present, signals the UA that the HSTS Policy applies to this HSTS Host as well as any subdomains of the host\'s domain name.';
|
||||||
$lng['admin']['domain_hsts_preload']['title'] = 'Include domain in <a href="https://hstspreload.appspot.com/" target="_blank">HSTS preload list</a>';
|
$lng['admin']['domain_hsts_preload']['title'] = 'Include domain in <a href="https://hstspreload.appspot.com/" target="_blank">HSTS preload list</a>';
|
||||||
$lng['admin']['domain_hsts_preload']['description'] = 'If you would like this domain to be included in the HSTS preload list maintained by Chrome (and used by Firefox and Safari), then use activate this.<br>Sending the preload directive from your site can have PERMANENT CONSEQUENCES and prevent users from accessing your site and any of its subdomains.<br>Please read the details at <a href="hstspreload.appspot.com/#removal" target="_blank">hstspreload.appspot.com/#removal</a> before sending the header with "preload".';
|
$lng['admin']['domain_hsts_preload']['description'] = 'If you would like this domain to be included in the HSTS preload list maintained by Chrome (and used by Firefox and Safari), then use activate this.<br>Sending the preload directive from your site can have PERMANENT CONSEQUENCES and prevent users from accessing your site and any of its subdomains.<br>Please read the details at <a href="hstspreload.appspot.com/#removal" target="_blank">hstspreload.appspot.com/#removal</a> before sending the header with "preload".';
|
||||||
|
|
||||||
|
$lng['serversettings']['nginx_http2_support']['title'] = 'Nginx HTTP2 Support';
|
||||||
|
$lng['serversettings']['nginx_http2_support']['description'] = 'enable http2 support for ssl. ENABLE ONLY IF YOUR Nginx SUPPORT THIS FEATURE. (version 1.9.5+)';
|
||||||
|
|||||||
@@ -141,8 +141,7 @@ if (Settings::Get('system.le_froxlor_enabled') == '1') {
|
|||||||
|
|
||||||
if ($insert_or_update_required) {
|
if ($insert_or_update_required) {
|
||||||
$domains = array(
|
$domains = array(
|
||||||
$certrow['domain'],
|
$certrow['domain']
|
||||||
'www.' . $certrow['domain']
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Only renew let's encrypt certificate if no broken ssl_redirect is enabled
|
// Only renew let's encrypt certificate if no broken ssl_redirect is enabled
|
||||||
|
|||||||
@@ -129,9 +129,7 @@ class bind extends DnsBase
|
|||||||
// AXFR server #100
|
// AXFR server #100
|
||||||
if (count($this->_axfr) > 0) {
|
if (count($this->_axfr) > 0) {
|
||||||
foreach ($this->_axfr as $axfrserver) {
|
foreach ($this->_axfr as $axfrserver) {
|
||||||
if (validate_ip($axfrserver, true) !== false) {
|
$bindconf_file .= ' ' . $axfrserver . ';' . "\n";
|
||||||
$bindconf_file .= ' ' . $axfrserver . ';' . "\n";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// close allow-transfer
|
// close allow-transfer
|
||||||
|
|||||||
@@ -194,10 +194,8 @@ class pdns extends DnsBase
|
|||||||
// AXFR server #100
|
// AXFR server #100
|
||||||
if (count($this->_axfr) > 0) {
|
if (count($this->_axfr) > 0) {
|
||||||
foreach ($this->_axfr as $axfrserver) {
|
foreach ($this->_axfr as $axfrserver) {
|
||||||
if (validate_ip($axfrserver, true) !== false) {
|
$ins_data['value'] = $axfrserver;
|
||||||
$ins_data['value'] = $axfrserver;
|
$ins_stmt->execute($ins_data);
|
||||||
$ins_stmt->execute($ins_data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (! defined('MASTER_CRONJOB'))
|
if (! defined('MASTER_CRONJOB'))
|
||||||
die('You cannot access this file directly!');
|
die('You cannot access this file directly!');
|
||||||
|
|
||||||
@@ -183,6 +182,10 @@ class apache extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($row_ipsandports['vhostcontainer'] == '1') {
|
if ($row_ipsandports['vhostcontainer'] == '1') {
|
||||||
|
|
||||||
|
$without_vhost = $this->virtualhosts_data[$vhosts_filename];
|
||||||
|
$close_vhost = true;
|
||||||
|
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= '<VirtualHost ' . $ipport . '>' . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= '<VirtualHost ' . $ipport . '>' . "\n";
|
||||||
|
|
||||||
$mypath = $this->getMyPath($row_ipsandports);
|
$mypath = $this->getMyPath($row_ipsandports);
|
||||||
@@ -224,7 +227,7 @@ class apache extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$is_redirect) {
|
if (! $is_redirect) {
|
||||||
// create fcgid <Directory>-Part (starter is created in apache_fcgid)
|
// create fcgid <Directory>-Part (starter is created in apache_fcgid)
|
||||||
if (Settings::Get('system.mod_fcgid_ownvhost') == '1' && Settings::Get('system.mod_fcgid') == '1') {
|
if (Settings::Get('system.mod_fcgid_ownvhost') == '1' && Settings::Get('system.mod_fcgid') == '1') {
|
||||||
$configdir = makeCorrectDir(Settings::Get('system.mod_fcgid_configdir') . '/froxlor.panel/' . Settings::Get('system.hostname'));
|
$configdir = makeCorrectDir(Settings::Get('system.mod_fcgid_configdir') . '/froxlor.panel/' . Settings::Get('system.hostname'));
|
||||||
@@ -274,13 +277,14 @@ class apache extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' </Directory>' . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= ' </Directory>' . "\n";
|
||||||
}
|
}
|
||||||
} // create php-fpm <Directory>-Part (config is created in apache_fcgid)
|
}
|
||||||
elseif (Settings::Get('phpfpm.enabled') == '1') {
|
elseif (Settings::Get('phpfpm.enabled') == '1') {
|
||||||
|
// create php-fpm <Directory>-Part (config is created in apache_fcgid)
|
||||||
$domain = array(
|
$domain = array(
|
||||||
'id' => 'none',
|
'id' => 'none',
|
||||||
'domain' => Settings::Get('system.hostname'),
|
'domain' => Settings::Get('system.hostname'),
|
||||||
'adminid' => 1, /* first admin-user (superadmin) */
|
'adminid' => 1, /* first admin-user (superadmin) */
|
||||||
'mod_fcgid_starter' => - 1,
|
'mod_fcgid_starter' => - 1,
|
||||||
'mod_fcgid_maxrequests' => - 1,
|
'mod_fcgid_maxrequests' => - 1,
|
||||||
'guid' => Settings::Get('phpfpm.vhost_httpuser'),
|
'guid' => Settings::Get('phpfpm.vhost_httpuser'),
|
||||||
'openbasedir' => 0,
|
'openbasedir' => 0,
|
||||||
@@ -332,7 +336,7 @@ class apache extends HttpConfigBase
|
|||||||
'id' => 'none',
|
'id' => 'none',
|
||||||
'domain' => Settings::Get('system.hostname'),
|
'domain' => Settings::Get('system.hostname'),
|
||||||
'adminid' => 1, /* first admin-user (superadmin) */
|
'adminid' => 1, /* first admin-user (superadmin) */
|
||||||
'guid' => Settings::Get('system.httpuser'),
|
'guid' => Settings::Get('system.httpuser'),
|
||||||
'openbasedir' => 0,
|
'openbasedir' => 0,
|
||||||
'email' => Settings::Get('panel.adminmail'),
|
'email' => Settings::Get('panel.adminmail'),
|
||||||
'loginname' => 'froxlor.panel',
|
'loginname' => 'froxlor.panel',
|
||||||
@@ -408,7 +412,7 @@ class apache extends HttpConfigBase
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' SSLEngine On' . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= ' SSLEngine On' . "\n";
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' SSLProtocol ALL -SSLv2 -SSLv3' . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= ' SSLProtocol -ALL +TLSv1 +TLSv1.2' . "\n";
|
||||||
// this makes it more secure, thx to Marcel (08/2013)
|
// this makes it more secure, thx to Marcel (08/2013)
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' SSLHonorCipherOrder On' . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= ' SSLHonorCipherOrder On' . "\n";
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= ' SSLCipherSuite ' . Settings::Get('system.ssl_cipher_list') . "\n";
|
$this->virtualhosts_data[$vhosts_filename] .= ' SSLCipherSuite ' . Settings::Get('system.ssl_cipher_list') . "\n";
|
||||||
@@ -443,10 +447,19 @@ class apache extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// if there is no cert-file specified but we are generating a ssl-vhost,
|
||||||
|
// we should return an empty string because this vhost would suck dick, ref #1583
|
||||||
|
$this->logger->logAction(CRON_ACTION, LOG_ERR, $domain['domain'] . ' :: empty certificate file! Cannot create ssl-directives');
|
||||||
|
$this->virtualhosts_data[$vhosts_filename] = $without_vhost;
|
||||||
|
$this->virtualhosts_data[$vhosts_filename] .= '# no ssl-certificate was specified for this domain, therefore no explicit vhost-container is being generated';
|
||||||
|
$close_vhost = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->virtualhosts_data[$vhosts_filename] .= '</VirtualHost>' . "\n";
|
if ($close_vhost) {
|
||||||
|
$this->virtualhosts_data[$vhosts_filename] .= '</VirtualHost>' . "\n";
|
||||||
|
}
|
||||||
$this->logger->logAction(CRON_ACTION, LOG_DEBUG, $ipport . ' :: inserted vhostcontainer');
|
$this->logger->logAction(CRON_ACTION, LOG_DEBUG, $ipport . ' :: inserted vhostcontainer');
|
||||||
}
|
}
|
||||||
unset($vhosts_filename);
|
unset($vhosts_filename);
|
||||||
@@ -602,10 +615,10 @@ class apache extends HttpConfigBase
|
|||||||
} else {
|
} else {
|
||||||
$stats_text .= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer') . '"' . "\n";
|
$stats_text .= ' Alias /webalizer "' . makeCorrectFile($domain['customerroot'] . '/webalizer') . '"' . "\n";
|
||||||
}
|
}
|
||||||
} // if the docroots are equal, we still have to set an alias for awstats
|
} // if the docroots are equal, we still have to set an alias for awstats
|
||||||
// because the stats are in /awstats/[domain], not just /awstats/
|
// because the stats are in /awstats/[domain], not just /awstats/
|
||||||
// also, the awstats-icons are someplace else too!
|
// also, the awstats-icons are someplace else too!
|
||||||
// -> webalizer does not need this!
|
// -> webalizer does not need this!
|
||||||
elseif (Settings::Get('system.awstats_enabled') == '1') {
|
elseif (Settings::Get('system.awstats_enabled') == '1') {
|
||||||
$stats_text .= ' Alias /awstats "' . makeCorrectFile($domain['documentroot'] . '/awstats/' . $domain['domain']) . '"' . "\n";
|
$stats_text .= ' Alias /awstats "' . makeCorrectFile($domain['documentroot'] . '/awstats/' . $domain['domain']) . '"' . "\n";
|
||||||
$stats_text .= ' Alias /awstats-icon "' . makeCorrectDir(Settings::Get('system.awstats_icons')) . '"' . "\n";
|
$stats_text .= ' Alias /awstats-icon "' . makeCorrectDir(Settings::Get('system.awstats_icons')) . '"' . "\n";
|
||||||
@@ -817,7 +830,7 @@ class apache extends HttpConfigBase
|
|||||||
|
|
||||||
if ($domain['ssl_cert_file'] != '') {
|
if ($domain['ssl_cert_file'] != '') {
|
||||||
$vhost_content .= ' SSLEngine On' . "\n";
|
$vhost_content .= ' SSLEngine On' . "\n";
|
||||||
$vhost_content .= ' SSLProtocol ALL -SSLv2 -SSLv3' . "\n";
|
$vhost_content .= ' SSLProtocol -ALL +TLSv1 +TLSv1.2' . "\n";
|
||||||
// this makes it more secure, thx to Marcel (08/2013)
|
// this makes it more secure, thx to Marcel (08/2013)
|
||||||
$vhost_content .= ' SSLHonorCipherOrder On' . "\n";
|
$vhost_content .= ' SSLHonorCipherOrder On' . "\n";
|
||||||
$vhost_content .= ' SSLCipherSuite ' . Settings::Get('system.ssl_cipher_list') . "\n";
|
$vhost_content .= ' SSLCipherSuite ' . Settings::Get('system.ssl_cipher_list') . "\n";
|
||||||
@@ -860,8 +873,10 @@ class apache extends HttpConfigBase
|
|||||||
$domain['documentroot'] = trim($domain['documentroot']);
|
$domain['documentroot'] = trim($domain['documentroot']);
|
||||||
|
|
||||||
if (preg_match('/^https?\:\/\//', $domain['documentroot'])) {
|
if (preg_match('/^https?\:\/\//', $domain['documentroot'])) {
|
||||||
$corrected_docroot = $this->idnaConvert->encode_uri($domain['documentroot']);
|
$corrected_docroot = $domain['documentroot'];
|
||||||
|
|
||||||
|
// prevent empty return-cde
|
||||||
|
$code = "301";
|
||||||
// Get domain's redirect code
|
// Get domain's redirect code
|
||||||
$code = getDomainRedirectCode($domain['id']);
|
$code = getDomainRedirectCode($domain['id']);
|
||||||
$modrew_red = '';
|
$modrew_red = '';
|
||||||
|
|||||||
@@ -210,7 +210,9 @@ class lighttpd extends HttpConfigBase
|
|||||||
echo $ip . ':' . $port . ' :: certificate file "' . $domain['ssl_cert_file'] . '" does not exist! Cannot create SSL-directives' . "\n";
|
echo $ip . ':' . $port . ' :: certificate file "' . $domain['ssl_cert_file'] . '" does not exist! Cannot create SSL-directives' . "\n";
|
||||||
} else {
|
} else {
|
||||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.engine = "enable"' . "\n";
|
$this->lighttpd_data[$vhost_filename] .= 'ssl.engine = "enable"' . "\n";
|
||||||
|
$this->lighttpd_data[$vhost_filename] .= 'ssl.use-compression = "disable"' . "\n";
|
||||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.use-sslv2 = "disable"' . "\n";
|
$this->lighttpd_data[$vhost_filename] .= 'ssl.use-sslv2 = "disable"' . "\n";
|
||||||
|
$this->lighttpd_data[$vhost_filename] .= 'ssl.use-sslv3 = "disable"' . "\n";
|
||||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.cipher-list = "' . Settings::Get('system.ssl_cipher_list') . '"' . "\n";
|
$this->lighttpd_data[$vhost_filename] .= 'ssl.cipher-list = "' . Settings::Get('system.ssl_cipher_list') . '"' . "\n";
|
||||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.honor-cipher-order = "enable"' . "\n";
|
$this->lighttpd_data[$vhost_filename] .= 'ssl.honor-cipher-order = "enable"' . "\n";
|
||||||
$this->lighttpd_data[$vhost_filename] .= 'ssl.pemfile = "' . makeCorrectFile($domain['ssl_cert_file']) . '"' . "\n";
|
$this->lighttpd_data[$vhost_filename] .= 'ssl.pemfile = "' . makeCorrectFile($domain['ssl_cert_file']) . '"' . "\n";
|
||||||
@@ -429,8 +431,15 @@ class lighttpd extends HttpConfigBase
|
|||||||
$domain['documentroot'] = trim($domain['documentroot']);
|
$domain['documentroot'] = trim($domain['documentroot']);
|
||||||
|
|
||||||
if (preg_match('/^https?\:\/\//', $domain['documentroot'])) {
|
if (preg_match('/^https?\:\/\//', $domain['documentroot'])) {
|
||||||
|
$uri = $domain['documentroot'];
|
||||||
|
// prevent empty return-cde
|
||||||
|
$code = "301";
|
||||||
|
// Get domain's redirect code
|
||||||
|
$code = getDomainRedirectCode($domain['id']);
|
||||||
|
|
||||||
|
$vhost_content .= ' url.redirect-code = ' . $code. "\n";
|
||||||
$vhost_content .= ' url.redirect = (' . "\n";
|
$vhost_content .= ' url.redirect = (' . "\n";
|
||||||
$vhost_content .= ' "^/(.*)$" => "' . $this->idnaConvert->encode_uri($domain['documentroot']) . '$1"' . "\n";
|
$vhost_content .= ' "^/(.*)$" => "' . $uri . '$1"' . "\n";
|
||||||
$vhost_content .= ' )' . "\n";
|
$vhost_content .= ' )' . "\n";
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -510,7 +519,9 @@ class lighttpd extends HttpConfigBase
|
|||||||
if ($domain['ssl_cert_file'] != '') {
|
if ($domain['ssl_cert_file'] != '') {
|
||||||
|
|
||||||
$ssl_settings .= 'ssl.engine = "enable"' . "\n";
|
$ssl_settings .= 'ssl.engine = "enable"' . "\n";
|
||||||
|
$ssl_settings .= 'ssl.use-compression = "disable"' . "\n";
|
||||||
$ssl_settings .= 'ssl.use-sslv2 = "disable"' . "\n";
|
$ssl_settings .= 'ssl.use-sslv2 = "disable"' . "\n";
|
||||||
|
$ssl_settings .= 'ssl.use-sslv3 = "disable"' . "\n";
|
||||||
$ssl_settings .= 'ssl.cipher-list = "' . Settings::Get('system.ssl_cipher_list') . '"' . "\n";
|
$ssl_settings .= 'ssl.cipher-list = "' . Settings::Get('system.ssl_cipher_list') . '"' . "\n";
|
||||||
$ssl_settings .= 'ssl.honor-cipher-order = "enable"' . "\n";
|
$ssl_settings .= 'ssl.honor-cipher-order = "enable"' . "\n";
|
||||||
$ssl_settings .= 'ssl.pemfile = "' . makeCorrectFile($domain['ssl_cert_file']) . '"' . "\n";
|
$ssl_settings .= 'ssl.pemfile = "' . makeCorrectFile($domain['ssl_cert_file']) . '"' . "\n";
|
||||||
|
|||||||
@@ -196,10 +196,12 @@ class nginx extends HttpConfigBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$http2 = $ssl_vhost == true && Settings::Get('system.nginx_http2_support') == '1';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this HAS to be set for the default host in nginx or else no vhost will work
|
* this HAS to be set for the default host in nginx or else no vhost will work
|
||||||
*/
|
*/
|
||||||
$this->nginx_data[$vhost_filename] .= "\t" . 'listen ' . $ip . ':' . $port . ' default_server' . ($ssl_vhost == true ? ' ssl' : '') . ';' . "\n";
|
$this->nginx_data[$vhost_filename] .= "\t" . 'listen ' . $ip . ':' . $port . ' default_server' . ($ssl_vhost == true ? ' ssl' : '') . ($http2 == true ? ' http2' : '') . ';' . "\n";
|
||||||
|
|
||||||
$this->nginx_data[$vhost_filename] .= "\t" . '# Froxlor default vhost' . "\n";
|
$this->nginx_data[$vhost_filename] .= "\t" . '# Froxlor default vhost' . "\n";
|
||||||
$this->nginx_data[$vhost_filename] .= "\t" . 'server_name ' . Settings::Get('system.hostname') . ';' . "\n";
|
$this->nginx_data[$vhost_filename] .= "\t" . 'server_name ' . Settings::Get('system.hostname') . ';' . "\n";
|
||||||
@@ -411,7 +413,9 @@ class nginx extends HttpConfigBase
|
|||||||
$_vhost_content .= $this->processSpecialConfigTemplate($ipandport['default_vhostconf_domain'], $domain, $domain['ip'], $domain['port'], $ssl_vhost) . "\n";
|
$_vhost_content .= $this->processSpecialConfigTemplate($ipandport['default_vhostconf_domain'], $domain, $domain['ip'], $domain['port'], $ssl_vhost) . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$vhost_content .= "\t" . 'listen ' . $ipport . ($ssl_vhost == true ? ' ssl' : '') . ';' . "\n";
|
$http2 = $ssl_vhost == true && Settings::Get('system.nginx_http2_support') == '1';
|
||||||
|
|
||||||
|
$vhost_content .= "\t" . 'listen ' . $ipport . ($ssl_vhost == true ? ' ssl' : '') . ($http2 == true ? ' http2' : '') . ';' . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// get all server-names
|
// get all server-names
|
||||||
@@ -456,12 +460,17 @@ class nginx extends HttpConfigBase
|
|||||||
|
|
||||||
// if the documentroot is an URL we just redirect
|
// if the documentroot is an URL we just redirect
|
||||||
if (preg_match('/^https?\:\/\//', $domain['documentroot'])) {
|
if (preg_match('/^https?\:\/\//', $domain['documentroot'])) {
|
||||||
$uri = $this->idnaConvert->encode_uri($domain['documentroot']);
|
$uri = $domain['documentroot'];
|
||||||
if (substr($uri, - 1) == '/') {
|
if (substr($uri, - 1) == '/') {
|
||||||
$uri = substr($uri, 0, - 1);
|
$uri = substr($uri, 0, - 1);
|
||||||
}
|
}
|
||||||
|
// prevent empty return-cde
|
||||||
|
$code = "301";
|
||||||
|
// Get domain's redirect code
|
||||||
|
$code = getDomainRedirectCode($domain['id']);
|
||||||
|
|
||||||
$vhost_content .= "\t" . 'if ($request_uri !~ "^/\.well-known/acme-challenge/\w+$") {' . "\n";
|
$vhost_content .= "\t" . 'if ($request_uri !~ "^/\.well-known/acme-challenge/\w+$") {' . "\n";
|
||||||
$vhost_content .= "\t\t" . 'return 301 ' . $uri . '$request_uri;' . "\n";
|
$vhost_content .= "\t\t" . 'return ' . $code .' ' . $uri . '$request_uri;' . "\n";
|
||||||
$vhost_content .= "\t" . '}' . "\n";
|
$vhost_content .= "\t" . '}' . "\n";
|
||||||
} else {
|
} else {
|
||||||
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true);
|
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true);
|
||||||
@@ -596,7 +605,7 @@ class nginx extends HttpConfigBase
|
|||||||
} else {
|
} else {
|
||||||
// obsolete: ssl on now belongs to the listen block as 'ssl' at the end
|
// obsolete: ssl on now belongs to the listen block as 'ssl' at the end
|
||||||
// $sslsettings .= "\t" . 'ssl on;' . "\n";
|
// $sslsettings .= "\t" . 'ssl on;' . "\n";
|
||||||
$sslsettings .= "\t" . 'ssl_protocols TLSv1 TLSv1.1 TLSv1.2;' . "\n";
|
$sslsettings .= "\t" . 'ssl_protocols TLSv1 TLSv1.2;' . "\n";
|
||||||
$sslsettings .= "\t" . 'ssl_ciphers ' . Settings::Get('system.ssl_cipher_list') . ';' . "\n";
|
$sslsettings .= "\t" . 'ssl_ciphers ' . Settings::Get('system.ssl_cipher_list') . ';' . "\n";
|
||||||
$sslsettings .= "\t" . 'ssl_ecdh_curve secp384r1;' . "\n";
|
$sslsettings .= "\t" . 'ssl_ecdh_curve secp384r1;' . "\n";
|
||||||
$sslsettings .= "\t" . 'ssl_prefer_server_ciphers on;' . "\n";
|
$sslsettings .= "\t" . 'ssl_prefer_server_ciphers on;' . "\n";
|
||||||
|
|||||||
@@ -86,6 +86,13 @@ if (count($all_certs) == 0) {
|
|||||||
foreach ($all_certs as $idx => $cert) {
|
foreach ($all_certs as $idx => $cert) {
|
||||||
if ($paging->checkDisplay($idx)) {
|
if ($paging->checkDisplay($idx)) {
|
||||||
|
|
||||||
|
// respect froxlor-hostname
|
||||||
|
if ($cert['domainid'] == 0) {
|
||||||
|
$cert['domain'] = Settings::Get('system.hostname');
|
||||||
|
$cert['letsencrypt'] = Settings::Get('system.le_froxlor_enabled');
|
||||||
|
$cert['loginname'] = 'froxlor.panel';
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($cert['domain']) || empty($cert['ssl_cert_file'])) {
|
if (empty($cert['domain']) || empty($cert['ssl_cert_file'])) {
|
||||||
// no domain found to the entry or empty entry - safely delete it from the DB
|
// no domain found to the entry or empty entry - safely delete it from the DB
|
||||||
Database::pexecute($del_stmt, array(
|
Database::pexecute($del_stmt, array(
|
||||||
@@ -96,10 +103,10 @@ if (count($all_certs) == 0) {
|
|||||||
|
|
||||||
$cert_data = openssl_x509_parse($cert['ssl_cert_file']);
|
$cert_data = openssl_x509_parse($cert['ssl_cert_file']);
|
||||||
|
|
||||||
$cert['domain'] = $idna_convert->encode($cert['domain']);
|
$cert['domain'] = $idna_convert->decode($cert['domain']);
|
||||||
|
|
||||||
$adminCustomerLink = "";
|
$adminCustomerLink = "";
|
||||||
if (AREA == 'admin') {
|
if (AREA == 'admin' && $cert['domainid'] > 0) {
|
||||||
if (! empty($cert['loginname'])) {
|
if (! empty($cert['loginname'])) {
|
||||||
$adminCustomerLink = ' (<a href="' . $linker->getLink(array(
|
$adminCustomerLink = ' (<a href="' . $linker->getLink(array(
|
||||||
'section' => 'customers',
|
'section' => 'customers',
|
||||||
@@ -119,6 +126,18 @@ if (count($all_certs) == 0) {
|
|||||||
$isValid = false;
|
$isValid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$san_list = "";
|
||||||
|
if (isset($cert_data['extensions']['subjectAltName']) && !empty($cert_data['extensions']['subjectAltName'])) {
|
||||||
|
$SANs = explode(",", $cert_data['extensions']['subjectAltName']);
|
||||||
|
$SANs = array_map('trim', $SANs);
|
||||||
|
foreach ($SANs as $san) {
|
||||||
|
$san = str_replace("DNS:", "", $san);
|
||||||
|
if ($san != $cert_data['subject']['CN'] && strpos($san, "othername:") === false) {
|
||||||
|
$san_list .= $san."<br>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$row = htmlentities_array($cert);
|
$row = htmlentities_array($cert);
|
||||||
eval("\$certificates.=\"" . getTemplate("ssl_certificates/certs_cert", true) . "\";");
|
eval("\$certificates.=\"" . getTemplate("ssl_certificates/certs_cert", true) . "\";");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{$cert_data['subject']['CN']}
|
{$cert_data['subject']['CN']}
|
||||||
|
<if !empty($san_list)><br>SAN: {$san_list}</if>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{$cert_data['issuer']['O']}
|
{$cert_data['issuer']['O']}
|
||||||
|
|||||||
Reference in New Issue
Block a user