本文整理汇总了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;
}
}