From 1bc88766ab173dc47b08413ecf4ba5003275cda0 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Sat, 3 May 2014 00:49:11 +0000 Subject: [PATCH] Fix issue 591 where the dialplan xml file was not including the dialplan directory --- app/dialplan/app_defaults.php | 6 +++--- resources/classes/install.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/dialplan/app_defaults.php b/app/dialplan/app_defaults.php index 909cfd57d6..b98fab15ac 100644 --- a/app/dialplan/app_defaults.php +++ b/app/dialplan/app_defaults.php @@ -63,12 +63,12 @@ //prepare the file contents and the path //replace the variables in the template in the future loop through all the line numbers to do a replace for each possible line number - $file_default_contents = str_replace("{v_domain}", $_SESSION['context'], $file_default_contents); + $file_default_contents = str_replace("{v_domain}", $context, $file_default_contents); //set the file path - $file_path = $_SESSION['switch']['conf']['dir'].'/dialplan/'.$_SESSION['context'].'.xml'; + $file_path = $_SESSION['switch']['conf']['dir'].'/dialplan/'.$context.'.xml'; //write the default dialplan - if (strlen($_SESSION['context']) > 0) { + if (!file_exists($file_path)) { $fh = fopen($file_path,'w') or die('Unable to write to '.$file_path.'. Make sure the path exists and permissions are set correctly.'); fwrite($fh, $file_default_contents); fclose($fh); diff --git a/resources/classes/install.php b/resources/classes/install.php index f0a87f13aa..455838a3d4 100644 --- a/resources/classes/install.php +++ b/resources/classes/install.php @@ -44,7 +44,7 @@ include "root.php"; } if (!is_dir($dst)) { if (!mkdir($dst, 0755, true)) { - //throw new Exception("recursive_copy() failed to create destination directory '".$dst."'"); + throw new Exception("recursive_copy() failed to create destination directory '".$dst."'"); } } while(false !== ($file = readdir($dir))) {