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


PHP Auth::logout方法代码示例

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


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

示例1: logout

 /**
  * Logout
  *
  * @return Response
  */
 public function logout()
 {
     if (\Auth::check()) {
         \Auth::logout();
     }
     return \Redirect::route('home.index');
 }
开发者ID:jmoreirafilho,项目名称:SharingTests,代码行数:12,代码来源:UserController.php

示例2: loginuser

 public function loginuser(Request $request)
 {
     $rules = ['email' => 'required|email', 'password' => 'required'];
     $nicename = ['email' => 'emile', 'password' => 'password'];
     $validator = \Illuminate\Support\Facades\Validator::make($request->all(), $rules);
     $validator->setAttributeNames($nicename);
     if ($validator->fails()) {
         $request->flash();
         return redirect()->back()->withErrors($validator);
     }
     if ($request->has('password') && $request->has('email')) {
         if (\Auth::user()->attempt(['email' => $request->input('email'), 'password' => $request->input('password')])) {
             //                 Authentication passed...
             if (\Auth::user()->get()->type == 0) {
                 $userinfo = \DB::table('system_user')->where('system_user.user', '=', \Auth::user()->get()->id)->get();
                 session()->put('userinfo', $userinfo);
                 return redirect()->intended('home');
             } else {
                 Auth::logout();
                 return redirect()->back();
             }
         } else {
             $request->flash();
             return redirect()->back()->withErrors(['loginwrong' => 'check your access info']);
         }
     }
 }
开发者ID:sas48mouad,项目名称:mouad,代码行数:27,代码来源:SystemUserController.php

示例3: logout

 public function logout()
 {
     Auth::logout();
     // logout user
     return Redirect::to('admin/login');
     //redirect back to login
 }
开发者ID:devchd,项目名称:metronic,代码行数:7,代码来源:LoginController.php

示例4: logout

 public static function logout()
 {
     if (\Auth::user()) {
         \Auth::logout();
     }
     return \Redirect::route('home');
 }
开发者ID:gtcrais,项目名称:gtcms,代码行数:7,代码来源:UserController.php

示例5: logout

 public function logout()
 {
     if (\Auth::check()) {
         \Auth::logout();
     }
     return \Redirect::back();
 }
开发者ID:VovikeMS,项目名称:darts,代码行数:7,代码来源:AuthController.php

示例6: doLogout

 public function doLogout()
 {
     Auth::logout();
     // log the user out of our application
     return Redirect::to('login');
     // redirect the user to the login screen
 }
开发者ID:arunsahoo,项目名称:CRUD-App,代码行数:7,代码来源:HomeController.php

示例7: logout

 /**
  * @author LAHAXE Arnaud
  *
  * @param \App\Libraries\OAuth\Password $passwordService
  *
  * @return \Illuminate\Http\RedirectResponse|\Laravel\Lumen\Http\Redirector
  */
 public function logout(OAuthPassword $passwordService)
 {
     // remove OAuth token from database and session
     $passwordService->logout();
     // logout user
     \Auth::logout();
     return redirect(route('auth.loginForm'));
 }
开发者ID:ndrx-io,项目名称:elude,代码行数:15,代码来源:Auth.php

示例8: logout

 /**
  * Logout user
  * @return Ambigous <\Illuminate\Routing\Redirector, \Illuminate\Http\RedirectResponse>
  */
 public function logout()
 {
     if (\Auth::check()) {
         \Auth::logout();
         session()->flush();
     }
     return redirect('/');
 }
开发者ID:atudz,项目名称:SFAReport,代码行数:12,代码来源:AuthController.php

示例9: redirectToFacebook

 public function redirectToFacebook($redirect_path = null)
 {
     \Session::flush();
     \Auth::logout();
     if ($redirect_path) {
         \Config::set('services.facebook.redirect', \Config::get('services.facebook.redirect') . "/" . $redirect_path);
     }
     return Socialize::with('facebook')->redirect();
 }
开发者ID:bancuadrian,项目名称:facebookphotocontest,代码行数:9,代码来源:UserController.php

示例10: logout

 public function logout()
 {
     if (\Auth::check()) {
         \Auth::logout();
         Session::forget('user_name');
         Session::forget('pts');
         return Redirect::to('/')->with('message', 'Successfully Logged Out!');
     } else {
         return Redirect::to('login')->with('message', 'You need to login first!');
     }
 }
