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