开发者

How to force login with sfGuard?

Does anyone have any of how to force a login action with sfGuard th开发者_运维问答rough code? Something like: $this->authenticate('username'); ?

Thanks in advance.


I think it was:

$user = // sfGuardUser object
$user_id = $user->getId();

$this->getUser()->signIn($user_id, true);

... with the second parameter being true/false for "remember me".

See the signIn function in the sfGuardSecurityUser.class.php inside the Plugin lib/user/ to see how it works.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