Update extension.php
This commit is contained in:
parent
b9ee3c816f
commit
b0429f15b5
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Copyright (C) 2010 - 2014
|
Copyright (C) 2010 - 2016
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
|
|
@ -82,6 +82,20 @@ if (!class_exists('extension')) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function exists($extension) {
|
||||||
|
$sql = "select extension_uuid from v_extensions ";
|
||||||
|
$sql .= "where domain_uuid = '".$this->domain_uuid."' ";
|
||||||
|
$sql .= "and (extension = '$extension' or number_alias = '$extension') ";
|
||||||
|
$sql .= "and enabled = 'true' ";
|
||||||
|
$result = $this->db->query($sql)->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
if (count($result) > 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function get_domain_uuid() {
|
public function get_domain_uuid() {
|
||||||
return $this->domain_uuid;
|
return $this->domain_uuid;
|
||||||
}
|
}
|
||||||
|
|
@ -504,18 +518,6 @@ if (!class_exists('extension')) {
|
||||||
$_SESSION["reload_xml"] = true;
|
$_SESSION["reload_xml"] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true if domain:extension already exists
|
|
||||||
public function exists($domain_uuid, $extension) {
|
|
||||||
$sql = "select * from v_extensions where domain_uuid = '".$domain_uuid."' ";
|
|
||||||
$sql .= "and extension='".$extension."'";
|
|
||||||
|
|
||||||
$prep_statement = $this->db->prepare(check_sql($sql));
|
|
||||||
$prep_statement->execute();
|
|
||||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
|
||||||
|
|
||||||
return count($result) != 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue