mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-03-27 10:45:44 +00:00
Prevent duplicate domain names
This commit is contained in:
@@ -105,6 +105,21 @@
|
||||
$msg = '';
|
||||
if (empty($domain_name)) { $msg .= $text['message-required'].$text['label-name']."<br>\n"; }
|
||||
//if (empty($domain_description)) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; }
|
||||
|
||||
//check for a duplicate domain name
|
||||
if ($action == 'add') {
|
||||
$sql = "select count(*) from v_domains ";
|
||||
$sql .= "where domain_name = :domain_name ";
|
||||
$sql .= "and destination_type = 'inbound' ";
|
||||
$parameters['domain_name'] = $domain_name;
|
||||
$num_rows = $database->select($sql, $parameters, 'column');
|
||||
if ($num_rows > 0) {
|
||||
$msg .= $text['message-duplicate']."<br>\n";
|
||||
}
|
||||
unset($sql, $parameters, $num_rows);
|
||||
}
|
||||
|
||||
//show the message if it's not empty
|
||||
if (!empty($msg) && empty($_POST["persistformvar"])) {
|
||||
require_once "resources/header.php";
|
||||
require_once "resources/persist_form_var.php";
|
||||
|
||||
Reference in New Issue
Block a user