From 027290225b9a5b841142579cd2921462dc73959d Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Fri, 24 Jun 2016 16:37:41 +0300 Subject: [PATCH] relative path support --- web/inc/main.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/web/inc/main.php b/web/inc/main.php index b3453dce..51e3afbf 100644 --- a/web/inc/main.php +++ b/web/inc/main.php @@ -1,7 +1,11 @@ 0 ) { header("Location: /error/"); @@ -89,7 +88,7 @@ function check_error($return_var) { } function check_return_code($return_var,$output) { - if ($return_var != 0) { + if ($return_var != 0) { $error = implode('
', $output); if (empty($error)) $error = __('Error code:',$return_var); $_SESSION['error_msg'] = $error; @@ -107,9 +106,9 @@ function top_panel($user, $TAB) { $panel = json_decode(implode('', $output), true); unset($output); if ( $user == 'admin' ) { - include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/panel.html'); + include(dirname(__FILE__).'/../templates/admin/panel.html'); } else { - include($_SERVER['DOCUMENT_ROOT'].'/templates/user/panel.html'); + include(dirname(__FILE__).'/../templates/user/panel.html'); } }