Commit 22ee123e authored by Marius Burkard's avatar Marius Burkard

Option to exclude sub/aliasdomains from LetsEncrypt, implements #4880

parent 652c0b9f
ALTER TABLE `web_domain` ADD COLUMN `ssl_letsencrypt_exclude` enum('n','y') NOT NULL DEFAULT 'n' AFTER `ssl_letsencrypt`;
......@@ -1943,6 +1943,7 @@ CREATE TABLE `web_domain` (
`rewrite_to_https` ENUM('y','n') NOT NULL DEFAULT 'n',
`ssl` enum('n','y') NOT NULL default 'n',
`ssl_letsencrypt` enum('n','y') NOT NULL DEFAULT 'n',
`ssl_letsencrypt_exclude` enum('n','y') NOT NULL DEFAULT 'n',
`ssl_state` varchar(255) NULL,
`ssl_locality` varchar(255) NULL,
`ssl_organisation` varchar(255) NULL,
......
......@@ -133,6 +133,12 @@ $form["tabs"]['domain'] = array (
'width' => '30',
'maxlength' => '255'
),
'ssl_letsencrypt_exclude' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'n',
'value' => array(0 => 'n', 1 => 'y')
),
'active' => array (
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
......
......@@ -115,4 +115,5 @@ $wb['available_php_directive_snippets_txt'] = 'Verfügbare PHP-Direktiven-Schnip
$wb['available_apache_directive_snippets_txt'] = 'Verfügbare Apache-Direktiven-Schnipsel:';
$wb['available_nginx_directive_snippets_txt'] = 'Verfügbare nginx-Direktiven-Schnipsel:';
$wb['Domain'] = 'Aliasdomain';
$wb['ssl_letsencrypt_exclude_txt'] = 'Nicht in Let\'s Encrypt Zertifikat aufnehmen';
?>
......@@ -115,4 +115,5 @@ $wb['available_php_directive_snippets_txt'] = 'Available PHP Directive Snippets:
$wb['available_apache_directive_snippets_txt'] = 'Available Apache Directive Snippets:';
$wb['available_nginx_directive_snippets_txt'] = 'Available nginx Directive Snippets:';
$wb['Domain'] = 'Aliasdomain';
$wb['ssl_letsencrypt_exclude_txt'] = 'Don\'t add to Let\'s Encrypt certificate';
?>
......@@ -67,6 +67,14 @@
<div class="col-sm-9"><select name="seo_redirect" id="seo_redirect" class="form-control">
{tmpl_var name='seo_redirect'}
</select></div>
</div>
</tmpl_if>
<tmpl_if name="limit_ssl_letsencrypt" op="==" value="y">
<div class="form-group">
<label class="col-sm-3 control-label">{tmpl_var name='ssl_letsencrypt_exclude_txt'}</label>
<div class="col-sm-9">
{tmpl_var name='ssl_letsencrypt_exclude'}
</div>
</div>
</tmpl_if>
<div class="form-group">
......
......@@ -203,7 +203,7 @@ class letsencrypt {
}
//* then, add subdomain if we have
$subdomains = $app->db->queryAllRecords('SELECT domain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'subdomain'");
$subdomains = $app->db->queryAllRecords('SELECT domain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'subdomain' AND ssl_letsencrypt_exclude != 'y'");
if(is_array($subdomains)) {
foreach($subdomains as $subdomain) {
$temp_domains[] = $subdomain['domain'];
......@@ -211,7 +211,7 @@ class letsencrypt {
}
//* then, add alias domain if we have
$aliasdomains = $app->db->queryAllRecords('SELECT domain,subdomain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'alias'");
$aliasdomains = $app->db->queryAllRecords('SELECT domain,subdomain FROM web_domain WHERE parent_domain_id = '.intval($data['new']['domain_id'])." AND active = 'y' AND type = 'alias' AND ssl_letsencrypt_exclude != 'y'");
if(is_array($aliasdomains)) {
foreach($aliasdomains as $aliasdomain) {
$temp_domains[] = $aliasdomain['domain'];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment