Update the include handling.
This commit is contained in:
parent
b300961d75
commit
b8e8c726be
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Portions created by the Initial Developer are Copyright (C) 2016-2021
|
Portions created by the Initial Developer are Copyright (C) 2016-2022
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
|
|
@ -26,22 +26,17 @@
|
||||||
|
|
||||||
//check the permission
|
//check the permission
|
||||||
if(defined('STDIN')) {
|
if(defined('STDIN')) {
|
||||||
$document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]);
|
|
||||||
preg_match("/^(.*)\/app\/.*$/", $document_root, $matches);
|
|
||||||
$document_root = $matches[1];
|
|
||||||
set_include_path($document_root);
|
|
||||||
$_SERVER["DOCUMENT_ROOT"] = $document_root;
|
|
||||||
require_once "resources/require.php";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//set the include path
|
//set the include path
|
||||||
$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
|
$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
|
||||||
set_include_path(parse_ini_file($conf[0])['document.root']);
|
set_include_path(parse_ini_file($conf[0])['document.root']);
|
||||||
|
|
||||||
//includes files
|
|
||||||
require_once "resources/require.php";
|
|
||||||
require_once "resources/pdo.php";
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
//includes files
|
||||||
|
require_once "resources/require.php";
|
||||||
|
require_once "resources/pdo.php";
|
||||||
|
|
||||||
//check the domain cidr range
|
//check the domain cidr range
|
||||||
if (isset($_SESSION['cdr']["cidr"]) && !defined('STDIN')) {
|
if (isset($_SESSION['cdr']["cidr"]) && !defined('STDIN')) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue