31 lines
682 B
PHP
31 lines
682 B
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
* This class provides logout capability
|
|
*
|
|
* @package lnApp
|
|
* @category lnApp/Controllers
|
|
* @author Deon George
|
|
* @copyright (c) 2009-2013 Deon George
|
|
* @license http://dev.leenooks.net/license.html
|
|
* @also [login]
|
|
*/
|
|
class lnApp_Controller_Logout extends Controller {
|
|
public function action_index() {
|
|
// If user already signed-in
|
|
if (Auth::instance()->logged_in() != 0) {
|
|
$ao = Auth::instance()->get_user();
|
|
|
|
if (method_exists($ao,'log'))
|
|
$ao->log('Logged Out');
|
|
|
|
Auth::instance()->logout();
|
|
|
|
HTTP::redirect('login');
|
|
}
|
|
|
|
HTTP::redirect('welcome/index');
|
|
}
|
|
}
|
|
?>
|