Skip to content

Commit

Permalink
Set and use real admin path (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
remrem authored and BoboTiG committed Jan 24, 2017
1 parent 81b793a commit 88b3a87
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion admin/addon-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// dependancy
require_once BT_ROOT.'inc/addons.php';
require_once BT_ROOT.'admin/inc/addons.php';
require_once BT_ROOT_ADMIN.'inc/addons.php';


/**
Expand Down
2 changes: 1 addition & 1 deletion admin/addons.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// dependancy
require_once BT_ROOT.'inc/addons.php';
require_once BT_ROOT.'admin/inc/addons.php';
require_once BT_ROOT_ADMIN.'inc/addons.php';


/**
Expand Down
13 changes: 7 additions & 6 deletions admin/inc/boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
# You can redistribute it under the terms of the MIT / X11 Licence.
# *** LICENSE ***

define('BT_ROOT_ADMIN', dirname(dirname(__file__)).'/');
define('IS_IN_ADMIN', true);
require_once '../inc/boot.php';

require_once '../inc/boot.php';

require_once BT_ROOT.'admin/inc/auth.php'; // Security, dont move !
require_once BT_ROOT.'admin/inc/filesystem.php';
require_once BT_ROOT.'admin/inc/form.php';
require_once BT_ROOT.'admin/inc/sqli.php';
require_once BT_ROOT.'admin/inc/tpl.php'; // no choice !
require_once BT_ROOT_ADMIN.'inc/auth.php'; // Security, dont move !
require_once BT_ROOT_ADMIN.'inc/filesystem.php';
require_once BT_ROOT_ADMIN.'inc/form.php';
require_once BT_ROOT_ADMIN.'inc/sqli.php';
require_once BT_ROOT_ADMIN.'inc/tpl.php'; // no choice !

// Some actions are not required on install and login pages
if (!defined('BT_RUN_INSTALL') && !defined('BT_RUN_LOGIN')) {
Expand Down
2 changes: 1 addition & 1 deletion admin/links.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# *** LICENSE ***

require_once 'inc/boot.php';
require_once BT_ROOT.'admin/inc/links.php';
require_once BT_ROOT_ADMIN.'inc/links.php';


$vars = array(
Expand Down
1 change: 0 additions & 1 deletion inc/boot.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ function secure_host_to_path($http_host)

// Constants: folders
define('DIR_ADDONS', BT_ROOT.'addons/');
define('DIR_ADMIN', BT_ROOT.'admin/');
define('DIR_BACKUP', BT_ROOT.'bt_backup/');
define('DIR_CONFIG', BT_ROOT.'config/');
define('DIR_DATABASES', BT_ROOT.'databases/');
Expand Down
11 changes: 6 additions & 5 deletions inc/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,17 +250,18 @@ function lang_load_land($admin)
$GLOBALS['lang'] = '';
}

$path = '';
if ($admin === true) {
$path = 'admin/';
if ($admin === true && defined('BT_ROOT_ADMIN')) {
$path = BT_ROOT_ADMIN;
} else {
$path = BT_ROOT;
}
switch ($GLOBALS['lang']) {
case 'en':
require_once BT_ROOT.$path.'inc/lang/en_en.php';
require_once $path.'inc/lang/en_en.php';
break;
case 'fr':
default:
require_once BT_ROOT.$path.'inc/lang/fr_fr.php';
require_once $path.'inc/lang/fr_fr.php';
}
}

Expand Down

0 comments on commit 88b3a87

Please sign in to comment.