diff --git a/presentation/logout.php b/presentation/logout.php index 2042986..f058943 100644 --- a/presentation/logout.php +++ b/presentation/logout.php @@ -1,36 +1,19 @@ , Jam Warehouse (Pty) Ltd, South Africa - */ - -// main library routines and defaults require_once("../config/dmsDefaults.php"); +require_once(KT_LIB_DIR . '/authentication/authenticationutil.inc.php'); + +class KTLogoutDispatcher extends KTStandardDispatcher { + function do_main() { + global $default; -// logout -$oAuth = new $default->authenticationClass; -$oAuth->logout(); + $oAuthenticator =& KTAuthenticationUtil::getAuthenticatorForUser($this->oUser); + $oAuthenticator->logout($this->oUser); + Session::destroy(); -// redirect to root -redirect((strlen($default->rootUrl) > 0 ? $default->rootUrl : "/")); + redirect((strlen($default->rootUrl) > 0 ? $default->rootUrl : "/")); + exit(0); + } +} +$d =& new KTLogoutDispatcher; +$d->dispatch(); ?>