From c6e3fd381ba0bd6c4020ce42c6e50eaf8ce6c0e7 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 21 May 2023 10:58:05 -0600 Subject: [PATCH] Update scripts dir session variable as it was not set in the install This would break the install and prevent the scripts getting copied to the right location. That had a chain reaction of breaking multiple additional things. --- app/scripts/resources/classes/scripts.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/scripts/resources/classes/scripts.php b/app/scripts/resources/classes/scripts.php index 8819b490cb..df0e24760f 100644 --- a/app/scripts/resources/classes/scripts.php +++ b/app/scripts/resources/classes/scripts.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2020 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -85,8 +85,13 @@ if (!class_exists('scripts')) { * Copy the switch scripts from the web directory to the switch directory */ public function copy_files() { - if (!empty($_SESSION['switch']['scripts'])) { - $destination_directory = $_SESSION['switch']['scripts']['dir']; + + //read the config.conf settings + $config_glob = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE); + $conf = parse_ini_file($config_glob[0]); + + if (!empty($conf['switch.scripts.dir'])) { + $destination_directory = $conf['switch.scripts.dir']; if ($destination_directory != '' && file_exists($destination_directory)) { //get the source directory if (file_exists('/usr/share/examples/fusionpbx/scripts')) {