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();