开发者

Looking for previous page redirect on Joomla CB login

开发者 https://www.devze.com 2023-03-04 12:16 出处:网络
Hey, I\'ve been looking for a solution to this particular problem for a few days now with no luck. I\'m working with Community Builder for a login page to a Joomla website. The site has some pages tha

Hey, I've been looking for a solution to this particular problem for a few days now with no luck. I'm working with Community Builder for a login page to a Joomla website. The site has some pages that require the user to be registered to have access to, and if they try to view the page without authentication they get redirected to the CB login page. The problem is that, after providing the proper login inf开发者_JAVA百科ormation, the user is sent to the index.php page. I'm trying to find something through code or plugin that'll allow me to redirect the user back to the page they are trying to view after logging in. Does anybody know of a method to implement this?


You can create a system plugin with event onAfterDispatch. Here you can check if user has access to the requested url (through joomla acl functions). If not then redirect the user to cb login page with additional query parameter return=base64_encode_url. It will set the hidden field named 'return' in login form and user will be redirected to that url after login.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号