From 3764dc4ad0b85b25cfe1247f68c5df00a2f0445d Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Tue, 27 Oct 2009 11:34:34 -0400 Subject: [PATCH] Implemented: FS#539 - ssl domain must be selectable --- interface/web/sites/templates/web_domain_ssl.htm | 118 ++++++++++++----------- install/sql/ispconfig3.sql | 1 server/plugins-available/apache2_plugin.inc.php | 2 interface/web/sites/lib/lang/en_web_domain.lng | 99 ++++++++++--------- interface/web/sites/web_domain_edit.php | 13 ++ interface/web/sites/form/web_domain.tform.php | 8 + 6 files changed, 135 insertions(+), 106 deletions(-) diff --git a/install/sql/ispconfig3.sql b/install/sql/ispconfig3.sql index d863a59..017423f 100644 --- a/install/sql/ispconfig3.sql +++ b/install/sql/ispconfig3.sql @@ -1022,6 +1022,7 @@ `ssl_organisation` varchar(255) NULL, `ssl_organisation_unit` varchar(255) NULL, `ssl_country` varchar(255) NULL, + `ssl_domain` varchar(255) NULL, `ssl_request` mediumtext NULL, `ssl_cert` mediumtext NULL, `ssl_bundle` mediumtext NULL, diff --git a/interface/web/sites/form/web_domain.tform.php b/interface/web/sites/form/web_domain.tform.php index c4494e9..df2b75a 100644 --- a/interface/web/sites/form/web_domain.tform.php +++ b/interface/web/sites/form/web_domain.tform.php @@ -286,6 +286,14 @@ 'width' => '2', 'maxlength' => '2' ), + 'ssl_domain' => array ( + 'datatype' => 'VARCHAR', + 'formtype' => 'TEXT', + 'default' => '', + 'value' => '', + 'width' => '30', + 'maxlength' => '255' + ), 'ssl_request' => array ( 'datatype' => 'TEXT', 'formtype' => 'TEXTAREA', diff --git a/interface/web/sites/lib/lang/en_web_domain.lng b/interface/web/sites/lib/lang/en_web_domain.lng index 7a23f16..62e625a 100644 --- a/interface/web/sites/lib/lang/en_web_domain.lng +++ b/interface/web/sites/lib/lang/en_web_domain.lng @@ -1,49 +1,50 @@ -<?php -$wb["ssl_state_txt"] = 'State'; -$wb["ssl_locality_txt"] = 'Locality'; -$wb["ssl_organisation_txt"] = 'Organisation'; -$wb["ssl_organisation_unit_txt"] = 'Organisation Unit'; -$wb["ssl_country_txt"] = 'Country'; -$wb["ssl_request_txt"] = 'SSL Request'; -$wb["ssl_cert_txt"] = 'SSL Certificate'; -$wb["ssl_bundle_txt"] = 'SSL Bundle'; -$wb["ssl_action_txt"] = 'SSL Action'; -$wb["server_id_txt"] = 'Server'; -$wb["domain_txt"] = 'Domain'; -$wb["type_txt"] = 'Type'; -$wb["parent_domain_id_txt"] = 'Parent Website'; -$wb["redirect_type_txt"] = 'Redirect Type'; -$wb["redirect_path_txt"] = 'Redirect Path'; -$wb["active_txt"] = 'Active'; -$wb["document_root_txt"] = 'Documentroot'; -$wb["system_user_txt"] = 'Linux User'; -$wb["system_group_txt"] = 'Linux Group'; -$wb["ip_address_txt"] = 'IP-Address'; -$wb["vhost_type_txt"] = 'VHost Type'; -$wb["hd_quota_txt"] = 'Harddisk Quota'; -$wb["traffic_quota_txt"] = 'Traffic Quota'; -$wb["cgi_txt"] = 'CGI'; -$wb["ssi_txt"] = 'SSI'; -$wb["errordocs_txt"] = 'Own Error-Documents'; -$wb["subdomain_txt"] = 'Auto-Subdomain'; -$wb["ssl_txt"] = 'SSL'; -$wb["suexec_txt"] = 'SuEXEC'; -$wb["php_txt"] = 'PHP'; -$wb["client_txt"] = 'Client'; -$wb["limit_web_domain_txt"] = 'The max. number of web domains for your account is reached.'; -$wb["limit_web_aliasdomain_txt"] = 'The max. number of aliasdomains for your account is reached.'; -$wb["limit_web_subdomain_txt"] = 'The max. number of web subdomains for your account is reached.'; -$wb["apache_directives_txt"] = 'Apache directives'; -$wb["domain_error_empty"] = 'Domain is empty.'; -$wb["domain_error_unique"] = 'There is already a website or sub / aliasdomain with this domain name.'; -$wb["domain_error_regex"] = 'Domain name invalid.'; -$wb["hd_quota_error_empty"] = 'Harddisk quota is empty.'; -$wb["traffic_quota_error_empty"] = 'Traffic quota is empty.'; -$wb['error_ssl_state_empty'] = 'SSL State is empty.'; -$wb['error_ssl_locality_empty'] = 'SSL Locality is empty.'; -$wb['error_ssl_organisation_empty'] = 'SSL Organisation is empty.'; -$wb['error_ssl_organisation_unit_empty'] = 'SSL Organisation Unit is empty.'; -$wb['error_ssl_country_empty'] = 'SSL Country is empty.'; -$wb["client_group_id_txt"] = 'Client'; -$wb["stats_password_txt"] = 'Webstatistics password'; -?> +<?php +$wb["ssl_state_txt"] = 'State'; +$wb["ssl_locality_txt"] = 'Locality'; +$wb["ssl_organisation_txt"] = 'Organisation'; +$wb["ssl_organisation_unit_txt"] = 'Organisation Unit'; +$wb["ssl_country_txt"] = 'Country'; +$wb["ssl_request_txt"] = 'SSL Request'; +$wb["ssl_cert_txt"] = 'SSL Certificate'; +$wb["ssl_bundle_txt"] = 'SSL Bundle'; +$wb["ssl_action_txt"] = 'SSL Action'; +$wb["ssl_domain_txt"] = 'SSL Domain'; +$wb["server_id_txt"] = 'Server'; +$wb["domain_txt"] = 'Domain'; +$wb["type_txt"] = 'Type'; +$wb["parent_domain_id_txt"] = 'Parent Website'; +$wb["redirect_type_txt"] = 'Redirect Type'; +$wb["redirect_path_txt"] = 'Redirect Path'; +$wb["active_txt"] = 'Active'; +$wb["document_root_txt"] = 'Documentroot'; +$wb["system_user_txt"] = 'Linux User'; +$wb["system_group_txt"] = 'Linux Group'; +$wb["ip_address_txt"] = 'IP-Address'; +$wb["vhost_type_txt"] = 'VHost Type'; +$wb["hd_quota_txt"] = 'Harddisk Quota'; +$wb["traffic_quota_txt"] = 'Traffic Quota'; +$wb["cgi_txt"] = 'CGI'; +$wb["ssi_txt"] = 'SSI'; +$wb["errordocs_txt"] = 'Own Error-Documents'; +$wb["subdomain_txt"] = 'Auto-Subdomain'; +$wb["ssl_txt"] = 'SSL'; +$wb["suexec_txt"] = 'SuEXEC'; +$wb["php_txt"] = 'PHP'; +$wb["client_txt"] = 'Client'; +$wb["limit_web_domain_txt"] = 'The max. number of web domains for your account is reached.'; +$wb["limit_web_aliasdomain_txt"] = 'The max. number of aliasdomains for your account is reached.'; +$wb["limit_web_subdomain_txt"] = 'The max. number of web subdomains for your account is reached.'; +$wb["apache_directives_txt"] = 'Apache directives'; +$wb["domain_error_empty"] = 'Domain is empty.'; +$wb["domain_error_unique"] = 'There is already a website or sub / aliasdomain with this domain name.'; +$wb["domain_error_regex"] = 'Domain name invalid.'; +$wb["hd_quota_error_empty"] = 'Harddisk quota is empty.'; +$wb["traffic_quota_error_empty"] = 'Traffic quota is empty.'; +$wb['error_ssl_state_empty'] = 'SSL State is empty.'; +$wb['error_ssl_locality_empty'] = 'SSL Locality is empty.'; +$wb['error_ssl_organisation_empty'] = 'SSL Organisation is empty.'; +$wb['error_ssl_organisation_unit_empty'] = 'SSL Organisation Unit is empty.'; +$wb['error_ssl_country_empty'] = 'SSL Country is empty.'; +$wb["client_group_id_txt"] = 'Client'; +$wb["stats_password_txt"] = 'Webstatistics password'; +?> diff --git a/interface/web/sites/templates/web_domain_ssl.htm b/interface/web/sites/templates/web_domain_ssl.htm index 0017e0e..9e86006 100644 --- a/interface/web/sites/templates/web_domain_ssl.htm +++ b/interface/web/sites/templates/web_domain_ssl.htm @@ -1,56 +1,62 @@ -<h2><tmpl_var name="list_head_txt"></h2> -<p><tmpl_var name="list_desc_txt"></p> - -<div class="panel panel_web_domain"> - - <div class="pnl_formsarea"> - <fieldset class="inlineLabels"> - <div class="ctrlHolder"> - <label for="ssl_state">{tmpl_var name='ssl_state_txt'}</label> - <input name="ssl_state" id="ssl_state" value="{tmpl_var name='ssl_state'}" size="30" maxlength="255" type="text" class="textInput" /> - </div> - <div class="ctrlHolder"> - <label for="ssl_locality">{tmpl_var name='ssl_locality_txt'}</label> - <input name="ssl_locality" id="ssl_locality" value="{tmpl_var name='ssl_locality'}" size="30" maxlength="255" type="text" class="textInput" /> - </div> - <div class="ctrlHolder"> - <label for="ssl_organisation">{tmpl_var name='ssl_organisation_txt'}</label> - <input name="ssl_organisation" id="ssl_organisation" value="{tmpl_var name='ssl_organisation'}" size="30" maxlength="255" type="text" class="textInput" /> - </div> - <div class="ctrlHolder"> - <label for="ssl_organisation_unit">{tmpl_var name='ssl_organisation_unit_txt'}</label> - <input name="ssl_organisation_unit" id="ssl_organisation_unit" value="{tmpl_var name='ssl_organisation_unit'}" size="30" maxlength="255" type="text" class="textInput" /> - </div> - <div class="ctrlHolder"> - <label for="ssl_country">{tmpl_var name='ssl_country_txt'}</label> - <input name="ssl_country" id="ssl_country" value="{tmpl_var name='ssl_country'}" size="2" maxlength="2" type="text" class="textInput" /> - </div> - <div class="ctrlHolder"> - <label for="ssl_request">{tmpl_var name='ssl_request_txt'}</label> - <textarea name="ssl_request" id="ssl_request" rows='10' cols='30'>{tmpl_var name='ssl_request'}</textarea> - </div> - <div class="ctrlHolder"> - <label for="ssl_cert">{tmpl_var name='ssl_cert_txt'}</label> - <textarea name="ssl_cert" id="ssl_cert" rows='10' cols='30'>{tmpl_var name='ssl_cert'}</textarea> - </div> - <div class="ctrlHolder"> - <label for="ssl_bundle">{tmpl_var name='ssl_bundle_txt'}</label> - <textarea name="ssl_bundle" id="ssl_bundle" rows='10' cols='30'>{tmpl_var name='ssl_bundle'}</textarea> - </div> - <div class="ctrlHolder"> - <label for="ssl_action">{tmpl_var name='ssl_action_txt'}</label> - <select name="ssl_action" id="ssl_action" class="selectInput formLengthHalf"> - {tmpl_var name='ssl_action'} - </select> - </div> - </fieldset> - - <input type="hidden" name="id" value="{tmpl_var name='id'}"> - - <div class="buttonHolder buttons"> - <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_domain_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button> - <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button> - </div> - </div> - -</div> +<h2><tmpl_var name="list_head_txt"></h2> +<p><tmpl_var name="list_desc_txt"></p> + +<div class="panel panel_web_domain"> + + <div class="pnl_formsarea"> + <fieldset class="inlineLabels"> + <div class="ctrlHolder"> + <label for="ssl_state">{tmpl_var name='ssl_state_txt'}</label> + <input name="ssl_state" id="ssl_state" value="{tmpl_var name='ssl_state'}" size="30" maxlength="255" type="text" class="textInput" /> + </div> + <div class="ctrlHolder"> + <label for="ssl_locality">{tmpl_var name='ssl_locality_txt'}</label> + <input name="ssl_locality" id="ssl_locality" value="{tmpl_var name='ssl_locality'}" size="30" maxlength="255" type="text" class="textInput" /> + </div> + <div class="ctrlHolder"> + <label for="ssl_organisation">{tmpl_var name='ssl_organisation_txt'}</label> + <input name="ssl_organisation" id="ssl_organisation" value="{tmpl_var name='ssl_organisation'}" size="30" maxlength="255" type="text" class="textInput" /> + </div> + <div class="ctrlHolder"> + <label for="ssl_organisation_unit">{tmpl_var name='ssl_organisation_unit_txt'}</label> + <input name="ssl_organisation_unit" id="ssl_organisation_unit" value="{tmpl_var name='ssl_organisation_unit'}" size="30" maxlength="255" type="text" class="textInput" /> + </div> + <div class="ctrlHolder"> + <label for="ssl_country">{tmpl_var name='ssl_country_txt'}</label> + <input name="ssl_country" id="ssl_country" value="{tmpl_var name='ssl_country'}" size="2" maxlength="2" type="text" class="textInput" /> + </div> + <div class="ctrlHolder"> + <label for="client_group_id">{tmpl_var name='ssl_domain_txt'}</label> + <select name="ssl_domain" id="ssl_domain" class="selectInput"> + {tmpl_var name='ssl_domain'} + </select> + </div> + <div class="ctrlHolder"> + <label for="ssl_request">{tmpl_var name='ssl_request_txt'}</label> + <textarea name="ssl_request" id="ssl_request" rows='10' cols='30'>{tmpl_var name='ssl_request'}</textarea> + </div> + <div class="ctrlHolder"> + <label for="ssl_cert">{tmpl_var name='ssl_cert_txt'}</label> + <textarea name="ssl_cert" id="ssl_cert" rows='10' cols='30'>{tmpl_var name='ssl_cert'}</textarea> + </div> + <div class="ctrlHolder"> + <label for="ssl_bundle">{tmpl_var name='ssl_bundle_txt'}</label> + <textarea name="ssl_bundle" id="ssl_bundle" rows='10' cols='30'>{tmpl_var name='ssl_bundle'}</textarea> + </div> + <div class="ctrlHolder"> + <label for="ssl_action">{tmpl_var name='ssl_action_txt'}</label> + <select name="ssl_action" id="ssl_action" class="selectInput formLengthHalf"> + {tmpl_var name='ssl_action'} + </select> + </div> + </fieldset> + + <input type="hidden" name="id" value="{tmpl_var name='id'}"> + + <div class="buttonHolder buttons"> + <button class="positive iconstxt icoPositive" type="button" value="{tmpl_var name='btn_save_txt'}" onClick="submitForm('pageForm','sites/web_domain_edit.php');"><span>{tmpl_var name='btn_save_txt'}</span></button> + <button class="negative iconstxt icoNegative" type="button" value="{tmpl_var name='btn_cancel_txt'}" onClick="loadContent('sites/web_domain_list.php');"><span>{tmpl_var name='btn_cancel_txt'}</span></button> + </div> + </div> + +</div> diff --git a/interface/web/sites/web_domain_edit.php b/interface/web/sites/web_domain_edit.php index 1e197f9..51ce098 100644 --- a/interface/web/sites/web_domain_edit.php +++ b/interface/web/sites/web_domain_edit.php @@ -179,6 +179,19 @@ } + $ssl_domain_select = ''; + $ssl_domains = array($this->dataRecord["domain"],'www.'.$this->dataRecord["domain"]); + if(is_array($ssl_domains)) { + foreach( $ssl_domains as $ssl_domain) { + $selected = ($ssl_domain == $this->dataRecord['ssl_domain'])?'SELECTED':''; + $ssl_domain_select .= "<option value='$ssl_domain' $selected>$ssl_domain</option>\r\n"; + } + } + $app->tpl->setVar("ssl_domain",$ssl_domain_select); + unset($ssl_domain_select); + unset($ssl_domains); + unset($ssl_domain); + if($this->id > 0) { //* we are editing a existing record $app->tpl->setVar("edit_disabled", 1); diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index 3c3f765..7af0653 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -83,7 +83,7 @@ if(!is_dir($data["new"]["document_root"]."/ssl")) exec("mkdir -p ".$data["new"]["document_root"]."/ssl"); $ssl_dir = $data["new"]["document_root"]."/ssl"; - $domain = $data["new"]["domain"]; + $domain = $data["new"]["ssl_domain"]; $key_file = $ssl_dir.'/'.$domain.".key.org"; $key_file2 = $ssl_dir.'/'.$domain.".key"; $csr_file = $ssl_dir.'/'.$domain.".csr"; -- Gitblit v1.9.1