Skip to content

Commit 8828f85

Browse files
author
Marius Cramer
committed
Merge remote-tracking branch 'origin/stable-3.0.5'
Conflicts: interface/web/sites/web_aliasdomain_edit.php
2 parents 88d47d2 + 9a02e24 commit 8828f85

File tree

5 files changed

+31
-23
lines changed

5 files changed

+31
-23
lines changed

interface/web/admin/templates/server_config_mail_edit.htm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ <h2><tmpl_var name="list_head_txt"></h2>
6767
</div>
6868
<div class="ctrlHolder">
6969
<label for="relayhost_user">{tmpl_var name='relayhost_user_txt'}</label>
70-
<input name="relayhost_user" id="relayhost_user" value="{tmpl_var name='relayhost_user'}" size="40" maxlength="255" type="text" class="textInput formLengthHalf" />
70+
<input name="relayhost_user" id="relayhost_user" value="{tmpl_var name='relayhost_user'}" size="40" maxlength="255" type="text" class="textInput formLengthHalf" autocomplete="off" />
7171
</div>
7272
<div class="ctrlHolder">
7373
<label for="relayhost_password">{tmpl_var name='relayhost_password_txt'}</label>
74-
<input name="relayhost_password" id="relayhost_password" value="{tmpl_var name='relayhost_password'}" size="40" maxlength="255" type="password" class="textInput formLengthHalf" />
74+
<input name="relayhost_password" id="relayhost_password" value="{tmpl_var name='relayhost_password'}" size="40" maxlength="255" type="password" class="textInput formLengthHalf" autocomplete="off" />
7575
</div>
7676
<div class="ctrlHolder">
7777
<label for="mailbox_size_limit">{tmpl_var name='mailbox_size_limit_txt'}</label>

