当前位置: 首页>>代码示例>>PHP>>正文


PHP Reminder::complete方法代码示例

本文整理汇总了PHP中Reminder::complete方法的典型用法代码示例。如果您正苦于以下问题:PHP Reminder::complete方法的具体用法?PHP Reminder::complete怎么用?PHP Reminder::complete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Reminder的用法示例。


在下文中一共展示了Reminder::complete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: processReset

 /**
  * Handle posting of the form for the password reminder confirmation.
  *
  * @param  int  $id
  * @param  string  $code
  * @return \Illuminate\Http\RedirectResponse
  */
 public function processReset($id, $code)
 {
     $rules = ['password' => 'required|confirmed'];
     $validator = Validator::make(Input::get(), $rules);
     if ($validator->fails()) {
         return Redirect::back()->withInput()->withErrors($validator);
     }
     if (!($user = Sentinel::findById($id))) {
         return Redirect::back()->withInput()->withErrors('The user no longer exists.');
     }
     try {
         if (!Reminder::complete($user, $code, Input::get('password'))) {
             return Redirect::route('user.login')->withErrors('Invalid or expired reset code.');
         }
         return Redirect::route('user.login')->withSuccess('Password was successfully resetted.');
     } catch (NotUniquePasswordException $e) {
         return Redirect::back()->withErrors($e->getMessage());
     }
 }
开发者ID:ryanrobertsname,项目名称:giftertipster.com,代码行数:26,代码来源:RemindersController.php

示例2: SetForgotPassword

 /**
  * Set the new password
  * @return $this
  */
 public function SetForgotPassword()
 {
     try {
         $user = \Sentinel::getUserRepository()->findById(\Input::get('UserId'));
         if (\Reminder::complete($user, \Input::get('ResetCode'), \Input::get('password'))) {
             return redirect('auth/login')->withErrors(array('login' => 'Password reset successful. Please Login'));
         } else {
             return redirect('auth/forgotpassword')->withErrors(array('forgot_password' => 'Password reset failed'));
         }
     } catch (\Exception $e) {
         return redirect('auth/forgotpassword')->withErrors(array('forgot_password' => 'User not found in our database.'));
     }
 }
开发者ID:brucewu16899,项目名称:Core,代码行数:17,代码来源:AuthController.php

示例3: postReset

 public function postReset(Request $request)
 {
     $input = $request->all();
     $credentials = ['email' => $request->email];
     $rules = ['email' => 'required|email|exists:users,email', 'password' => 'required|alpha_num|min:6|max:20', 'password_confirm' => 'required|same:password', 'code' => 'required'];
     $messsages = ['code.required' => 'خطای امنیتی. لطفا عملیات تغییر رمز عبور را مجددا انجام دهید.'];
     $validator = Validator::make($input, $rules, $messsages);
     if ($validator->fails()) {
         return back()->withInput()->withErrors($validator);
     }
     if ($user = Sentinel::findByCredentials($credentials)) {
         if (!Reminder::complete($user, $request->code, $request->password)) {
             return redirect()->route('login')->with('fail', 'Invalid or expired reset code.');
         }
         return redirect()->route('login')->with('success', 'Password Reset.');
     } else {
         return back()->withInput()->with('fail', 'The user no longer exists.');
     }
 }
开发者ID:majid-n,项目名称:laravel,代码行数:19,代码来源:AuthController.php

示例4: function

});
Route::get('reset/{id}/{code}', function ($id, $code) {
    $user = Sentinel::findById($id);
    return View::make('sentinel.reset.complete');
})->where('id', '\\d+');
Route::post('reset/{id}/{code}', function ($id, $code) {
    $rules = ['password' => 'required|confirmed'];
    $validator = Validator::make(Input::get(), $rules);
    if ($validator->fails()) {
        return Redirect::back()->withInput()->withErrors($validator);
    }
    $user = Sentinel::findById($id);
    if (!$user) {
        return Redirect::back()->withInput()->withErrors('The user no longer exists.');
    }
    if (!Reminder::complete($user, $code, Input::get('password'))) {
        return Redirect::to('login')->withErrors('Invalid or expired reset code.');
    }
    return Redirect::to('login')->withSuccess("Password Reset.");
})->where('id', '\\d+');
Route::group(['prefix' => 'account', 'before' => 'auth'], function () {
    Route::get('/', function () {
        $user = Sentinel::getUser();
        $persistence = Sentinel::getPersistenceRepository();
        return View::make('sentinel.account.home', compact('user', 'persistence'));
    });
    Route::get('kill', function () {
        $user = Sentinel::getUser();
        Sentinel::getPersistenceRepository()->flush($user);
        return Redirect::back();
    });
开发者ID:abada,项目名称:laravel_tasks,代码行数:31,代码来源:routes.php


注:本文中的Reminder::complete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。