Skip to content

Commit 0272902

Browse files
committed
relative path support
1 parent 7fefa20 commit 0272902

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

web/inc/main.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?php
2+
23
session_start();
34

4-
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n.php');
5+
define('VESTA_CMD', '/usr/bin/sudo /usr/local/vesta/bin/');
6+
$i = 0;
7+
8+
require_once(dirname(__FILE__).'/i18n.php');
59

610
// Check system settings
711
if ((!isset($_SESSION['VERSION'])) && (!defined('NO_AUTH_REQUIRED'))) {
@@ -25,10 +29,6 @@
2529
}
2630
}
2731

28-
define('VESTA_CMD', '/usr/bin/sudo /usr/local/vesta/bin/');
29-
30-
$i = 0;
31-
3232
if (isset($_SESSION['language'])) {
3333
switch ($_SESSION['language']) {
3434
case 'ro':
@@ -80,7 +80,6 @@ function get_favourites(){
8080
}
8181

8282

83-
8483
function check_error($return_var) {
8584
if ( $return_var > 0 ) {
8685
header("Location: /error/");
@@ -89,7 +88,7 @@ function check_error($return_var) {
8988
}
9089

9190
function check_return_code($return_var,$output) {
92-
if ($return_var != 0) {
91+
if ($return_var != 0) {
9392
$error = implode('<br>', $output);
9493
if (empty($error)) $error = __('Error code:',$return_var);
9594
$_SESSION['error_msg'] = $error;
@@ -107,9 +106,9 @@ function top_panel($user, $TAB) {
107106
$panel = json_decode(implode('', $output), true);
108107
unset($output);
109108
if ( $user == 'admin' ) {
110-
include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/panel.html');
109+
include(dirname(__FILE__).'/../templates/admin/panel.html');
111110
} else {
112-
include($_SERVER['DOCUMENT_ROOT'].'/templates/user/panel.html');
111+
include(dirname(__FILE__).'/../templates/user/panel.html');
113112
}
114113
}
115114

0 commit comments

Comments
 (0)