Skip to content

Commit cd029fa

Browse files
author
Thom Pol
committed
Don't remove current value if client does not have rights to see/change relayhost settings
1 parent 77d6c59 commit cd029fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

interface/web/mail/mail_domain_edit.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,14 @@ function onSubmit() {
285285
// When the record is updated
286286
if($this->id > 0) {
287287
// restore the server ID if the user is not admin and record is edited
288-
$tmp = $app->db->queryOneRecord("SELECT server_id FROM mail_domain WHERE domain_id = ?", $this->id);
288+
$tmp = $app->db->queryOneRecord("SELECT server_id, relay_host, relay_user, relay_pass FROM mail_domain WHERE domain_id = ?", $this->id);
289289
$this->dataRecord["server_id"] = $tmp["server_id"];
290+
291+
// set the settings to current if not provided (or cleared due to limits)
292+
if($this->dataRecord['relay_host'] == '') $this->dataRecord['relay_host'] = $tmp['relay_host'];
293+
if($this->dataRecord['relay_user'] == '') $this->dataRecord['relay_user'] = $tmp['relay_user'];
294+
if($this->dataRecord['relay_pass'] == '') $this->dataRecord['relay_pass'] = $tmp['relay_pass'];
295+
290296
unset($tmp);
291297
// When the record is inserted
292298
} else {

0 commit comments

Comments
 (0)