From b231e0ff849a167751c603bbb2e7bcbc341410b2 Mon Sep 17 00:00:00 2001 From: mafoo Date: Thu, 4 Feb 2016 16:19:27 +0000 Subject: [PATCH 1/4] made it possible to find phrases fixed string replace not taking out spaces aswell --- app/ivr_menus/ivr_menu_edit.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/app/ivr_menus/ivr_menu_edit.php b/app/ivr_menus/ivr_menu_edit.php index 01ebdf7c0e..a1abb509f9 100644 --- a/app/ivr_menus/ivr_menu_edit.php +++ b/app/ivr_menus/ivr_menu_edit.php @@ -644,14 +644,28 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $ivr_menu_option_param = $field['ivr_menu_option_action']; } $ivr_menu_option_param = str_replace("menu-", "", $ivr_menu_option_param); - $ivr_menu_option_param = str_replace("XML", "", $ivr_menu_option_param); - $ivr_menu_option_param = str_replace("transfer", "", $ivr_menu_option_param); - $ivr_menu_option_param = str_replace("bridge", "", $ivr_menu_option_param); + $ivr_menu_option_param = str_replace("XML ", "", $ivr_menu_option_param); + $ivr_menu_option_param = str_replace("transfer ", "", $ivr_menu_option_param); + $ivr_menu_option_param = str_replace("bridge ", "", $ivr_menu_option_param); $ivr_menu_option_param = str_replace($_SESSION['domain_name'], "", $ivr_menu_option_param); $ivr_menu_option_param = str_replace("\${domain_name}", "", $ivr_menu_option_param); $ivr_menu_option_param = str_replace("\${domain}", "", $ivr_menu_option_param); $ivr_menu_option_param = str_replace(".".$_SESSION['domain_uuid'], "", $ivr_menu_option_param); $ivr_menu_option_param = str_replace("//", "/", $ivr_menu_option_param); + if (preg_match( "/^phrase /", $ivr_menu_option_param )) { + // parse out phrase uuid + $phrase_uuid = str_replace("phrase ", "", $ivr_menu_option_param); + // retrieve phrase name from db + $sql = "select phrase_name from v_phrases where phrase_uuid = '$phrase_uuid' limit 1"; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + if (count($result) > 0) { + $phrase_name = $result[0]['phrase_name']; + $ivr_menu_option_param = "phrase: $phrase_name"; + } + unset ($prep_statement, $sql, $phrase_uuid, $phrase_name); + } //$ivr_menu_option_param = ucfirst(trim($ivr_menu_option_param)); echo " \n"; echo " \n"; From 71a0fa12fa0d3600b78d0df3ba0520d6f4564667 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Thu, 4 Feb 2016 23:18:48 -0700 Subject: [PATCH 2/4] Switch settings are not always needed so removing the "throw new Exception" --- core/install/resources/classes/global_settings.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/install/resources/classes/global_settings.php b/core/install/resources/classes/global_settings.php index 00f181a41d..24d980d912 100644 --- a/core/install/resources/classes/global_settings.php +++ b/core/install/resources/classes/global_settings.php @@ -132,9 +132,6 @@ require_once "root.php"; sort( $this->_switch_vdirs ); if(is_null($detect_switch)){ //take settings from session - if(!isset($_SESSION['switch'])){ - throw new Exception("No detect_switch was passed to me but \$_SESSION['switch'] is empty!"); - } foreach ($this->_switch_dirs as $dir){ $category = 'switch'; $session_var; From b4f9a1308e54e70531a4e93d60ceeade957aac23 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Thu, 4 Feb 2016 23:28:23 -0700 Subject: [PATCH 3/4] Hide memcache on the system status page if FreeSWITCH is not installed. --- app/system/system.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/system/system.php b/app/system/system.php index 0e394b0bbc..648d86e719 100644 --- a/app/system/system.php +++ b/app/system/system.php @@ -372,8 +372,7 @@ $document['title'] = $text['title-sys-status']; } //memcache information - if (permission_exists('system_view_memcache')) { - + if (if_group("system_view_memcache") && file_exists($_SERVER["PROJECT_ROOT"]."/app/sip_status/app_config.php")){ echo "\n"; echo " \n"; echo " \n"; @@ -418,7 +417,6 @@ $document['title'] = $text['title-sys-status']; echo "
".$text['title-memcache']."
\n"; echo "

\n"; - } //backup From 7bcb324e58c174a7ca7b3fe7b34ee0050af7359c Mon Sep 17 00:00:00 2001 From: markjcrane Date: Thu, 4 Feb 2016 23:39:08 -0700 Subject: [PATCH 4/4] Fix a minor mistake. --- app/system/system.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/system/system.php b/app/system/system.php index 648d86e719..075ae9096c 100644 --- a/app/system/system.php +++ b/app/system/system.php @@ -372,7 +372,7 @@ $document['title'] = $text['title-sys-status']; } //memcache information - if (if_group("system_view_memcache") && file_exists($_SERVER["PROJECT_ROOT"]."/app/sip_status/app_config.php")){ + if (permission_exists("system_view_memcache") && file_exists($_SERVER["PROJECT_ROOT"]."/app/sip_status/app_config.php")){ echo "\n"; echo " \n"; echo " \n";
".$text['title-memcache']."