Marius Cramer
2014-01-24 8828f85084203f52c9548872e880d5922e448d5f
Merge remote-tracking branch 'origin/stable-3.0.5'

Conflicts:
interface/web/sites/web_aliasdomain_edit.php
5 files modified
54 ■■■■■ changed files
interface/web/admin/templates/server_config_mail_edit.htm 4 ●●●● patch | view | raw | blame | history
interface/web/sites/web_aliasdomain_edit.php 12 ●●●●● patch | view | raw | blame | history
interface/web/sites/web_domain_edit.php 2 ●●● patch | view | raw | blame | history
interface/web/sites/web_subdomain_edit.php 2 ●●● patch | view | raw | blame | history
interface/web/sites/web_vhost_subdomain_edit.php 34 ●●●●● patch | view | raw | blame | history
interface/web/admin/templates/server_config_mail_edit.htm
@@ -67,11 +67,11 @@
            </div>
            <div class="ctrlHolder">
                <label for="relayhost_user">{tmpl_var name='relayhost_user_txt'}</label>
                <input name="relayhost_user" id="relayhost_user" value="{tmpl_var name='relayhost_user'}" size="40" maxlength="255" type="text" class="textInput formLengthHalf" />
                <input name="relayhost_user" id="relayhost_user" value="{tmpl_var name='relayhost_user'}" size="40" maxlength="255" type="text" class="textInput formLengthHalf" autocomplete="off" />
            </div>
            <div class="ctrlHolder">
                <label for="relayhost_password">{tmpl_var name='relayhost_password_txt'}</label>
                <input name="relayhost_password" id="relayhost_password" value="{tmpl_var name='relayhost_password'}" size="40" maxlength="255" type="password" class="textInput formLengthHalf" />
                <input name="relayhost_password" id="relayhost_password" value="{tmpl_var name='relayhost_password'}" size="40" maxlength="255" type="password" class="textInput formLengthHalf" autocomplete="off" />
            </div>
            <div class="ctrlHolder">
                <label for="mailbox_size_limit">{tmpl_var name='mailbox_size_limit_txt'}</label>
interface/web/sites/web_aliasdomain_edit.php
@@ -124,6 +124,9 @@
    function onSubmit() {
        global $app, $conf;
        // Get the record of the parent domain
        $parent_domain = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval(@$this->dataRecord["parent_domain_id"]) . " AND ".$app->tform->getAuthSQL('r'));
        if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
        /* check if the domain module is used - and check if the selected domain can be used! */
        $app->uses('ini_parser,getconf');
        $settings = $app->getconf->get_global_config('domains');
@@ -142,14 +145,9 @@
            $app->tform->errorMessage .= $app->tform->lng("error_proxy_requires_url")."<br />";
        }
        // Get the record of the parent domain
        $parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ? AND ".$app->tform->getAuthSQL('r'), @$this->dataRecord["parent_domain_id"]);
        if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
        // Set a few fixed values
        $this->dataRecord["type"] = 'alias';
        $this->dataRecord["server_id"] = $parent_domain["server_id"];
        //$this->dataRecord["domain"] = $this->dataRecord["domain"].'.'.$parent_domain["domain"];
        $this->parent_domain_record = $parent_domain;
@@ -177,8 +175,8 @@
            //* Update the old website, so that the vhost alias gets removed
            //* We force the update by inserting a transaction record without changes manually.
            $old_website = $app->db->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = ?', $this->oldDataRecord['domain_id']);
            $app->db->datalogSave('web_domain', 'UPDATE', 'domain_id', $this->oldDataRecord['parent_domain_id'], $old_website, $old_website, true);
            $old_website = $app->db->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = '.$app->functions->intval($this->oldDataRecord['domain_id']));
            $app->db->datalogSave('web_domain', 'UPDATE', 'domain_id', $app->functions->intval($this->oldDataRecord['parent_domain_id']), $old_website, $old_website, true);
        }
    }
interface/web/sites/web_domain_edit.php
@@ -634,7 +634,7 @@
            // only generate quota and traffic warnings if value has changed
            if($this->id > 0) {
                $old_web_values = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($this->id));
            }  else {
            } else {
                $old_web_values = array();
            }
