public function lostPassword(HTTPRequest $request)
    {
        $email = Convert::raw2sql($request->requestVar('email'));
        $member = DataObject::get_one(Member::class, "\"Email\" = '{$email}'");

        if ($member) {
            $token = $member->generateAutologinTokenAndStoreHash();

            $link = Security::lost_password_url();
            $lostPasswordHandler = new LostPasswordHandler($link);

            $lostPasswordHandler->sendEmail($member, $token);
        }

        return array('done' => true);
    }
public function lostPassword(HTTPRequest $request)
    {
        $email = Convert::raw2sql($request->requestVar('email'));
        $member = DataObject::get_one(Member::class, "\"Email\" = '{$email}'");

        if ($member) {
            $token = $member->generateAutologinTokenAndStoreHash();

            $link = Security::lost_password_url();
            $lostPasswordHandler = new LostPasswordHandler($link);

            $lostPasswordHandler->sendEmail($member, $token);
        }

        return array('done' => true);
    }
public function lostPassword ( HTTPRequest $ request ) { $ email = Convert :: raw2sql ( $ request -> requestVar ( 'email' ) ) ; $ member = DataObject :: get_one ( Member :: class , "\"Email\" = '{$email}'" ) ; if ( $ member ) { $ token = $ member -> generateAutologinTokenAndStoreHash ( ) ; $ link = Security :: lost_password_url ( ) ; $ lostPasswordHandler = new LostPasswordHandler ( $ link ) ; $ lostPasswordHandler -> sendEmail ( $ member , $ token ) ; } return array ( 'done' => true ) ; }
Sends password recovery email

@param  HTTPRequest   $request    HTTP request containing 'email' vars
@return array                        'email' => false if email fails (Member doesn't exist will not be reported)
Sends password recovery email