Skip to content

Commit 21b26d7

Browse files
author
Florian Schaal
committed
2 parents fb1cba0 + b4f3f51 commit 21b26d7

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

interface/web/mail/mail_transport_edit.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,22 @@ function onShowNew() {
7070
function onShowEnd() {
7171
global $app, $conf;
7272

73+
$types = array('smtp' => 'smtp', 'uucp' => 'uucp', 'slow' => 'slow', 'error' => 'error', 'custom' => 'custom', '' => 'null');
7374
$tmp_parts = explode(":", $this->dataRecord["transport"]);
7475
if(!empty($this->id) && !stristr($this->dataRecord["transport"], ':')) {
7576
$rec["type"] = 'custom';
7677
} else {
7778
if(empty($this->id) && empty($tmp_parts[0])) {
7879
$rec["type"] = 'smtp';
7980
} else {
80-
$rec["type"] = $tmp_parts[0];
81+
$rec["type"] = $types[$tmp_parts[0]] ? $tmp_parts[0] : 'custom';
8182
}
8283
}
83-
if(!empty($tmp_parts[2])) {
84+
if($rec["type"] == 'custom') {
85+
$dest = $this->dataRecord["transport"];
86+
} elseif(!empty($tmp_parts[2])) {
8487
$dest = @$tmp_parts[1].':'.@$tmp_parts[2];
85-
} elseif(!empty($tmp_parts[1])) {
88+
} elseif(!empty($tmp_parts[1]) || $this->dataRecord["transport"] == ":") {
8689
$dest = $tmp_parts[1];
8790
} else {
8891
$dest = $this->dataRecord["transport"];
@@ -95,7 +98,6 @@ function onShowEnd() {
9598
$rec["destination"] = @$dest;
9699
}
97100

98-
$types = array('smtp' => 'smtp', 'uucp' => 'uucp', 'slow' => 'slow', 'error' => 'error', 'custom' => 'custom', '' => 'null');
99101
$type_select = '';
100102
if(is_array($types)) {
101103
foreach( $types as $key => $val) {

interface/web/sites/web_vhost_domain_edit.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,13 @@ function onShowEnd() {
458458
}
459459
$server_id = intval(@$this->dataRecord["server_id"]);
460460
} else {
461-
// Get the first server ID
462-
$tmp = $app->db->queryOneRecord("SELECT server_id FROM server WHERE web_server = 1 ORDER BY server_name LIMIT 0,1");
463-
$server_id = intval($tmp['server_id']);
461+
$settings = $app->getconf->get_global_config('sites');
462+
$server_id = intval($settings['default_webserver']);
463+
if (!$server_id) {
464+
// Get the first server ID
465+
$tmp = $app->db->queryOneRecord("SELECT server_id FROM server WHERE web_server = 1 ORDER BY server_name LIMIT 0,1");
466+
$server_id = intval($tmp['server_id']);
467+
}
464468
}
465469

466470
//* get global web config

0 commit comments

Comments
 (0)