diff --git a/app/dialplan/resources/classes/dialplan.php b/app/dialplan/resources/classes/dialplan.php index 5a0f001902..fd44339d66 100644 --- a/app/dialplan/resources/classes/dialplan.php +++ b/app/dialplan/resources/classes/dialplan.php @@ -228,32 +228,21 @@ include "root.php"; } private function app_uuid_exists() { - if (!isset($_SESSION['app_uuid'][$this->domain_uuid])) { - $sql = "select domain_uuid from v_dialplans "; - $sql .= "where (domain_uuid = '".$this->domain_uuid."' or domain_uuid is null) "; - //$sql .= "and app_uuid = '".$this->app_uuid."' "; - $prep_statement = $this->db->prepare(check_sql($sql)); - if ($prep_statement) { - $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); - foreach ($result as $row) { - if ($row['domain_uuid'] == null) { - $dialplan_domain = 'global'; - } - else { - $dialplan_domain = $row['domain_uuid']; - } - $_SESSION['app_uuid'][$dialplan_domain][$row['app_uuid']] = $row['dialplan_uuid']; - } + $sql = "select domain_uuid from v_dialplans "; + $sql .= "where (domain_uuid = '".$this->domain_uuid."' or domain_uuid is null) "; + $sql .= "and app_uuid = '".$this->app_uuid."' "; + $prep_statement = $this->db->prepare(check_sql($sql)); + if ($prep_statement) { + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); + if (count($result)) { + return true; + } + else { + return false; } - 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() { @@ -528,4 +517,4 @@ include "root.php"; } } -?> \ No newline at end of file +?>