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

29 lines
655 B
PHP
Raw Normal View History

2013-04-22 05:50:28 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides logout capability
*
* @package lnApp
2013-10-08 23:24:11 +00:00
* @category Controllers
2013-04-22 05:50:28 +00:00
* @author Deon George
* @copyright (c) 2009-2013 Deon George
* @license http://dev.leenooks.net/license.html
* @also [login]
*/
2014-10-22 00:18:56 +00:00
abstract class lnApp_Controller_Logout extends Controller {
2013-04-22 05:50:28 +00:00
public function action_index() {
// If user already signed-in
2013-04-25 00:22:36 +00:00
if (Auth::instance()->logged_in()) {
2013-04-22 05:50:28 +00:00
$ao = Auth::instance()->get_user();
if (method_exists($ao,'log'))
$ao->log('Logged Out');
2013-04-25 00:22:36 +00:00
Auth::instance()->logout(TRUE);
2013-04-22 05:50:28 +00:00
}
HTTP::redirect('welcome/index');
}
}
?>