Update dialplan.php

Moving this code back to the way it was.
This commit is contained in:
FusionPBX 2016-07-01 14:04:38 -06:00 committed by GitHub
parent 7c8a3ce788
commit a2f42e6328
1 changed files with 14 additions and 25 deletions

View File

@ -228,32 +228,21 @@ include "root.php";
} }
private function app_uuid_exists() { private function app_uuid_exists() {
if (!isset($_SESSION['app_uuid'][$this->domain_uuid])) { $sql = "select domain_uuid from v_dialplans ";
$sql = "select domain_uuid from v_dialplans "; $sql .= "where (domain_uuid = '".$this->domain_uuid."' or domain_uuid is null) ";
$sql .= "where (domain_uuid = '".$this->domain_uuid."' or domain_uuid is null) "; $sql .= "and app_uuid = '".$this->app_uuid."' ";
//$sql .= "and app_uuid = '".$this->app_uuid."' "; $prep_statement = $this->db->prepare(check_sql($sql));
$prep_statement = $this->db->prepare(check_sql($sql)); if ($prep_statement) {
if ($prep_statement) { $prep_statement->execute();
$prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); if (count($result)) {
foreach ($result as $row) { return true;
if ($row['domain_uuid'] == null) { }
$dialplan_domain = 'global'; else {
} return false;
else {
$dialplan_domain = $row['domain_uuid'];
}
$_SESSION['app_uuid'][$dialplan_domain][$row['app_uuid']] = $row['dialplan_uuid'];
}
} }
unset($sql, $prep_statement, $result);
}
if (isset($_SESSION['app_uuid']['global'][$this->app_uuid]) || isset($_SESSION['app_uuid'][$this->domain_uuid][$this->app_uuid])) {
return true;
}
else {
return false;
} }
unset($sql, $prep_statement, $result);
} }
public function dialplan_exists() { public function dialplan_exists() {
@ -528,4 +517,4 @@ include "root.php";
} }
} }
?> ?>