Yii Framework Forum: Implement I Forgot My Password - Yii Framework Forum

Jump to content

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

Implement I Forgot My Password I forgot my password Rate Topic: -----

#1 User is offline   webquin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 28-October 12

Posted 07 November 2012 - 06:15 PM

Hello Friends.
I am new to Yii. I am creating a small application.
At the user login option appears comumente Forgot your password?. which prompts the user for the username and email or send you an email with instructions on how to create your new password.
yii see that the login has by default already made, but does not bring the forgot password functionality,
If anyone knows of any extension or module that you bring this to not reinvent the wheel, I researched
but there are more modules that focus on managing all roles and users and that is too
I need.
Thanks for the accessory you can give me
0

#2 User is offline   waitforit 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 389
  • Joined: 09-February 11

Posted 07 November 2012 - 10:47 PM

I rolled my own. My app has unique needs not easily met by a user mgmt extension.

Here's the basics.

When a user requests a new password (via entering user ID, email, username, whatever you want, plus or minus security questions) you generate a unique hash and save it. Send the user an email with a link to resetpassword controller action.

The action needs to check the GET value of the string and match to DB. If they match you allow them to reset their password (and delete the key afterwards).
0

#3 User is offline   webquin 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 28-October 12

Posted 12 November 2012 - 10:43 PM

waitforit, than you.
0

#4 User is offline   Boaz 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 367
  • Joined: 23-January 11

Posted 14 November 2012 - 03:02 PM

To add on it, I also introduced a "unique_valid_until" column in the DB, which is also updated when the unique is issued. This way, the 'reset my password' link in email sent to user (for example) can have a defined lifetime.
Also, search this question on stackoverflow.com . I bet it was addressed there a lot :-) (and not in Yii context, which ensures an attention of experienced and talented people from other fields).
Therapeutic PHP sessions My LinkedIn Profile
0

#5 User is offline   skworden 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 139
  • Joined: 14-June 12
  • Location:Virginia, USA

Posted 14 November 2012 - 05:41 PM

Yii User has forgot my password feature. You could look at how it was done in the code to give you a better idea or just use it.

Yii-User
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