From f648a51a47590b87c7e58a03c931f99f34d7a764 Mon Sep 17 00:00:00 2001 From: Jesse Woo Date: Tue, 20 Aug 2024 14:44:46 -0700 Subject: [PATCH] redirect --- core/components/com_forum/config/access.xml | 1 + core/components/com_forum/site/forum.php | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/core/components/com_forum/config/access.xml b/core/components/com_forum/config/access.xml index 91a57815e67..b8661ea060c 100644 --- a/core/components/com_forum/config/access.xml +++ b/core/components/com_forum/config/access.xml @@ -8,6 +8,7 @@
+ diff --git a/core/components/com_forum/site/forum.php b/core/components/com_forum/site/forum.php index a0577d99fe2..0cb09607abc 100644 --- a/core/components/com_forum/site/forum.php +++ b/core/components/com_forum/site/forum.php @@ -17,6 +17,16 @@ require_once __DIR__ . DS . 'controllers' . DS . $controllerName . '.php'; $controllerName = __NAMESPACE__ . '\\Controllers\\' . ucfirst(strtolower($controllerName)); +if (!User::authorise('core.access', 'com_forum')) +{ + $return = base64_encode(Request::getString('REQUEST_URI', '', 'server')); + //$return = base64_encode($_SERVER['REQUEST_URI']); + App::redirect( Route::url('index.php?option=com_users&view=login&return=' . $return, false), + "Please Log in and then we will redirect you to the forum pages", + 'warning' + ); +} + // Instantiate controller $controller = new $controllerName(); $controller->execute();