public function validate() { $record = user_userForEmail($this->value); if ($record) { $this->isValid = false; } else { $this->isValid = true; } }
private function authenticateWithEmail($form) { $user = user_userForEmail($form->username); if ($user) { $this->authenticateWithUserAndPassword($user, $form->password); $user->release(); } else { $this->prepareErrors(); } }
private function action($form) { $user = user_userForEmail($form->email); if ($user) { $newPassword = $this->generatePassword(); $user->password = $newPassword; $user->save(); $email = array(); $email['recipients'][] = $user->username; $email['new_password'] = $newPassword; email_sendAccountReset($email); } header('location:/forgetful/no_more/'); }