本文整理匯總了PHP中SiteHelpers::randomPassword方法的典型用法代碼示例。如果您正苦於以下問題:PHP SiteHelpers::randomPassword方法的具體用法?PHP SiteHelpers::randomPassword怎麽用?PHP SiteHelpers::randomPassword使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SiteHelpers
的用法示例。
在下文中一共展示了SiteHelpers::randomPassword方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: postForgotpass
public function postForgotpass()
{
$rules = array('email' => 'required|email');
if (CNF_RECAPTCHA == 'true') {
$rules['recaptcha_response_field'] = 'required|recaptcha';
}
$validator = Validator::make(Input::all(), $rules);
if ($validator->passes()) {
$cus = DB::table('customer')->where('email', '=', Input::get('email'))->first();
if (count($cus) > 0) {
$pass = SiteHelpers::randomPassword();
DB::table('customer')->where('email', '=', Input::get('email'))->update(array('password' => md5($pass)));
$data = array('name' => $cus->name, 'username' => $cus->username, 'pass' => $pass);
Mail::send('emails.forgotpass', $data, function ($message) {
$message->from(CNF_EMAIL, 'Admin');
$message->to(Input::get('email'), '')->subject('Thông tin đăng nhập');
});
}
return Redirect::to('thong-bao.html')->with('message', SiteHelpers::alert('success', 'Vui lòng kiểm tra Email để nận mật khẩu mới !'));
} else {
return Redirect::to('forgotpass.html')->with('message_forgotpass', SiteHelpers::alert('error', 'Vui lòng xác nhận các thông tin bên dưới'))->withErrors($validator)->withInput();
}
}