public function forgotPassword()
    {
        if ($this->request->getMethod() == 'POST') {
            $email = $this->getParam('email', null);
            $user = $this->userStore->getByEmail($email);

            if (empty($user)) {
                $this->view->error = Lang::get('reset_no_user_exists');
                return $this->view->render();
            }

            $key = md5(date('Y-m-d') . $user->getHash());
            $url = PHPCI_URL;

            $message = Lang::get('reset_email_body', $user->getName(), $url, $user->getId(), $key);

            $email = new Email();
            $email->setEmailTo($user->getEmail(), $user->getName());
            $email->setSubject(Lang::get('reset_email_title', $user->getName()));
            $email->setBody($message);
            $email->send();

            $this->view->emailed = true;
        }

        return $this->view->render();
    }
public function forgotPassword()
    {
        if ($this->request->getMethod() == 'POST') {
            $email = $this->getParam('email', null);
            $user = $this->userStore->getByEmail($email);

            if (empty($user)) {
                $this->view->error = Lang::get('reset_no_user_exists');
                return $this->view->render();
            }

            $key = md5(date('Y-m-d') . $user->getHash());
            $url = PHPCI_URL;

            $message = Lang::get('reset_email_body', $user->getName(), $url, $user->getId(), $key);

            $email = new Email();
            $email->setEmailTo($user->getEmail(), $user->getName());
            $email->setSubject(Lang::get('reset_email_title', $user->getName()));
            $email->setBody($message);
            $email->send();

            $this->view->emailed = true;
        }

        return $this->view->render();
    }
public function forgotPassword ( ) { if ( $ this -> request -> getMethod ( ) == 'POST' ) { $ email = $ this -> getParam ( 'email' , null ) ; $ user = $ this -> userStore -> getByEmail ( $ email ) ; if ( empty ( $ user ) ) { $ this -> view -> error = Lang :: get ( 'reset_no_user_exists' ) ; return $ this -> view -> render ( ) ; } $ key = md5 ( date ( 'Y-m-d' ) . $ user -> getHash ( ) ) ; $ url = PHPCI_URL ; $ message = Lang :: get ( 'reset_email_body' , $ user -> getName ( ) , $ url , $ user -> getId ( ) , $ key ) ; $ email = new Email ( ) ; $ email -> setEmailTo ( $ user -> getEmail ( ) , $ user -> getName ( ) ) ; $ email -> setSubject ( Lang :: get ( 'reset_email_title' , $ user -> getName ( ) ) ) ; $ email -> setBody ( $ message ) ; $ email -> send ( ) ; $ this -> view -> emailed = true ; } return $ this -> view -> render ( ) ; }
Allows the user to request a password reset email.
@return string
Allows the user to request a password reset email .