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.
This commit is contained in:
FusionPBX 2023-05-21 10:58:05 -06:00 committed by GitHub
parent 67e77560a6
commit c6e3fd381b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

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-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')) {