From eec73dfc482d2a46f2fbf333f3ea166d88ed9b8d Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sun, 18 Nov 2012 06:32:01 +0000 Subject: [PATCH] Fix single tenant music on hold. --- app/music_on_hold/music_on_hold.php | 1 - .../resources/classes/switch_music_on_hold.php | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/music_on_hold/music_on_hold.php b/app/music_on_hold/music_on_hold.php index 4709f17055..1af4c9b479 100644 --- a/app/music_on_hold/music_on_hold.php +++ b/app/music_on_hold/music_on_hold.php @@ -50,7 +50,6 @@ if ($_GET['a'] == "download") { if ($category_dir != '') { $path_mod = $category_dir."/"; - if (count($_SESSION['domains']) > 1) { $path_mod = $_SESSION["domain_name"]."/".$path_mod; } diff --git a/app/music_on_hold/resources/classes/switch_music_on_hold.php b/app/music_on_hold/resources/classes/switch_music_on_hold.php index 074df51512..f78fa6560b 100644 --- a/app/music_on_hold/resources/classes/switch_music_on_hold.php +++ b/app/music_on_hold/resources/classes/switch_music_on_hold.php @@ -106,8 +106,12 @@ include "root.php"; //default category $array = glob($music_on_hold_dir."/{8000,16000,32000,48000}", GLOB_ONLYDIR|GLOB_BRACE); //other categories - //$array = array_merge($array, glob($music_on_hold_dir."/*/*", GLOB_ONLYDIR)); - $array = array_merge($array, glob($music_on_hold_dir."/*/*/*", GLOB_ONLYDIR)); + if (count($_SESSION['domains']) > 1) { + $array = array_merge($array, glob($music_on_hold_dir."/*/*/*", GLOB_ONLYDIR)); + } + else { + $array = array_merge($array, glob($music_on_hold_dir."/*/*", GLOB_ONLYDIR)); + } //list the categories $moh_xml = ""; foreach($array as $moh_dir) {