save the file when the context session has a value

This commit is contained in:
Mark Crane
2014-04-15 06:55:48 +00:00
parent f8870d204c
commit c6c9b25cc5

View File

@@ -17,7 +17,7 @@
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
Portions created by the Initial Developer are Copyright (C) 2008-2014
the Initial Developer. All Rights Reserved.
Contributor(s):
@@ -68,9 +68,11 @@
$file_path = $_SESSION['switch']['conf']['dir'].'/dialplan/'.$_SESSION['context'].'.xml';
//write the default dialplan
$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);
if (strlen($_SESSION['context']) > 0) {
$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);
}
}
//get the $apps array from the installed apps from the core and mod directories