本文整理汇总了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('/');
}
示例2: action_logout
public function action_logout()
{
if (Sentry::check()) {
Sentry::logout();
echo json_encode(array('status' => 'ok'));
}
}
示例3: logout
public function logout()
{
//Logout User
Sentry::logout();
//Redirect user ke halaman Login
return Redirect::to('/')->with('successMessage', 'Anda Berhasil logout.');
}
示例4: getLogout
public function getLogout()
{
if (Sentry::check()) {
Sentry::logout();
return Redirect::route('index');
}
}
示例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);
}
示例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');
}
}
示例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 !');
}
示例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');
}
示例9: logout
public function logout()
{
try {
Sentry::logout();
$data = Citrus::response('success', 1);
} catch (Exception $e) {
$data = Citrus::response('error', $e);
}
return $data;
}
示例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('');
}
}
示例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();
}
示例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();
}
示例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();
}
示例14: doUserLogout
public function doUserLogout()
{
Sentry::logout();
return Response::json(array());
}
示例15: destroy
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id = null)
{
Sentry::logout();
return Redirect::intended('/');
}