Replace the DOCUMENT_ROOT and PROJECT_ROOT variables

Use the __DIR__ constant and dirname as needed
This commit is contained in:
FusionPBX
2025-12-08 14:12:19 -07:00
committed by GitHub
parent df90513f86
commit 6b063f2c28
84 changed files with 217 additions and 210 deletions

View File

@@ -101,7 +101,7 @@ class plugin_email {
//initialize a template object
$view = new template();
$view->engine = 'smarty';
$view->template_dir = $_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . '/core/authentication/resources/views/';
$view->template_dir = dirname(__DIR__, 5) . '/core/authentication/resources/views/';
$view->cache_dir = sys_get_temp_dir();
$view->init();
@@ -335,7 +335,7 @@ class plugin_email {
//initialize a template object
$view = new template();
$view->engine = 'smarty';
$view->template_dir = $_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . '/core/authentication/resources/views/';
$view->template_dir = dirname(__DIR__, 5) . '/core/authentication/resources/views/';
$view->cache_dir = sys_get_temp_dir();
$view->init();
@@ -416,7 +416,7 @@ class plugin_email {
unset($_POST['authentication_code']);
//check if contacts app exists
$contacts_exists = file_exists($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . '/core/contacts/') ? true : false;
$contacts_exists = file_exists(dirname(__DIR__, 5) . '/core/contacts/') ? true : false;
//get the user details
if ($auth_valid) {