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


PHP Auth::logout方法代码示例

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


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

示例1: mainController

 /**
  * Main Notes Form Controller
  */
 public function mainController()
 {
     //get whos login
     $user_id = \Auth::user()->id;
     session_start();
     session_regenerate_id();
     if (!isset($_SESSION["timer"])) {
         $_SESSION["timer"] = time();
     }
     if (time() - $_SESSION["timer"] > 20 * 60) {
         $user = User::find($user_id);
         Auth::logout($user);
         unset($_SESSION["timer"]);
         return view('auth.login')->with('timeout', "you been logout for inactivity");
     }
     $fileErrors = $this->updateNotes($user_id);
     //initial queries
     $notes = Notes::where('user_id', '=', $user_id)->first()->mynotes;
     $tbd = Tbd::where('user_id', '=', $user_id)->first()->mytbd;
     $linksArray = \App\Websites::where('user_id', $user_id)->first()->mylink;
     $image = DB::table('myimages')->where('user_id', $user_id)->lists('myimage', 'id');
     $website = explode(',', $linksArray);
     $_SESSION["timer"] = time();
     return view('home', compact('notes', 'tbd', 'website', 'image', 'fileErrors'));
 }
开发者ID:joxtoyod,项目名称:NotesToMySelf,代码行数:28,代码来源:NotesFormController.php

示例2: home

 /**
  * Log the user out of the application.
  *
  * @return \Illuminate\Http\Response
  */
 public function home()
 {
     Auth::logout();
     //return route('register');
     //return "Hola";
     return redirect(route('register'));
 }
开发者ID:nbarazarte,项目名称:neeladmintroovami,代码行数:12,代码来源:HomeController.php

示例3: getLogout

 /**
  * Log the user out of the application.
  *
  * @param Session $session
  * @return \Illuminate\Http\Response
  */
 public function getLogout(Session $session)
 {
     event(new UserWasLoggedOut($session->getSession()));
     $session->setOffline();
     Auth::logout();
     return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
开发者ID:osvaldino,项目名称:chat,代码行数:13,代码来源:AuthenticatesUsers.php

示例4: getLogout

 public function getLogout()
 {
     if (Auth::check()) {
         Auth::logout();
     }
     return Redirect::to('index')->with('message', '你现在已经退出登录了!');
 }
开发者ID:edom-huang,项目名称:myweb,代码行数:7,代码来源:UsersController.php

示例5: logout

 public function logout()
 {
     $seguranca = new DPRFSeguranca(config("PRF.siglaSistema"), config("PRF.producao"));
     $seguranca->auditoria(Auth::user()->cpf, "LOGOUT", "Logout", array());
     Auth::logout();
     return Redirect::to("/");
 }
开发者ID:vlamirc,项目名称:arquetipophp,代码行数:7,代码来源:LoginController.php

示例6: doLogout

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

示例7: doLogout

 public function doLogout()
 {
     if (Auth::check()) {
         Auth::logout();
         return redirect('/');
     }
 }
开发者ID:mg9,项目名称:koalaBazaar,代码行数:7,代码来源:AuthenticationController.php

示例8: filter

 /**
  * @return mixed
  */
 public function filter()
 {
     if (!Auth::check() or !Auth::user()->is('admin')) {
         Auth::logout();
         return Redirect::route('admin.login.index');
     }
 }
开发者ID:itmyprofession,项目名称:admin,代码行数:10,代码来源:AuthFilter.php

示例9: __construct

 /**
  * Create a new password controller instance.
  *
  * @return void
  */
 public function __construct()
 {
     if (Auth::check()) {
         Auth::logout();
     }
     $this->middleware('guest');
 }
开发者ID:nashultz,项目名称:fclla,代码行数:12,代码来源:PasswordController.php

示例10: logout

 /**
  * 用户登出
  */
 public function logout()
 {
     if (Auth::check()) {
         Auth::logout();
     }
     return Redirect::route('login');
 }
开发者ID:jiangyukun,项目名称:jingou,代码行数:10,代码来源:AuthorityController.php

示例11: logout

 public function logout()
 {
     if (Auth::check()) {
         Auth::logout();
     }
     return redirect('/')->with('message', '注销成功!');
 }
开发者ID:bajian,项目名称:BiliPusher,代码行数:7,代码来源:AuthController.php

示例12: getLogout

 /**
  * Logout the user
  * 
  * @return Redirect
  */
 public function getLogout()
 {
     //Logout the user
     Auth::logout();
     //Redirect to login page
     return Redirect::to('admin/login')->with('success', Lang::get('firadmin::admin.messages.logout-success'));
 }
开发者ID:firalabs,项目名称:firadmin,代码行数:12,代码来源:LoginController.php

示例13: getLogout

 public function getLogout()
 {
     Auth::logout();
     Session::flush();
     return redirect('/admin/login');
     //return redirect(property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/');
 }
开发者ID:furqank786,项目名称:blog,代码行数:7,代码来源:AdminController.php

示例14: postReset

 public function postReset(PasswordResetRequest $request)
 {
     /*
     if($request['new_user'] == "" && $request['new_password'] == "")
     {
         return redirect()->route('user_reset');
     }
     */
     //$user = User::where('password', '=', bcrypt($request['password']))->count();
     //$password = bcrypt($request['password']);
     $user = User::where('user', '=', $request['user'])->get();
     if ($user->count()) {
         $userEdit = User::find($user[0]->id);
         if ($userEdit->id != Auth::user()->id) {
             $errors = array("0" => "Las credenciales no coinciden con el usuario autentificado actualmente!");
             return $request->response($errors);
         }
         if ($request['new_user'] != "") {
             $userEdit->user = $request['new_user'];
         }
         if ($request['new_password'] != "") {
             $userEdit->password = bcrypt($request['new_password']);
         }
         $userEdit->save();
         //***//
         Auth::logout();
         return redirect()->route('login')->with('message', 'resetok');
     } else {
         $errors = array("0" => "Usuario no identificado");
         return $request->response($errors);
     }
 }
开发者ID:luigilapa,项目名称:sapeap,代码行数:32,代码来源:PasswordController.php

示例15: getLogout

 public function getLogout()
 {
     Auth::logout();
     $this->login = false;
     $this->user = null;
     return "Volte a qualquer momento";
 }
开发者ID:talvanes,项目名称:code-commerce,代码行数:7,代码来源:TestController.php


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