interface/web/sites/web_aliasdomain_edit.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ function onShowEnd() {
124124
function onSubmit() {
125125
global $app, $conf;
126126

127+
// Get the record of the parent domain
128+
$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'));
129+
if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
127130
/* check if the domain module is used - and check if the selected domain can be used! */
128131
$app->uses('ini_parser,getconf');
129132
$settings = $app->getconf->get_global_config('domains');
@@ -142,14 +145,9 @@ function onSubmit() {
142145
$app->tform->errorMessage .= $app->tform->lng("error_proxy_requires_url")."<br />";
143146
}
144147

145-
// Get the record of the parent domain
146-
$parent_domain = $app->db->queryOneRecord("select * FROM web_domain WHERE domain_id = ? AND ".$app->tform->getAuthSQL('r'), @$this->dataRecord["parent_domain_id"]);
147-
if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
148-
149148
// Set a few fixed values
150149
$this->dataRecord["type"] = 'alias';
151150
$this->dataRecord["server_id"] = $parent_domain["server_id"];
152-
//$this->dataRecord["domain"] = $this->dataRecord["domain"].'.'.$parent_domain["domain"];
153151

154152
$this->parent_domain_record = $parent_domain;
155153

@@ -177,8 +175,8 @@ function onAfterUpdate() {
177175

178176
//* Update the old website, so that the vhost alias gets removed
179177
//* We force the update by inserting a transaction record without changes manually.
180-
$old_website = $app->db->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = ?', $this->oldDataRecord['domain_id']);
181-
$app->db->datalogSave('web_domain', 'UPDATE', 'domain_id', $this->oldDataRecord['parent_domain_id'], $old_website, $old_website, true);
178+
$old_website = $app->db->queryOneRecord('SELECT * FROM web_domain WHERE domain_id = '.$app->functions->intval($this->oldDataRecord['domain_id']));
179+
$app->db->datalogSave('web_domain', 'UPDATE', 'domain_id', $app->functions->intval($this->oldDataRecord['parent_domain_id']), $old_website, $old_website, true);
182180
}
183181

184182
}

interface/web/sites/web_domain_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ function onSubmit() {
634634
// only generate quota and traffic warnings if value has changed
635635
if($this->id > 0) {
636636
$old_web_values = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($this->id));
637-
} else {
637+
} else {
638638
$old_web_values = array();
639639
}
640640

interface/web/sites/web_subdomain_edit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ function onSubmit() {
134134
// Get the record of the parent domain
135135
$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'));
136136
if(!$parent_domain || $parent_domain['domain_id'] != @$this->dataRecord['parent_domain_id']) $app->tform->errorMessage .= $app->tform->lng("no_domain_perm");
137-
137+
/* check if the domain module is used - and check if the selected domain can be used! */
138138
$app->uses('ini_parser,getconf');
139139
$settings = $app->getconf->get_global_config('domains');
140140
if ($settings['use_domain_module'] == 'y') {

interface/web/sites/web_vhost_subdomain_edit.php

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ function onShowEnd() {
250250
$php_directive_snippets_txt = '';
251251
if(is_array($php_directive_snippets) && !empty($php_directive_snippets)){
252252
foreach($php_directive_snippets as $php_directive_snippet){
253-
$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> ';
253+
$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> ';
254254
}
255255
}
256256
if($php_directive_snippets_txt == '') $php_directive_snippets_txt = '------';
@@ -261,7 +261,7 @@ function onShowEnd() {
261261
$apache_directive_snippets_txt = '';
262262
if(is_array($apache_directive_snippets) && !empty($apache_directive_snippets)){
263263
foreach($apache_directive_snippets as $apache_directive_snippet){
264-
$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> ';
264+
$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> ';
265265
}
266266
}
267267
if($apache_directive_snippets_txt == '') $apache_directive_snippets_txt = '------';
@@ -273,7 +273,7 @@ function onShowEnd() {
273273
$nginx_directive_snippets_txt = '';
274274
if(is_array($nginx_directive_snippets) && !empty($nginx_directive_snippets)){
275275
foreach($nginx_directive_snippets as $nginx_directive_snippet){
276-
$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> ';
276+
$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> ';
277277
}
278278
}
279279
if($nginx_directive_snippets_txt == '') $nginx_directive_snippets_txt = '------';
@@ -284,7 +284,7 @@ function onShowEnd() {
284284
$proxy_directive_snippets_txt = '';
285285
if(is_array($proxy_directive_snippets) && !empty($proxy_directive_snippets)){
286286
foreach($proxy_directive_snippets as $proxy_directive_snippet){
287-
$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> ';
287+
$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> ';
288288
}
289289
}
290290
if($proxy_directive_snippets_txt == '') $proxy_directive_snippets_txt = '------';
@@ -293,13 +293,17 @@ function onShowEnd() {
293293

294294
$ssl_domain_select = '';
295295
$tmp = $app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id = ".$this->id);
296-
$ssl_domains = array($tmp["domain"], 'www.'.$tmp["domain"]);
296+
$ssl_domains = array($tmp["domain"], 'www.'.$tmp["domain"], '*.'.$tmp["domain"]);
297297
if(is_array($ssl_domains)) {
298298
foreach( $ssl_domains as $ssl_domain) {
299299
$selected = ($ssl_domain == $this->dataRecord['ssl_domain'])?'SELECTED':'';
300300
$ssl_domain_select .= "<option value='$ssl_domain' $selected>$ssl_domain</option>\r\n";
301301
}
302302
}
303+
$app->tpl->setVar("ssl_domain", $ssl_domain_select);
304+
unset($ssl_domain_select);
305+
unset($ssl_domains);
306+
unset($ssl_domain);
303307

304308
if($this->id > 0) {
305309
$app->tpl->setVar('fixed_folder', 'y');
@@ -309,11 +313,6 @@ function onShowEnd() {
309313
$app->tpl->setVar('server_id_value', $parent_domain['server_id']);
310314
}
311315

312-
$app->tpl->setVar("ssl_domain", $ssl_domain_select);
313-
unset($ssl_domain_select);
314-
unset($ssl_domains);
315-
unset($ssl_domain);
316-
317316
$tmp_txt = ($this->dataRecord['traffic_quota_lock'] == 'y')?'<b>('.$app->tform->lng('traffic_quota_exceeded_txt').')</b>':'';
318317
$app->tpl->setVar("traffic_quota_exceeded_txt", $tmp_txt);
319318

@@ -355,6 +354,17 @@ function onShowEnd() {
355354
}
356355
$app->tpl->setVar("domain", $this->dataRecord["domain"]);
357356

357+
// check for configuration errors in sys_datalog
358+
if($this->id > 0) {
359+
$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");
360+
if(is_array($datalog) && !empty($datalog)){
361+
if(trim($datalog['error']) != ''){
362+
$app->tpl->setVar("config_error_msg", nl2br(htmlentities($datalog['error'])));
363+
$app->tpl->setVar("config_error_tstamp", date($app->lng('conf_format_datetime'), $datalog['tstamp']));
364+
}
365+
}
366+
}
367+
358368
parent::onShowEnd();
359369
}
360370

@@ -436,7 +446,7 @@ function onSubmit() {
436446
if($client['limit_perl'] != 'y') $this->dataRecord['perl'] = '-';
437447
if($client['limit_ruby'] != 'y') $this->dataRecord['ruby'] = '-';
438448
if($client['limit_python'] != 'y') $this->dataRecord['python'] = '-';
439-
if($client['force_suexec'] != 'n') $this->dataRecord['suexec'] = 'y';
449+
if($client['force_suexec'] == 'y') $this->dataRecord['suexec'] = 'y';
440450
if($client['limit_hterror'] != 'y') $this->dataRecord['errordocs'] = '-';
441451
if($client['limit_wildcard'] != 'y' && $this->dataRecord['subdomain'] == '*') $this->dataRecord['subdomain'] = '-';
442452
if($client['limit_ssl'] != 'y') $this->dataRecord['ssl'] = '-';
@@ -445,7 +455,7 @@ function onSubmit() {
445455
if($this->id > 0) {
446456
$old_web_values = $app->db->queryOneRecord("SELECT * FROM web_domain WHERE domain_id = ".$app->functions->intval($this->id));
447457
} else {
448-
$old_web_values = $_POST;
458+
$old_web_values = array();
449459
}
450460

451461
//* Check the traffic quota of the client

0 commit comments

Comments
 (0)