Hi I’m looking to create a simple Forgot Password system using CakePHP where a user will type in their username/email and then receive an email with a link they can click to create a new password.
I’ve Googled around but not found anything :/
Using CakePHP 1.3
reset_passwordcontroller action.reset_passwordcontroller action look forthis->data['User']['email']and store the email address in a database table.keyortokenfield. This field should be CHAR(40). In thereset_passwordaction do$key = Security::hash(String::uuid(),'sha1',true)to create a key or hash and store it in thekeyortokenfield.$url = Router::url( ($this->here), true ).'/'.$keyinside the controllersreset_passwordaction. This will generate a url based on the current action and append to it the key parameter which you can verify in this same function when the user clicks the email link.Emailcomponent to actually send the e-mail including the generated URL above in the message body.This should be enough to get you going in the right direction.