本文整理匯總了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'));
}