當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Auth::logout方法代碼示例

本文整理匯總了PHP中Auth::logout方法的典型用法代碼示例。如果您正苦於以下問題:PHP Auth::logout方法的具體用法?PHP Auth::logout怎麽用?PHP Auth::logout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Auth的用法示例。


在下文中一共展示了Auth::logout方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: action_logout

 public function action_logout()
 {
     if ($this->_auth->logout()) {
         $this->_message = __("Logout succeeded");
         $this->_user = NULL;
     } else {
         $this->_message = __("Couldn't logout");
     }
 }
開發者ID:ragchuck,項目名稱:ra-Log,代碼行數:9,代碼來源:auth.php

示例2: anySignout

 /**
  * anySignout
  * --------------------------------------------------
  * @return Signs out the user
  * --------------------------------------------------
  */
 public function anySignout()
 {
     /* Sign out the user */
     Auth::logout();
     /* Redirect and add bye message */
     return Redirect::route('dashboard.dashboard')->with('success', 'Good bye.');
 }
開發者ID:neraunzaran,項目名稱:fruit-dashboard,代碼行數:13,代碼來源:AuthController.php

示例3: logout

 public function logout()
 {
     Session::forget('ltime');
     Session::forget('sescode');
     Auth::logout();
     return Response::json(array('flash' => 'Logged Out !'));
 }
開發者ID:rshewade,項目名稱:laravel_angular,代碼行數:7,代碼來源:AuthController.php

示例4: getLogout

 public function getLogout()
 {
     if (Auth::check()) {
         Auth::logout();
     }
     return Redirect::to('/');
 }
開發者ID:EdgardoPitti,項目名稱:plagetri21,代碼行數:7,代碼來源:AuthController.php

示例5: logout

 public function logout()
 {
     if (Auth::check()) {
         Auth::logout();
     }
     return Redirect::route('frontpage');
 }
開發者ID:Geekathon,項目名稱:reddit-clone,代碼行數:7,代碼來源:UserController.php

示例6: doLogout

 public function doLogout()
 {
     //Desconctamos al usuario
     Auth::logout();
     //Redireccionamos al inicio de la app con un mensaje
     return Redirect::to('/login')->with('msg-logout', 'Sesión finalizada correctamente.');
 }
開發者ID:Badillo,項目名稱:hospitalcatalina-web,代碼行數:7,代碼來源:AuthController.php

示例7: destroy

 /**
  * Remove the specified resource from storage.
  * DELETE /sessions/{id}
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy()
 {
     if (!Auth::guest()) {
         Auth::logout();
     }
     return Redirect::to('/');
 }
開發者ID:udayrockstar,項目名稱:RestaurantManager,代碼行數:14,代碼來源:SessionsController.php

示例8: logout

 /**
  * Log user out of system.
  */
 public function logout()
 {
     Auth::logout();
     Session::flush();
     // Clear *ALL* session data!
     return Redirect::to('login')->with('message', 'You have logged out.');
 }
開發者ID:marciocamello,項目名稱:laravel-ecommerce,代碼行數:10,代碼來源:CustomersController.php

示例9: postIndex

 public function postIndex()
 {
     if (Input::has('changepw')) {
         $rules = array('oldPass' => 'required', 'newPass1' => 'required|min:8', 'newPass2' => 'required|min:8|same:newPass1');
         $input = Input::all();
         $validator = Validator::make($input, $rules);
         if ($validator->fails()) {
             return Redirect::to('/account')->withErrors($validator);
         }
         $user = Auth::user();
         if (!Auth::validate(array('name' => $user->name, 'password' => $input['oldPass']))) {
             return Redirect::to('/account')->withErrors(array('message' => 'You have entered a wrong password.'));
         }
         $user->password = Hash::make($input['newPass2']);
         $user->save();
         return Redirect::to('/account');
     } elseif (Input::has('removeacc')) {
         $rules = array('remPass' => 'required|min:8');
         $input = Input::all();
         $validator = Validator::make($input, $rules);
         if ($validator->fails()) {
             return Redirect::to('/account')->withErrors($validator);
         }
         $user = Auth::user();
         if (!Auth::validate(array('name' => $user->name, 'password' => $input['oldPass']))) {
             return Redirect::to('/account')->withErrors(array('message' => 'You have entered a wrong password.'));
         }
         $user->delete();
         Auth::logout();
         return Redirect::to('/');
     }
 }
開發者ID:matrefeytontias,項目名稱:ndless-apps,代碼行數:32,代碼來源:AccountController.php

示例10: getLogout

 public function getLogout()
 {
     Auth::logout();
     Session::flush();
     // Redirect to homepage
     return Redirect::to('/')->with('success', 'You have been successfully logged out');
 }
開發者ID:alexixim,項目名稱:blood-bank,代碼行數:7,代碼來源:AuthController.php

示例11: doSignOut

 public function doSignOut()
 {
     $categories = DB::table('categories')->select('name')->get();
     $lastPosts = DB::table('posts')->orderBy('id', "DESC")->limit(6)->get();
     Auth::logout();
     return Redirect::route("index")->with('results', ['categories' => $categories, 'lastPosts' => $lastPosts]);
 }
開發者ID:NevDK91,項目名稱:laravelBlog,代碼行數:7,代碼來源:UsersController.php

示例12: logout

 public function logout()
 {
     $data = [Auth::user()->full_name, Auth::user()->email, Auth::user()->tipo];
     Auth::logout();
     $this->setAuditoria('acceso', 'logout', $data);
     return Redirect::route('inicio');
 }
開發者ID:jogs78,項目名稱:talleres,代碼行數:7,代碼來源:AuthController.php

示例13: getLogout

 function getLogout()
 {
     Session::forget('username');
     Session::forget('password');
     Auth::logout();
     return Redirect::to('/login');
 }
開發者ID:imranshuvo,項目名稱:QuizzApps,代碼行數:7,代碼來源:LoginController.php

示例14: logout

 public function logout()
 {
     // OTURUMU SONLANDIRALIM
     Auth::logout();
     // KULLANICIYI SORULAR SAYFASINA YÖNLENDİRELİM
     return Redirect::route('allQuestions');
 }
開發者ID:burak-tekin,項目名稱:laravel-ornek-uygulama,代碼行數:7,代碼來源:UserController.php

示例15: profileSave

 public function profileSave()
 {
     $json_request = array('status' => FALSE, 'responseText' => '', 'redirectURL' => FALSE);
     $validator = Validator::make(Input::all(), Accounts::$update_rules);
     if ($validator->passes()) {
         $post = Input::all();
         if (self::accountUpdate($post)) {
             $result = self::crmAccountUpdate($post);
             if ($result === -1) {
                 Auth::logout();
                 $json_request['responseText'] = Config::get('api.message');
                 $json_request['redirectURL'] = pageurl('auth');
                 return Response::json($json_request, 200);
             }
             $json_request['redirectURL'] = URL::route('dashboard');
             $json_request['responseText'] = Lang::get('interface.DEFAULT.success_save');
             $json_request['status'] = TRUE;
         } else {
             $json_request['responseText'] = Lang::get('interface.DEFAULT.fail');
         }
     } else {
         $json_request['responseText'] = $validator->messages()->all();
     }
     if (Request::ajax()) {
         return Response::json($json_request, 200);
     } else {
         return Redirect::route('dashboard');
     }
 }
開發者ID:Grapheme,項目名稱:lipton,代碼行數:29,代碼來源:participant.controller.php


注:本文中的Auth::logout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。