<?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]
 */
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();
			Auth::instance()->logout();
			$ao->log('Logged Out');

			HTTP::redirect('login');
		}

		HTTP::redirect('welcome/index');
	}
}
?>