From 7f1c1eba0f79fa291b8ef9b9060bc310466a536b Mon Sep 17 00:00:00 2001 From: Craig Date: Sat, 16 Jan 2016 15:40:03 +1100 Subject: [PATCH 1/2] changed all refs to /admin to use 'ADMIN' constant --- admin/index.php | 12 ++++++++-- admin/themes/default/index.template.php | 12 +++++----- admin/themes/default/login.template.php | 6 ++--- boot/defines.php | 4 +++- engine/Plugin/Stylesheet.php | 2 +- install.php | 2 +- plugins/box/backup/backup.admin.php | 6 ++--- .../box/backup/views/backend/index.view.php | 2 +- .../box/filesmanager/filesmanager.admin.php | 24 +++++++++---------- .../information/views/backend/index.view.php | 17 +++++++++++-- .../box/pages/views/backend/index.view.php | 2 +- plugins/box/plugins/plugins.admin.php | 4 ++-- .../box/plugins/views/backend/index.view.php | 2 +- plugins/box/themes/themes.plugin.php | 9 +++++-- .../box/users/views/frontend/profile.view.php | 2 +- .../users/views/frontend/userspanel.view.php | 2 +- 16 files changed, 68 insertions(+), 40 deletions(-) diff --git a/admin/index.php b/admin/index.php index 56418237..8d4ea327 100644 --- a/admin/index.php +++ b/admin/index.php @@ -11,10 +11,18 @@ * file that was distributed with this source code. */ +/** + * Define __DIR__ constant for PHP 5.2.x + */ +if ( ! defined('__DIR__')) { + define('__DIR__', dirname(__FILE__)); +} + // Main engine defines define('DS', DIRECTORY_SEPARATOR); -define('ROOT', rtrim(str_replace(array('admin'), array(''), dirname(__FILE__)), '\\/')); +define('ROOT', rtrim(dirname(__DIR__), '\\/')); // eg '/home/user/public_html' +define('ADMIN', basename(__DIR__)); // eg 'admin' define('BACKEND', true); define('MONSTRA_ACCESS', true); @@ -131,7 +139,7 @@ Notification::set('reset_password', 'reset_password'); // Redirect to password-reset page - Request::redirect(Site::url().'/admin'); + Request::redirect(Site::url().'/'.ADMIN.''); } Notification::setNow('reset_password', 'reset_password'); diff --git a/admin/themes/default/index.template.php b/admin/themes/default/index.template.php index 6a6c5d45..dd6d9ddd 100644 --- a/admin/themes/default/index.template.php +++ b/admin/themes/default/index.template.php @@ -21,7 +21,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -74,12 +74,12 @@ - MONSTRA + MONSTRA