diff --git a/actions/admin/settings/130.webserver.php b/actions/admin/settings/130.webserver.php index 4285f4bc..ece28bf4 100644 --- a/actions/admin/settings/130.webserver.php +++ b/actions/admin/settings/130.webserver.php @@ -100,7 +100,7 @@ return array( 'varname' => 'customer_ssl_path', 'type' => 'string', 'string_type' => 'dir', - 'default' => '/etc/apache2/ssl/', + 'default' => '/etc/ssl/froxlor-custom/', 'save_method' => 'storeSettingField', ), 'system_phpappendopenbasedir' => array( diff --git a/install/froxlor.sql b/install/froxlor.sql index 965856e3..e0b59f7e 100644 --- a/install/froxlor.sql +++ b/install/froxlor.sql @@ -510,7 +510,7 @@ INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'documentroot_use_default_value', '0'), ('system', 'passwordcryptfunc', '1'), ('system', 'axfrservers', ''), - ('system', 'customer_ssl_path', '/etc/apache2/ssl/'), + ('system', 'customer_ssl_path', '/etc/ssl/froxlor-custom/'), ('panel', 'decimal_places', '4'), ('panel', 'adminmail', 'admin@SERVERNAME'), ('panel', 'phpmyadmin_url', ''), diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 327f9007..ad55b88b 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -2126,7 +2126,11 @@ if (isFroxlorVersion('0.9.29-dev3')) { ) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_general_ci;"); lastStepStatus(0); - $system_customersslpath = isset($_POST['system_customersslpath']) ? makeCorrectDir($_POST['system_customersslpath']) : '/etc/apache2/ssl/'; + $system_customersslpath = isset($_POST['system_customersslpath']) ? makeCorrectDir($_POST['system_customersslpath']) : '/etc/ssl/froxlor-custom/'; + if (trim($system_customersslpath) == '/') { + // prevent users from specifying nonsense here + $system_customersslpath = '/etc/ssl/froxlor-custom/'; + } $db->query("INSERT INTO `panel_settings` (`settinggroup`, `varname`, `value`) VALUES ('system', 'customer_ssl_path', '".$db->escape($system_customersslpath)."');"); updateToVersion('0.9.29-dev4'); } diff --git a/install/updates/preconfig/0.9/preconfig_0.9.inc.php b/install/updates/preconfig/0.9/preconfig_0.9.inc.php index c017fb8f..f0f3c7e0 100644 --- a/install/updates/preconfig/0.9/preconfig_0.9.inc.php +++ b/install/updates/preconfig/0.9/preconfig_0.9.inc.php @@ -538,7 +538,7 @@ function parseAndOutputPreconfig(&$has_preconfig, &$return, $current_version) $has_preconfig = true; $description = 'As customers can now specify ssl-certificate data for their domains, you need to specify where the generated files are stored
'; $question = 'Specify the directory for customer ssl-certificates: '; - $question.= ''; + $question.= ''; eval("\$return.=\"" . getTemplate("update/preconfigitem") . "\";"); } diff --git a/lib/classes/webserver/class.ConfigIO.php b/lib/classes/webserver/class.ConfigIO.php index 1cb8ef20..3d13b9f6 100644 --- a/lib/classes/webserver/class.ConfigIO.php +++ b/lib/classes/webserver/class.ConfigIO.php @@ -70,17 +70,22 @@ class ConfigIO { */ private function _cleanCustomerSslCerts() { - // get correct directory - $configdir = $this->_getFile('system', 'customer_ssl_path'); - if ($configdir !== false) { + /* + * only clean up if we're actually using SSL + */ + if ($this->_settings['system']['use_ssl'] == '1') { + // get correct directory + $configdir = $this->_getFile('system', 'customer_ssl_path'); + if ($configdir !== false) { - $configdir = makeCorrectDir($configdir); + $configdir = makeCorrectDir($configdir); - if (@is_dir($configdir)) { - // now get rid of old stuff - //(but append /* so we don't delete the directory) - $configdir.='/*'; - safe_exec('rm -rf '. makeCorrectFile($configdir)); + if (@is_dir($configdir)) { + // now get rid of old stuff + //(but append /* so we don't delete the directory) + $configdir.='/*'; + safe_exec('rm -rf '. makeCorrectFile($configdir)); + } } } }