本文整理汇总了PHP中Logging::password_recovery_email_sent_success方法的典型用法代码示例。如果您正苦于以下问题:PHP Logging::password_recovery_email_sent_success方法的具体用法?PHP Logging::password_recovery_email_sent_success怎么用?PHP Logging::password_recovery_email_sent_success使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logging
的用法示例。
在下文中一共展示了Logging::password_recovery_email_sent_success方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postForgotPassword
public function postForgotPassword()
{
$validator = Validator::make(Input::all(), array('email' => 'required|email'));
if ($validator->fails()) {
return Redirect::route('account-forgot-password')->withErrors($validator)->withInput();
} else {
$user = User::where('email', '=', Input::get('email'));
if ($user->count()) {
$user = $user->first();
// Generate a new code and password
$code = str_random(60);
$password = str_random(10);
$user->code = $code;
$user->password_temp = Hash::make($password);
if ($user->save()) {
Mail::send('emails.auth.forgot', array('link' => URL::route('account-recover', $code), 'username' => $user->username, 'password' => $password), function ($message) use($user) {
$message->to($user->email, $user->username)->subject('Your new password');
});
Logging::password_recovery_email_sent_success($user->email);
return Redirect::route('home')->with('global', 'We have sent you a new password by email.');
}
}
}
Logging::password_recovery_email_sent_fail(Input::get('email'));
return Redirect::route('account-forgot-password')->with('global', 'Could not request new password.');
}