diff --git a/app/errors/app_config.php b/app/errors/app_config.php deleted file mode 100644 index 928fe43483..0000000000 --- a/app/errors/app_config.php +++ /dev/null @@ -1,50 +0,0 @@ - \ No newline at end of file diff --git a/app/errors/app_languages.php b/app/errors/app_languages.php deleted file mode 100644 index aed6e8ef69..0000000000 --- a/app/errors/app_languages.php +++ /dev/null @@ -1,298 +0,0 @@ - \ No newline at end of file diff --git a/app/errors/app_menu.php b/app/errors/app_menu.php deleted file mode 100644 index c475a2758c..0000000000 --- a/app/errors/app_menu.php +++ /dev/null @@ -1,29 +0,0 @@ - \ No newline at end of file diff --git a/app/errors/errors.php b/app/errors/errors.php deleted file mode 100644 index c29380cbb0..0000000000 --- a/app/errors/errors.php +++ /dev/null @@ -1,148 +0,0 @@ - - Portions created by the Initial Developer are Copyright (C) 2008-2020 - the Initial Developer. All Rights Reserved. - - Contributor(s): - Mark J Crane -*/ - -//includes - require_once "root.php"; - require_once "resources/require.php"; - require_once "resources/check_auth.php"; - -//check permissions - if (!permission_exists('errors_view')) { - echo "access denied"; - exit; - } - -//add multi-lingual support - $language = new text; - $text = $language->get(); - -//set defaults - if (!is_numeric($_POST['line_number'])) { $_POST['line_number'] = 0; } - if ($_POST['sort'] != 'asc' && $_POST['sort'] != 'desc') { $_POST['sort'] = 'asc'; } - if (!is_numeric($_POST['lines'])) { $_POST['lines'] = '10'; } - -//include the header - $document['title'] = $text['title-server_errors']; - require_once "resources/header.php"; - -//show the content - $error_file = $_SESSION['server']['error']['text'].($_POST['log'] == 'previous' ? '.1' : null); - if (file_exists($error_file)) { - - //colored lines - $x = 0; - $filters[$x]['pattern'] = '[error]'; - $filters[$x]['color'] = '#cc0000'; - $x++; - $filters[$x]['pattern'] = '[crit]'; - $filters[$x]['color'] = 'gold'; - - $file_lines = file($error_file, FILE_SKIP_EMPTY_LINES); - - echo "
\n"; - echo "
".$text['header-server_errors']."
\n"; - echo "
\n"; - echo "
\n"; - echo " ".$text['label-log']; - echo " \n"; - echo $text['label-filter']." "; - echo ""; - echo ""; - echo $text['label-display']." : ".count($file_lines)." ".$text['label-lines']; - echo button::create(['type'=>'submit','label'=>$text['button-reload'],'icon'=>$_SESSION['theme']['button_icon_reload'],'style'=>'margin-left: 15px;','name'=>'submit']); - echo "
\n"; - echo "
\n"; - echo "
\n"; - echo "
\n"; - - echo "
\n"; - - if (is_array($file_lines) && sizeof($file_lines) > 0) { - echo "\n"; - if ($_POST['filter'] != '') { - foreach ($file_lines as $index => $line) { - if (strpos($line, $_POST['filter']) == false) { - unset($file_lines[$index]); - } - } - } - if (is_numeric($_POST['lines']) && $_POST['lines'] > 0) { - $file_lines = array_slice($file_lines, -$_POST['lines'], $_POST['lines'], true); - } - if ($_POST['sort'] == 'desc') { - $file_lines = array_reverse($file_lines, true); - } - foreach ($file_lines as $index => $line) { - foreach ($filters as $filter) { - $pos = strpos($line, $filter['pattern']); - if ($pos !== false){ - $filter_beg = ""; - $line = str_replace($_POST['filter'],"".$_POST['filter']."", $line); - $filter_end = ""; - } - } - if ($_POST['line_number']) { - $line_num = "".($index + 1)."   "; - } - echo $line_num." ".$filter_beg.$line.$filter_end."

"; - } - echo "
\n"; - } - else { - echo "

[ EMPTY FILE ]

"; - } - - echo " \n"; - echo "
\n"; - - } - else { - if ($_SESSION['server']['error']['text'] != '') { - echo "Server error log file not found at: ".$_SESSION['server']['error']['text']; - } - else { - echo "Server error log file path not defined in Settings."; - } - } - -// scroll to bottom of displayed lines, when appropriate - if ($_POST['sort'] != 'desc') { - echo "\n"; - } - -//include the footer - require_once "resources/footer.php"; - -?> \ No newline at end of file diff --git a/app/errors/root.php b/app/errors/root.php deleted file mode 100644 index 6fdf32f37b..0000000000 --- a/app/errors/root.php +++ /dev/null @@ -1,90 +0,0 @@ - - Portions created by the Initial Developer are Copyright (C) 2008-2012 - the Initial Developer. All Rights Reserved. - - Contributor(s): - Mark J Crane -*/ - -// make sure the PATH_SEPARATOR is defined - umask(2); - if (!defined("PATH_SEPARATOR")) { - if (strpos($_ENV["OS"], "Win") !== false) { - define("PATH_SEPARATOR", ";"); - } else { - define("PATH_SEPARATOR", ":"); - } - } - - if (!isset($output_format)) $output_format = (PHP_SAPI == 'cli') ? 'text' : 'html'; - - // make sure the document_root is set - $_SERVER["SCRIPT_FILENAME"] = str_replace("\\", '/', $_SERVER["SCRIPT_FILENAME"]); - if(PHP_SAPI == 'cli'){ - chdir(pathinfo(realpath($_SERVER["PHP_SELF"]), PATHINFO_DIRNAME)); - $script_full_path = str_replace("\\", '/', getcwd() . '/' . $_SERVER["SCRIPT_FILENAME"]); - $dirs = explode('/', pathinfo($script_full_path, PATHINFO_DIRNAME)); - if (file_exists('/project_root.php')) { - $path = '/'; - } else { - $i = 1; - $path = ''; - while ($i < count($dirs)) { - $path .= '/' . $dirs[$i]; - if (file_exists($path. '/project_root.php')) { - break; - } - $i++; - } - } - $_SERVER["DOCUMENT_ROOT"] = $path; - }else{ - $_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]); - } - $_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]); -// try to detect if a project path is being used - if (!defined('PROJECT_PATH')) { - if (is_dir($_SERVER["DOCUMENT_ROOT"]. '/fusionpbx')) { - define('PROJECT_PATH', '/fusionpbx'); - } elseif (file_exists($_SERVER["DOCUMENT_ROOT"]. '/project_root.php')) { - define('PROJECT_PATH', ''); - } else { - $dirs = explode('/', str_replace('\\', '/', pathinfo($_SERVER["PHP_SELF"], PATHINFO_DIRNAME))); - $i = 1; - $path = $_SERVER["DOCUMENT_ROOT"]; - while ($i < count($dirs)) { - $path .= '/' . $dirs[$i]; - if (file_exists($path. '/project_root.php')) { - break; - } - $i++; - } - if(!file_exists($path. '/project_root.php')){ - die("Failed to locate the Project Root by searching for project_root.php please contact support for assistance"); - } - $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); - define('PROJECT_PATH', $project_path); - } - $_SERVER["PROJECT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH); - set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER["PROJECT_ROOT"]); - } - -?> \ No newline at end of file