當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。