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.
lnapp/classes/lnApp/Controller/Logout.php
2013-04-22 15:50:28 +10:00

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');
}
}
?>