CodeIgniter Tank Auth - send_again 函数的问题
我一直在使用这个库,这绝对是很棒的。我正在测试它,我认为当未激活的用户尝试登录时会出现问题。我只是想知道你们中是否有人注意到了这一点?发生的情况是,用户被重定向到 send_again 页面,但一旦到达那里,我们就无法再将 url 更改为任何其他位置。我猜测发生这种情况是因为会话信息没有被破坏 - 在登录函数中:
elseif ($this->tank_auth->is_logged_in(FALSE)) {
// logged in, not activated
redirect('/auth/send_again/');
它一直被执行(除非我们强制注销)。有人知道如何解决这个问题吗? 谢谢!
I have been playing around with this library, which is absolutely awesome. I was testing it and I think there's a problem when a non activated User tries to log in. I was just wondering if any of you noticed this already? What happens is that the User is redirected to the send_again page, but once there, we are not able to change the url to any other location anymore. I am guessing that this happens because of the session info that is not destroyed - in the login function :
elseif ($this->tank_auth->is_logged_in(FALSE)) {
// logged in, not activated
redirect('/auth/send_again/');
this gets executed all the time (unless we force a logout). Does anybody knows how to fix this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试删除 \controllers\auth.php 函数登录上的重定向值并发现:
当您不是激活用户时,将始终调用 send_again 函数。因此,要传递 send_again 函数,您只需删除重定向值,
如果您想激活电子邮件激活,则需要在配置文件夹中配置 email.php
try to remove the redirect value on \controllers\auth.php function login and find this :
send_again function will always be called when you are not activated user. So, to pass the send_again function you just need to delete redirect value
if you want to activate email activation you need to configure email.php on config folder
我在客户的网站上发现了这个错误。强制注销似乎可以解决此问题。
因此,我在重新发送函数中设置了强制注销,就在它发送激活链接之后。
工作代码在 application/controllers/auth.php 中看起来像这样
据我所知,这只是 hack,但它为我解决了问题。我不知道该网站的创建者是否在 Tank_auth 操作中更改了任何内容。
我希望它对其他人有用。
I found this bug to on a client's site. Forcing a logout seems to fix it.
So, I put a forced logout in the function resend function, just after it sends the activation link.
The working code looks like this in application/controllers/auth.php
As far as I can tell, this is just hack, but it solved the problem for me. I don't know if the creator of this site changed anything or not in the tank_auth actions.
I hope it works for others.
嘿,这一直对我有用:
注意条件中的爆炸
hey this has always worked for me:
notice the bang in the condition