Skip to content

Commit 77d6c59

Browse files
author
Thom Pol
committed
Move relay check to logical place (#6088)
1 parent 5691d4d commit 77d6c59

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

interface/web/mail/mail_domain_edit.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -190,23 +190,6 @@ function onShowEnd() {
190190
$app->tpl->setVar("domain_module", 0);
191191
}
192192

193-
// Check wether per domain relaying is enabled or not
194-
$global_config = $app->getconf->get_global_config('mail');
195-
if($global_config['show_per_domain_relay_options'] == 'y') {
196-
$app->tpl->setVar("show_per_domain_relay_options", 1);
197-
} else {
198-
$app->tpl->setVar("show_per_domain_relay_options", 0);
199-
}
200-
201-
// Get the limits of the client
202-
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
203-
$client = $app->db->queryOneRecord("SELECT limit_relayhost FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
204-
if ($client["limit_relayhost"] == 'y' || $_SESSION["s"]["user"]["typ"] == 'admin') {
205-
$app->tpl->setVar("limit_relayhost", 1);
206-
} else {
207-
$app->tpl->setVar("limit_relayhost", 0);
208-
}
209-
210193
// Get the spamfilter policys for the user
211194
$tmp_user = $app->db->queryOneRecord("SELECT policy_id FROM spamfilter_users WHERE email = ?", '@' . $this->dataRecord["domain"]);
212195
$sql = "SELECT id, policy_name FROM spamfilter_policy WHERE ".$app->tform->getAuthSQL('r')." ORDER BY policy_name";
@@ -231,6 +214,23 @@ function onShowEnd() {
231214
$app->tpl->setVar("edit_disabled", 0);
232215
}
233216

217+
// Check wether per domain relaying is enabled or not
218+
$global_config = $app->getconf->get_global_config('mail');
219+
if($global_config['show_per_domain_relay_options'] == 'y') {
220+
$app->tpl->setVar("show_per_domain_relay_options", 1);
221+
} else {
222+
$app->tpl->setVar("show_per_domain_relay_options", 0);
223+
}
224+
225+
// Get the limits of the client
226+
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);
227+
$client = $app->db->queryOneRecord("SELECT limit_relayhost FROM sys_group, client WHERE sys_group.client_id = client.client_id and sys_group.groupid = ?", $client_group_id);
228+
if ($client["limit_relayhost"] == 'y' || $_SESSION["s"]["user"]["typ"] == 'admin') {
229+
$app->tpl->setVar("limit_relayhost", 1);
230+
} else {
231+
$app->tpl->setVar("limit_relayhost", 0);
232+
}
233+
234234
// load relayhost-values
235235
if ($client["limit_relayhost"] == 'y') {
236236
$sql = "SELECT relay_host, relay_user, relay_pass FROM mail_domain WHERE domain_id = ?";

0 commit comments

Comments
 (0)