本文整理匯總了PHP中mailer::sendNewPasswordMail方法的典型用法代碼示例。如果您正苦於以下問題:PHP mailer::sendNewPasswordMail方法的具體用法?PHP mailer::sendNewPasswordMail怎麽用?PHP mailer::sendNewPasswordMail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mailer
的用法示例。
在下文中一共展示了mailer::sendNewPasswordMail方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: json_encode
$errmsg[] = $return['errmsg'];
}
}
if ($return['success'] == 0 && count($errmsg) > 0) {
echo json_encode(array('success' => 0, 'errmsg' => $errmsg));
} else {
echo json_encode(array('success' => 1));
Logging::log(7, $this->user);
}
break;
case 'sendNewPassword':
$user = new user($_POST['values']['clientId']);
$newPassword = $user->generateRandomPassword();
$loginCredentials = $user->createPassword($newPassword);
if ($loginCredentials['success'] === 1) {
$result = mailer::sendNewPasswordMail($user, $newPassword);
if ($result === true) {
$user->set('salt', $loginCredentials['salt']);
$user->set('password', $loginCredentials['password']);
$user->save();
echo json_encode(array('status' => 'correct', 'msg' => Texter::get('client|sendNewPassword')));
} else {
echo json_encode(array('status' => Texter::get('client|sendNewPasswordfail')));
}
}
break;
case 'deleteImage':
$user = new User($_SESSION['user_id']);
if ($user->deleteImage($_POST['values']['dataId']) === true) {
echo json_encode(array('success' => 1, 'dataId' => $_POST['values']['dataId']));
} else {