Marius Burkard
2016-02-04 2436971b3ebe3386fe9a3db44423a5705f9f6e38
- made state, locality, organization and organization unit optional on ssl creation (Fixes #2811)
4 files modified
28 ■■■■■ changed files
interface/web/sites/form/web_vhost_domain.tform.php 8 ●●●● patch | view | raw | blame | history
interface/web/sites/web_vhost_domain_edit.php 4 ●●●● patch | view | raw | blame | history
server/plugins-available/apache2_plugin.inc.php 8 ●●●● patch | view | raw | blame | history
server/plugins-available/nginx_plugin.inc.php 8 ●●●● patch | view | raw | blame | history
interface/web/sites/form/web_vhost_domain.tform.php
@@ -447,7 +447,7 @@
                'datatype' => 'VARCHAR',
                'formtype' => 'TEXT',
                'validators' => array (  0 => array ( 'type' => 'REGEX',
                        'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{1,255}))$/',
                        'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{0,255}))$/',
                        'errmsg'=> 'ssl_state_error_regex'),
                ),
                'default' => '',
@@ -459,7 +459,7 @@
                'datatype' => 'VARCHAR',
                'formtype' => 'TEXT',
                'validators' => array (  0 => array ( 'type' => 'REGEX',
                        'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{1,255}))$/',
                        'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{0,255}))$/',
                        'errmsg'=> 'ssl_locality_error_regex'),
                ),
                'default' => '',
@@ -471,7 +471,7 @@
                'datatype' => 'VARCHAR',
                'formtype' => 'TEXT',
                'validators' => array (  0 => array ( 'type' => 'REGEX',
                        'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{1,255}))$/',
                        'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{0,255}))$/',
                        'errmsg'=> 'ssl_organisation_error_regex'),
                ),
                'default' => '',
@@ -483,7 +483,7 @@
                'datatype' => 'VARCHAR',
                'formtype' => 'TEXT',
                'validators' => array (  0 => array ( 'type' => 'REGEX',
                        'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{1,255}))$/',
                        'regex' => '/^(([\.]{0})|([-a-zA-Z0-9._,&äöüÄÖÜ ]{0,255}))$/',
                        'errmsg'=> 'ssl_organistaion_unit_error_regex'),
                ),
                'default' => '',
interface/web/sites/web_vhost_domain_edit.php
@@ -1415,10 +1415,6 @@
        //* Check that all fields for the SSL cert creation are filled
        if(isset($this->dataRecord['ssl_action']) && $this->dataRecord['ssl_action'] == 'create') {
            if($this->dataRecord['ssl_state'] == '') $app->tform->errorMessage .= $app->tform->lng('error_ssl_state_empty').'<br />';
            if($this->dataRecord['ssl_locality'] == '') $app->tform->errorMessage .= $app->tform->lng('error_ssl_locality_empty').'<br />';
            if($this->dataRecord['ssl_organisation'] == '') $app->tform->errorMessage .= $app->tform->lng('error_ssl_organisation_empty').'<br />';
            if($this->dataRecord['ssl_organisation_unit'] == '') $app->tform->errorMessage .= $app->tform->lng('error_ssl_organisation_unit_empty').'<br />';
            if($this->dataRecord['ssl_country'] == '') $app->tform->errorMessage .= $app->tform->lng('error_ssl_country_empty').'<br />';
        }
server/plugins-available/apache2_plugin.inc.php
@@ -275,10 +275,10 @@
        [ req_distinguished_name ]
        C                      = ".trim($data['new']['ssl_country'])."
        ST                     = ".trim($data['new']['ssl_state'])."
        L                      = ".trim($data['new']['ssl_locality'])."
        O                      = ".trim($data['new']['ssl_organisation'])."
        OU                     = ".trim($data['new']['ssl_organisation_unit'])."
        " . (trim($data['new']['ssl_state']) == '' ? '' : "ST                     = ".trim($data['new']['ssl_state'])) . "
        " . (trim($data['new']['ssl_locality']) == '' ? '' : "L                      = ".trim($data['new']['ssl_locality']))."
        " . (trim($data['new']['ssl_organisation']) == '' ? '' : "O                      = ".trim($data['new']['ssl_organisation']))."
        " . (trim($data['new']['ssl_organisation_unit']) == '' ? '' : "OU                     = ".trim($data['new']['ssl_organisation_unit']))."
        CN                     = $domain
        emailAddress           = webmaster@".$data['new']['domain']."
server/plugins-available/nginx_plugin.inc.php
@@ -156,10 +156,10 @@
        [ req_distinguished_name ]
        C                      = ".trim($data['new']['ssl_country'])."
        ST                     = ".trim($data['new']['ssl_state'])."
        L                      = ".trim($data['new']['ssl_locality'])."
        O                      = ".trim($data['new']['ssl_organisation'])."
        OU                     = ".trim($data['new']['ssl_organisation_unit'])."
        " . (trim($data['new']['ssl_state']) == '' ? '' : "ST                     = ".trim($data['new']['ssl_state'])) . "
        " . (trim($data['new']['ssl_locality']) == '' ? '' : "L                      = ".trim($data['new']['ssl_locality']))."
        " . (trim($data['new']['ssl_organisation']) == '' ? '' : "O                      = ".trim($data['new']['ssl_organisation']))."
        " . (trim($data['new']['ssl_organisation_unit']) == '' ? '' : "OU                     = ".trim($data['new']['ssl_organisation_unit']))."
        CN                     = $domain
        emailAddress           = webmaster@".$data['new']['domain']."