This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/application/classes/lnapp/controller/logout.php

29 lines
688 B
PHP
Raw Normal View History

2010-11-29 22:41:08 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides logout capability
*
* @package lnApp
* @subpackage Page/Logout
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
* @also [login]
*/
2012-01-29 10:08:54 +00:00
class lnApp_Controller_Logout extends Controller {
2010-11-29 22:41:08 +00:00
public function action_index() {
# If user already signed-in
if (Auth::instance()->logged_in()!= 0) {
2011-09-27 11:22:13 +00:00
$ao = Auth::instance()->get_user();
2010-11-29 22:41:08 +00:00
Auth::instance()->logout();
2011-09-27 11:22:13 +00:00
$ao->log('Logged Out');
2010-11-29 22:41:08 +00:00
2011-05-14 07:35:33 +00:00
Request::current()->redirect('login');
2010-11-29 22:41:08 +00:00
}
2011-05-14 07:35:33 +00:00
Request::current()->redirect('welcome/index');
2010-11-29 22:41:08 +00:00
}
}
?>