egroupware/logout.php

58 lines
2.1 KiB
PHP
Raw Normal View History

2000-08-18 05:24:22 +02:00
<?php
2001-03-31 13:43:14 +02:00
/**************************************************************************\
2007-02-28 04:33:37 +01:00
* eGroupWare *
* http://www.egroupware.org *
* Written by Joseph Engo <jengo@phpgroupware.org> *
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
2001-03-31 13:43:14 +02:00
/* $Id$ */
$GLOBALS['egw_info'] = array(
'flags' => array(
'disable_Template_class' => True,
'currentapp' => 'logout',
'noheader' => True,
'nofooter' => True,
'nonavbar' => True
)
2001-03-31 13:43:14 +02:00
);
include('./header.inc.php');
$GLOBALS['sessionid'] = get_var('sessionid',array('GET','COOKIE'));
$GLOBALS['kp3'] = get_var('kp3',array('GET','COOKIE'));
$verified = $GLOBALS['egw']->session->verify();
2007-02-28 04:33:37 +01:00
if(!$redirectTarget = $GLOBALS['egw']->session->appsession('referer', 'login'))
{
$redirectTarget = $GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=1&domain='.$GLOBALS['egw_info']['user']['domain'];
}
2007-02-28 04:33:37 +01:00
if($verified)
2001-03-31 13:43:14 +02:00
{
$GLOBALS['egw']->hooks->process('logout');
$GLOBALS['egw']->session->destroy($GLOBALS['sessionid'],$GLOBALS['kp3']);
2001-03-31 13:43:14 +02:00
}
2001-08-05 11:19:08 +02:00
else
{
if(is_object($GLOBALS['egw']->log))
2001-12-12 17:09:41 +01:00
{
$GLOBALS['egw']->log->write(array(
2001-12-12 17:09:41 +01:00
'text' => 'W-VerifySession, could not verify session during logout',
'line' => __LINE__,
'file' => __FILE__
));
}
2001-08-05 11:19:08 +02:00
}
$GLOBALS['egw']->session->egw_setcookie('eGW_remember','',0,'/');
$GLOBALS['egw']->session->egw_setcookie('sessionid');
$GLOBALS['egw']->session->egw_setcookie('kp3');
$GLOBALS['egw']->session->egw_setcookie('domain');
$GLOBALS['egw']->redirect($redirectTarget);