Skip to content

Commit

Permalink
redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
jessewoo committed Aug 20, 2024
1 parent 80a1532 commit f648a51
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/components/com_forum/config/access.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<access component="com_forum">
<section name="component">
<action name="core.access" title="JACTION_ACCESS" description="JACTION_ACCESS_COMPONENT_DESC" />
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
Expand Down
10 changes: 10 additions & 0 deletions core/components/com_forum/site/forum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

0 comments on commit f648a51

Please sign in to comment.