本文整理匯總了PHP中Parse\ParseUser::requestPasswordReset方法的典型用法代碼示例。如果您正苦於以下問題:PHP ParseUser::requestPasswordReset方法的具體用法?PHP ParseUser::requestPasswordReset怎麽用?PHP ParseUser::requestPasswordReset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Parse\ParseUser
的用法示例。
在下文中一共展示了ParseUser::requestPasswordReset方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: resetPasswordAux
function resetPasswordAux($userName)
{
try {
console . log("entrei");
window . alert("Email enviado");
ParseUser::requestPasswordReset($userName);
window . alert("Email enviado");
// Password reset request was sent successfully
} catch (ParseException $ex) {
// Password reset failed, check the exception message
}
}
示例2: forgotAction
/**
* Expects a post with email (or the form is just shown). Resets the password using the email then redirects to the
* sign in page with a success or error message.
*/
public function forgotAction()
{
if (!$this->request instanceof Request or !$this->request->isPost()) {
return;
//nothing to do
}
$email = $this->request->getPost('email');
try {
ParseUser::requestPasswordReset($email);
$this->flashMessenger()->addInfoMessage('Reset Sent!');
} catch (ParseException $e) {
$this->flashMessenger()->addErrorMessage($e->getMessage());
}
$this->redirect()->toRoute('auth', ['action' => 'signin']);
}
示例3: dtestPasswordResetFails
public function dtestPasswordResetFails()
{
$this->setExpectedException('Parse\\ParseException', 'no user found with email');
ParseUser::requestPasswordReset('non_existent@example.com');
}
示例4: catch
public static function reiniciarContraseña($email)
{
try {
ParseUser::requestPasswordReset($email);
return true;
} catch (ParseException $ex) {
return false;
}
}