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


PHP Sentry::logout方法代碼示例

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


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

示例1: logout

 public function logout()
 {
     if (Sentry::check()) {
         Sentry::logout();
     }
     return Redirect::to('/');
 }
開發者ID:noubodi,項目名稱:pretexts,代碼行數:7,代碼來源:SentryController.php

示例2: action_logout

 public function action_logout()
 {
     if (Sentry::check()) {
         Sentry::logout();
         echo json_encode(array('status' => 'ok'));
     }
 }
開發者ID:quickpacket,項目名稱:noclayer,代碼行數:7,代碼來源:ajax.php

示例3: logout

 public function logout()
 {
     //Logout User
     Sentry::logout();
     //Redirect user ke halaman Login
     return Redirect::to('/')->with('successMessage', 'Anda Berhasil logout.');
 }
開發者ID:albertxiao,項目名稱:Koperasi,代碼行數:7,代碼來源:HomeController.php

示例4: getLogout

 public function getLogout()
 {
     if (Sentry::check()) {
         Sentry::logout();
         return Redirect::route('index');
     }
 }
開發者ID:minnb,項目名稱:vitduct,代碼行數:7,代碼來源:AuthController.php

示例5: before

 public function before()
 {
     parent::before();
     // if user not connected and not on the login, 404 or session_up pages then redirect to login page
     if (Request::active()->action != 'login' && !Sentry::check() && Request::active()->action != '404' && Request::active()->action != 'session_up') {
         Session::set(array('redirect' => Request::active()->route->translation));
         Response::redirect('login');
     }
     $this->current_user = self::current_user();
     View::set_global('current_user', self::current_user());
     if (Sentry::check()) {
         // logout if banned
         if (Sentry::attempts($this->current_user->username)->get() == Sentry::attempts()->get_limit()) {
             Session::set_flash('Your account has been blocked');
             Sentry::logout();
             Response::redirect('login');
         }
     }
     View::set_global('site_title', 'IKON Backend');
     View::set_global('separator', '/');
     foreach (Model_Forms::find('all') as $k => $form) {
         $this->tables[$k]['cleanName'] = $form->cleanName;
         $this->tables[$k]['url'] = $form->url;
         $this->tables[$k]['table'] = $form->table;
     }
     View::set_global('tables', $this->tables);
 }
開發者ID:roine,項目名稱:wawaw,代碼行數:27,代碼來源:base.php

示例6: logoutAction

 /**
  * @description if logged in will logout session and redirect to /index
  * @return void or redirects to login page
  */
 public function logoutAction()
 {
     if (Sentry::check()) {
         Sentry::logout();
         return $this->response->redirect('index');
     }
 }
開發者ID:webkitz,項目名稱:phalcon-mailgun,代碼行數:11,代碼來源:ControllerBase.php

示例7: getLogout

 /**
  * Logout page.
  *
  * @return Redirect
  */
 public function getLogout()
 {
     // Log the user out
     Sentry::logout();
     // Redirect to the users page
     return Redirect::route('home')->with('flash_error', 'Good Bye !');
 }
開發者ID:marcianobarros20,項目名稱:ncryptd,代碼行數:12,代碼來源:AuthController.php

示例8: destroy

 /**
  * Remove the specified session from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy()
 {
     if (!Sentry::getUser()) {
         return Redirect::route('sessions.create');
     }
     Sentry::logout();
     return Redirect::route('sessions.create');
 }
開發者ID:dynamicsystems,項目名稱:TechTracker,代碼行數:14,代碼來源:SessionsController.php

示例9: logout

 public function logout()
 {
     try {
         Sentry::logout();
         $data = Citrus::response('success', 1);
     } catch (Exception $e) {
         $data = Citrus::response('error', $e);
     }
     return $data;
 }
開發者ID:hackGFS,項目名稱:api,代碼行數:10,代碼來源:AuthController.php

示例10: action_logout

 public function action_logout()
 {
     if (Sentry::login()) {
         Session::set_flash('success', 'successfuly logged out');
         Sentry::logout();
     } else {
         Session::set_flash('warning', 'You\'re not logged in');
         Response::redirect('');
     }
 }
開發者ID:roine,項目名稱:wawaw,代碼行數:10,代碼來源:admin.php

示例11: before

 public function before()
 {
     //remove all data from previus installation....
     Sentry::logout();
     Config::load('Sentry', true);
     Cookie::delete('sentry_rm');
     Session::delete(Config::get('sentry.session.user'));
     Session::delete(Config::get('sentry.session.provider'));
     parent::before();
 }
開發者ID:quickpacket,項目名稱:noclayer,代碼行數:10,代碼來源:installbasic.php

示例12: setUp

 /**
  * Default preparation for each test
  */
 public function setUp()
 {
     parent::setUp();
     // Migrate database
     Artisan::call('migrate');
     // Do not send mails
     Mail::pretend(true);
     // To create test models
     Model::unguard();
     // Logout - just to be sure
     \Sentry::logout();
 }
開發者ID:rafaelvieiras,項目名稱:connect,代碼行數:15,代碼來源:TestCase.php

示例13: testBasicUserTypes

 /**
  * Test the two basic user types
  *
  */
 public function testBasicUserTypes()
 {
     $this->assertTrue(Sentry::getUser() == NULL, 'User should not be logged in initially.');
     $admin = Sentry::findUserByLogin($this->adminEmail);
     $this->assertTrue($admin != NULL, 'Admin account not found.');
     $user = Sentry::findUserByLogin($this->userEmail);
     $this->assertTrue($user != NULL, 'User account not found.');
     Sentry::setUser($user);
     $this->assertTrue(Sentry::check(), 'User not logged in.');
     Sentry::setUser($admin);
     $this->assertTrue(Sentry::check(), 'Admin not logged in.');
     Sentry::logout();
 }
開發者ID:marmaray,項目名稱:L4withSentry,代碼行數:17,代碼來源:UserControllerTest.php

示例14: doUserLogout

 public function doUserLogout()
 {
     Sentry::logout();
     return Response::json(array());
 }
開發者ID:OlesKashchenko,項目名稱:SkillsProject2,代碼行數:5,代碼來源:UserCabinetController.php

示例15: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id = null)
 {
     Sentry::logout();
     return Redirect::intended('/');
 }
開發者ID:ArbindJain,項目名稱:scrapkart,代碼行數:11,代碼來源:SessionsController.php


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