interface/web/sites/web_subdomain_edit.php
@@ -134,7 +134,7 @@
        // Get the record of the parent domain
        $parent_domain = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval(@$this->dataRecord["parent_domain_id"]) . " AND ".$app->tform->getAuthSQL('r'));
        if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
        /* check if the domain module is used - and check if the selected domain can be used! */
        $app->uses('ini_parser,getconf');
        $settings = $app->getconf->get_global_config('domains');
        if ($settings['use_domain_module'] == 'y') {
interface/web/sites/web_vhost_subdomain_edit.php
@@ -250,7 +250,7 @@
            $php_directive_snippets_txt = '';
            if(is_array($php_directive_snippets) && !empty($php_directive_snippets)){
                foreach($php_directive_snippets as $php_directive_snippet){
                    $php_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$php_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.$php_directive_snippet['snippet'].'</pre></a> ';
                    $php_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$php_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($php_directive_snippet['snippet']).'</pre></a> ';
                }
            }
            if($php_directive_snippets_txt == '') $php_directive_snippets_txt = '------';
@@ -261,7 +261,7 @@
                $apache_directive_snippets_txt = '';
                if(is_array($apache_directive_snippets) && !empty($apache_directive_snippets)){
                    foreach($apache_directive_snippets as $apache_directive_snippet){
                        $apache_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$apache_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.$apache_directive_snippet['snippet'].'</pre></a> ';
                        $apache_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$apache_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($apache_directive_snippet['snippet']).'</pre></a> ';
                    }
                }
                if($apache_directive_snippets_txt == '') $apache_directive_snippets_txt = '------';
@@ -273,7 +273,7 @@
                $nginx_directive_snippets_txt = '';
                if(is_array($nginx_directive_snippets) && !empty($nginx_directive_snippets)){
                    foreach($nginx_directive_snippets as $nginx_directive_snippet){
                        $nginx_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$nginx_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.$nginx_directive_snippet['snippet'].'</pre></a> ';
                        $nginx_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$nginx_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($nginx_directive_snippet['snippet']).'</pre></a> ';
                    }
                }
                if($nginx_directive_snippets_txt == '') $nginx_directive_snippets_txt = '------';
@@ -284,7 +284,7 @@
            $proxy_directive_snippets_txt = '';
            if(is_array($proxy_directive_snippets) && !empty($proxy_directive_snippets)){
                foreach($proxy_directive_snippets as $proxy_directive_snippet){
                    $proxy_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$proxy_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.$proxy_directive_snippet['snippet'].'</pre></a> ';
                    $proxy_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$proxy_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($proxy_directive_snippet['snippet']).'</pre></a> ';
                }
            }
            if($proxy_directive_snippets_txt == '') $proxy_directive_snippets_txt = '------';
@@ -293,13 +293,17 @@
        $ssl_domain_select = '';
        $tmp = $app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id = ".$this->id);
        $ssl_domains = array($tmp["domain"], 'www.'.$tmp["domain"]);
        $ssl_domains = array($tmp["domain"], 'www.'.$tmp["domain"], '*.'.$tmp["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) {
            $app->tpl->setVar('fixed_folder', 'y');
@@ -308,11 +312,6 @@
            $app->tpl->setVar('fixed_folder', 'n');
            $app->tpl->setVar('server_id_value', $parent_domain['server_id']);
        }
        $app->tpl->setVar("ssl_domain", $ssl_domain_select);
        unset($ssl_domain_select);
        unset($ssl_domains);
        unset($ssl_domain);
        $tmp_txt = ($this->dataRecord['traffic_quota_lock'] == 'y')?'<b>('.$app->tform->lng('traffic_quota_exceeded_txt').')</b>':'';
        $app->tpl->setVar("traffic_quota_exceeded_txt", $tmp_txt);
@@ -354,6 +353,17 @@
            $this->dataRecord["domain"] = str_replace('.'.$parent_domain["domain"], '', $this->dataRecord["domain"]);
        }
        $app->tpl->setVar("domain", $this->dataRecord["domain"]);
        // check for configuration errors in sys_datalog
        if($this->id > 0) {
            $datalog = $app->db->queryOneRecord("SELECT sys_datalog.error, sys_log.tstamp FROM sys_datalog, sys_log WHERE sys_datalog.dbtable = 'web_domain' AND sys_datalog.dbidx = 'domain_id:".$app->functions->intval($this->id)."' AND sys_datalog.datalog_id = sys_log.datalog_id AND sys_log.message = CONCAT('Processed datalog_id ',sys_log.datalog_id) ORDER BY sys_datalog.tstamp DESC");
            if(is_array($datalog) && !empty($datalog)){
                if(trim($datalog['error']) != ''){
                    $app->tpl->setVar("config_error_msg", nl2br(htmlentities($datalog['error'])));
                    $app->tpl->setVar("config_error_tstamp", date($app->lng('conf_format_datetime'), $datalog['tstamp']));
                }
            }
        }
        parent::onShowEnd();
    }
@@ -436,7 +446,7 @@
            if($client['limit_perl'] != 'y') $this->dataRecord['perl'] = '-';
            if($client['limit_ruby'] != 'y') $this->dataRecord['ruby'] = '-';
            if($client['limit_python'] != 'y') $this->dataRecord['python'] = '-';
            if($client['force_suexec'] != 'n') $this->dataRecord['suexec'] = 'y';
            if($client['force_suexec'] == 'y') $this->dataRecord['suexec'] = 'y';
            if($client['limit_hterror'] != 'y') $this->dataRecord['errordocs'] = '-';
            if($client['limit_wildcard'] != 'y' && $this->dataRecord['subdomain'] == '*') $this->dataRecord['subdomain'] = '-';
            if($client['limit_ssl'] != 'y') $this->dataRecord['ssl'] = '-';
@@ -445,7 +455,7 @@
            if($this->id > 0) {
                $old_web_values = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($this->id));
            } else {
                $old_web_values = $_POST;
                $old_web_values = array();
            }
            //* Check the traffic quota of the client