本文整理汇总了PHP中Confide::resetPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP Confide::resetPassword方法的具体用法?PHP Confide::resetPassword怎么用?PHP Confide::resetPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Confide
的用法示例。
在下文中一共展示了Confide::resetPassword方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: do_reset_password
/**
* Attempt change password of the user
*
*/
public function do_reset_password()
{
$input = array('token' => Input::get('token'), 'password' => Input::get('password'), 'password_confirmation' => Input::get('password_confirmation'));
// By passing an array with the token, password and confirmation
if (Confide::resetPassword($input)) {
$notice_msg = Lang::get('confide::confide.alerts.password_reset');
return Redirect::action('UserController@login')->with('notice', $notice_msg);
} else {
$error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');
return Redirect::action('UserController@reset_password', array('token' => $input['token']))->withInput()->with('error', $error_msg);
}
}
示例2: postReset
/**
* Attempt change password of the user
*
*/
public function postReset()
{
$input = array('token' => Input::get('token'), 'password' => Input::get('password'), 'password_confirmation' => Input::get('password_confirmation'));
// By passing an array with the token, password and confirmation
if (Confide::resetPassword($input)) {
return Redirect::to('user/login')->with('notice', Lang::get('confide::confide.alerts.password_reset'));
} else {
return Redirect::to('user/reset/' . $input['token'])->withInput()->with('error', Lang::get('confide::confide.alerts.wrong_password_reset'));
}
}
示例3: do_reset_password
/**
* Attempt change password of the user
*
*/
public function do_reset_password()
{
if (Auth::check()) {
$rules = ['password' => 'required|between:4,11|confirmed', 'password_confirmation' => 'between:4,11'];
$validator = Validator::make(Input::all(), $rules);
if ($validator->fails()) {
return Redirect::to('user/reset')->withInput()->withErrors($validator);
}
$user = Auth::user();
$user->password = Input::get('password');
$user->save();
Session::flash('message', trans('texts.confide.password_reset'));
return Redirect::to('/dashboard');
} else {
$input = array('token' => Input::get('token'), 'password' => Input::get('password'), 'password_confirmation' => Input::get('password_confirmation'));
// By passing an array with the token, password and confirmation
if (Confide::resetPassword($input)) {
$notice_msg = trans('texts.confide.password_reset');
return Redirect::action('UserController@login')->with('notice', $notice_msg);
} else {
$error_msg = trans('texts.confide.wrong_password_reset');
return Redirect::action('UserController@reset_password', array('token' => $input['token']))->withInput()->with('error', $error_msg);
}
}
}
示例4: postReset
public function postReset()
{
$input = array('token' => Input::get('token'), 'password' => Input::get('password'), 'password_confirmation' => Input::get('password_confirmation'));
return Confide::resetPassword($input) ? Redirect::to('user/login')->with('success', Lang::get('confide::confide.alerts.password_reset')) : Redirect::to('user/reset/' . $input['token'])->withInput()->with('error', Lang::get('confide::confide.alerts.wrong_password_reset'));
}