Yii Framework Forum: login - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

login Rate Topic: -----

#1 User is offline   zipzap 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 112
  • Joined: 13-January 12

Posted 10 February 2012 - 06:25 PM

why if i change class UserIdentity with this:
 private $_id;
    
    public function getId() {
            return $this->_id;
}


the login with admin/ admin doesnt work?
0

#2 User is offline   andredelorme 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 30-April 09

Posted 10 February 2012 - 06:48 PM

Did you remove the authenticate() method?
0

#3 User is offline   zipzap 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 112
  • Joined: 13-January 12

Posted 11 February 2012 - 10:59 AM

View Postandredelorme, on 10 February 2012 - 06:48 PM, said:

Did you remove the authenticate() method?

no i did not.
0

#4 User is offline   andredelorme 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 30-April 09

Posted 11 February 2012 - 03:06 PM

What is the error?
0

#5 User is offline   zipzap 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 112
  • Joined: 13-January 12

Posted 12 February 2012 - 07:22 AM

No error.Simply doesnt do the login stays on the the same login page.If i remove the private variable it works.Try with a new created project.

What i did find is that if i change the variable name it works,what i not understand is why?
0

#6 User is offline   andredelorme 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 30-April 09

Posted 17 February 2012 - 11:21 AM

View Postzipzap, on 12 February 2012 - 07:22 AM, said:

No error.Simply doesnt do the login stays on the the same login page.If i remove the private variable it works.Try with a new created project.

What i did find is that if i change the variable name it works,what i not understand is why?


The UserIdentity class extends CUserIdentity, a class that implements the interface IUserIdentity that has a method getId().
Originally this method return the username, if you redefine the method, you have to set this value in the login process, since this is the value used to uniquely identify the user session.

More information:
http://www.yiiframew...pi/1.1/CWebUser
0

#7 User is offline   zipzap 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 112
  • Joined: 13-January 12

Posted 17 February 2012 - 11:23 AM

View Postandredelorme, on 17 February 2012 - 11:21 AM, said:

The UserIdentity class extends CUserIdentity, a class that implements the interface IUserIdentity that has a method getId().
Originally this method return the username, if you redefine the method, you have to set this value in the login process, since this is the value used to uniquely identify the user session.

More information:
http://www.yiiframew...pi/1.1/CWebUser

Thanks a lot for your explanation
0

#8 User is offline   andredelorme 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 24
  • Joined: 30-April 09

Posted 17 February 2012 - 12:42 PM

You're welcome. Are you from Brazil or speech portuguese, right? Why didn´t you post in the portuguese language forum?

Por nada. Você é brasileiro ou fala português, certo? Por que não postou no fórum em português?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users