Skip to content

Commit 996e3a9

Browse files
author
Till Brehm
committed
Merge branch '6489-mail_domain_uniqueue' into 'develop'
Extend uniqueness check to be per server for a mail_domain Closes #6489 See merge request ispconfig/ispconfig3!1969
2 parents 9208160 + d7cc7c0 commit 996e3a9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

interface/web/mail/form/mail_domain.tform.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@
8787
),
8888
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
8989
'errmsg'=> 'domain_error_empty'),
90-
1 => array ( 'type' => 'UNIQUE',
91-
'errmsg'=> 'domain_error_unique'),
92-
2 => array ( 'type' => 'ISDOMAIN',
90+
1 => array ( 'type' => 'ISDOMAIN',
9391
'errmsg'=> 'domain_error_regex'),
9492
),
9593
'default' => '',

interface/web/mail/mail_domain_edit.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,12 @@ function onSubmit() {
295295
}
296296
}
297297

298+
// Check uniqueness per server.
299+
$tmp = $app->db->queryOneRecord("SELECT domain_id FROM mail_domain WHERE domain = ? AND server_id = ? AND domain_id != ?", $this->dataRecord['domain'], $this->dataRecord['server_id'], $this->id);
300+
if (!empty($tmp)) {
301+
$app->tform->errorMessage .= $app->tform->lng("domain_error_unique")."<br />";
302+
}
303+
298304
if($_SESSION["s"]["user"]["typ"] != 'admin') {
299305
// Get the limits of the client
300306
$client_group_id = $app->functions->intval($_SESSION["s"]["user"]["default_group"]);

0 commit comments

Comments
 (0)