用户确认电子邮件时的访问/权限错误 [英] Access/Permissions error when user confirms e-mail

查看:120
本文介绍了用户确认电子邮件时的访问/权限错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在未注册的用户前端有一个立即加入"菜单选项.当新用户选择该菜单选项时,会向他们显示注册表格.完成后,他们会收到一条通知,告知他们已经向他们发送了一封确认电子邮件.

I have a "Join Now" menu option on the unregistered user front end. When a new user selects that menu option, they're presented the registration form. On completion they get a notice that a confirmation e-mail has been sent to them.

所有标准内容.

因此,...用户转到其电子邮件收件箱,找到确认电子邮件,然后单击链接.他们被带回站点,并且仍在立即加入"菜单选项下...

So... the user goes to their e-mail inbox, finds the confirmation e-mail and clicks the link. They're brought back to the site and they are still under the "Join Now" menu option...

https://www.example.com/index.php/join-now?view=login

因此,按预期完成登录表单.还有摩擦.

So... the complete the login form, as expected. And there's the rub.

立即加入"菜单选项与未注册的用户权限级别相关联,一旦他们登录,它就不再是活动菜单选项.因此,每次新用户登录时,他们都会在页面顶部抽屉"框中收到一条错误消息.

The 'Join Now' menu option is tied to the unregistered user permissions level and once they log in, it is no longer an active menu option. So, every time a new user logs in, they get an error message at the top of the page in the "drawer" box.

Error
You are not authorised to view this resource.

如何解决此问题,以便他们登录时将其重定向回主页"菜单,而不会收到此错误消息?对于我的一生,我似乎无法弄清楚,我知道这应该很简单.

How do I fix that so that when they log in they get redirected back to the 'Home' menu and we don't get this error message? For the life of me I can't seem to figure that out, and I know it should be simple.

推荐答案

您可以将其放在模板中:

You can put this inside your template:

$app = JFactory::getApplication();
$user = JFactory::getUser(); 
//redirect user if logged in
if ($user->id > 0) $app->redirect('index.php/menuwhereyouwanthimtogo');

这篇关于用户确认电子邮件时的访问/权限错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