开发者

how can i get ID in sfDoctrineGuardPlugin?

I was creating its own login system, but all recommmended sfDoctrineGuardPlugin. unfortunately I dont understand this...

I go to http://localhost/frontend_dev.php/login and i logged in. i am in class sfGuardSecurityUser and method public function signIn($user, $remember = false, $con = null) where there did variable $user?

there is:

$this->setAttribute('user_id', $user->getId(), 'sfGuardSecurityUser');

but if i use:

$this->getUser()->getAttribute('user_id');

in own module then it is NULL. Works only $this->getUser(); but this is only Name and login. How can i get ID logged user?

I also added in table sf_guard_user_permission user_id 2 permission_id 2 and how can i check this in other module?

Th开发者_JAVA技巧anks for help!


This is simple, in an action for exemple : $this->getUser()->getGuardUser()->getId();

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