[Web] Do not allow to create a domain where domain = mailcow_hostname

This commit is contained in:
andryyy
2018-05-03 22:42:31 +02:00
parent a0d2e34433
commit e69b6db877
3 changed files with 9 additions and 0 deletions

View File

@@ -402,6 +402,13 @@ function mailbox($_action, $_type, $_data = null, $attr = null) {
);
return false;
}
if ($domain == $MAILCOW_HOSTNAME) {
$_SESSION['return'] = array(
'type' => 'danger',
'msg' => sprintf($lang['danger']['domain_matches_hostname'], htmlspecialchars($domain))
);
return false;
}
try {
$stmt = $pdo->prepare("INSERT INTO `domain` (`domain`, `description`, `aliases`, `mailboxes`, `maxquota`, `quota`, `backupmx`, `active`, `relay_all_recipients`)
VALUES (:domain, :description, :aliases, :mailboxes, :maxquota, :quota, :backupmx, :active, :relay_all_recipients)");