Use magic constant dir (#6711)

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__

* use magic constant __DIR__ to load only functions.php

* replace spaces with tab character

* update dirname command to use levels instead of nesting

* use magic constant __DIR__

* update dirname command to use levels instead of nesting

* Update access_control_edit.php

* Update access_control_import.php

* Update access_controls.php

* Update dnd.php

* Update access_controls_reload.php

* Update call_center_agents.php

* Update call_center_agents.php

* Update fax_queue.php

* Update login.php

* Update pdo.php

* Update pdo_vm.php

* Update switch.php

* Update index.php

* Update css.php

* Update v_mailto.php

* Update fax_to_email.php

---------

Co-authored-by: FusionPBX <markjcrane@gmail.com>
This commit is contained in:
frytimo
2023-06-15 14:28:23 -03:00
committed by GitHub
parent 85599c69a0
commit d7bbcd89f5
296 changed files with 350 additions and 1523 deletions

View File

@@ -25,21 +25,16 @@
James Rose <james.o.rose@gmail.com>
*/
$output_type = "file"; //file or console
//file or console
$output_type = "file";
if (defined('STDIN')) {
//get the document root php file must be executed with the full path
$document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]);
$document_root = str_replace("\\", "/", $_SERVER["PHP_SELF"]);
preg_match("/^(.*)\/secure\/.*$/", $document_root, $matches);
$document_root = $matches[1];
//set the include path
set_include_path($document_root);
$_SERVER["DOCUMENT_ROOT"] = $document_root;
//echo "$document_root is document_root\n";
}
//only allow command line
if (!defined('STDIN')) {
exit;
}
$IS_WINDOWS = stristr(PHP_OS, 'WIN') ? true : false;
//determine if windows is true or false
$IS_WINDOWS = stristr(PHP_OS, 'WIN') ? true : false;
if (!function_exists('exec_in_dir')) {
function exec_in_dir($dir, $cmd, &$ok) {
@@ -204,12 +199,8 @@ if (!function_exists('fax_split_dtmf')) {
}
}
//set the include path
$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
set_include_path(parse_ini_file($conf[0])['document.root']);
//includes files
require_once "resources/require.php";
require_once dirname(__DIR__) . "/resources/require.php";
include "resources/classes/event_socket.php";
include "resources/phpmailer/class.phpmailer.php";
include "resources/phpmailer/class.smtp.php"; // optional, gets called from within class.phpmailer.php if not already loaded

View File

@@ -26,11 +26,10 @@
//block directory browsing and send the user to the main index
//set the include path
$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
set_include_path(parse_ini_file($conf[0])['document.root']);
//includes files
require_once dirname(__DIR__) . "/resources/require.php";
//set a redirect
header("Location: ".PROJECT_PATH."/index.php");
header("Location: /core/dashboard/index.php");
?>
?>

View File

@@ -25,17 +25,13 @@
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/
//set the include path
if (defined('STDIN')) {
$conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE);
set_include_path(parse_ini_file($conf[0])['document.root']);
}
else {
//only allow command line
if (!defined('STDIN')) {
exit;
}
//include files
require_once "resources/require.php";
//includes files
require_once dirname(__DIR__) . "/resources/require.php";
//define a function to remove html tags
if (!function_exists('remove_tags')) {