开发者ID:Nelabh,项目名称:lara,代码行数:11,代码来源:UserController.php

示例11: confirmPassword

 public function confirmPassword(Request $r)
 {
     $token = urldecode($r->token);
     $id = $r->id;
     if ($pwd = PRM::find($id)) {
         $deadline = strtotime($pwd->created_at) + 86400;
         $pageOpenTime = strtotime('now');
         if (abs($deadline - $pageOpenTime) >= 86400) {
             return "Password Token expired";
         }
         event(new PCEvent($pwd));
         \Auth::logout();
         return redirect('/');
     } else {
         return "Password Change Process Terminated";
     }
 }
开发者ID:andela-tpeters,项目名称:star_city_app,代码行数:17,代码来源:PwdConfirmationCtrl.php

示例12: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     if (\Auth::check()) {
         if (\Auth::user()->role == 1) {
             $numberReferredCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '<>', 'Pending Closure')->where('cases.status', '<>', 'Resolved')->groupBy('cases.id')->get();
             $numberPendingClosureCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '=', 'Pending Closure')->groupBy('cases.id')->get();
             $numberResolvedCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '=', 'Resolved')->groupBy('cases.id')->get();
             $numberPendingCases = \DB::table('cases')->where('cases.status', '=', 'Pending')->get();
         } else {
             $numberReferredCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '<>', 'Pending Closure')->where('cases.status', '<>', 'Resolved')->where('caseOwners.user', '=', \Auth::user()->id)->groupBy('cases.id')->get();
             $numberPendingClosureCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '=', 'Pending Closure')->where('caseOwners.user', '=', \Auth::user()->id)->groupBy('cases.id')->get();
             $numberResolvedCases = \DB::table('cases')->join('caseOwners', 'cases.id', '=', 'caseOwners.caseId')->where('cases.status', '=', 'Resolved')->where('caseOwners.user', '=', \Auth::user()->id)->groupBy('cases.id')->get();
         }
         return view('home.home', compact('numberReferredCases', 'numberPendingClosureCases', 'numberResolvedCases', 'numberPendingCases'));
     } else {
         \Auth::logout();
     }
 }
开发者ID:elieishimwe,项目名称:Siyaleader-Transnet,代码行数:23,代码来源:HomeController.php

示例13: store

 public function store()
 {
     $id = $this->missionService->storeMission();
     if ($id == 'logout') {
         \Auth::logout();
         \Session::flush();
         return \Redirect::route('admin/home');
     }
     $file = \Input::file('file');
     if ($file != null) {
         $validateFile = $this->fileService->validateImage($file);
         if (!$validateFile['error']) {
             $this->missionService->storeImg($id, $file);
         } else {
             //else, redirect back with message
             \Session::flash('flash_message', $validateFile['message']);
             \Session::flash('flash_type', 'alert-danger');
             return \Redirect::back()->withInput();
         }
     }
     return \Redirect::route('mission/profile', ['id' => $id]);
 }
开发者ID:scify,项目名称:city-r-us-web,代码行数:22,代码来源:MissionController.php

示例14: confirmEmail

 /**
  * @param $token
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function confirmEmail($token)
 {
     // validate if this token exists on the record.
     // validate if the email address associated with this token
     $reset_record = \App\Email_address_reset::where('token', '=', $token)->firstOrFail();
     $new_email = $reset_record->email;
     // select the specific user
     $user = $reset_record->user()->get()[0];
     // NEED TO FIX !!!!!!!!!
     // change his email address
     $user->email = $new_email;
     $user->save();
     // delete the record
     $reset_record->where('token', $token)->delete();
     // flash the message
     flash('Your Email is updated, please sign in with your new Email Address');
     // redirect somewhere
     // Kill session or have user logout
     if (\Auth::check()) {
         \Auth::logout();
     }
     return redirect('auth/login');
 }
开发者ID:peco8,项目名称:senseicloud-1.0,代码行数:27,代码来源:EmailAddressController.php

示例15: logout

 public function logout()
 {
     \Auth::logout();
     return view('loggedOut');
 }
开发者ID:Zizazao,项目名称:guitaleletabs,代码行数:5,代码来源:loggedController.php


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