2000-08-18 05:24:22 +02:00
|
|
|
<?php
|
2001-03-31 13:43:14 +02:00
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare *
|
|
|
|
* http://www.phpgroupware.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. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
2004-01-10 15:48:09 +01:00
|
|
|
$phpgw_info = array();
|
2001-08-21 20:34:56 +02:00
|
|
|
$GLOBALS['phpgw_info']['flags'] = array(
|
2004-01-10 15:48:09 +01:00
|
|
|
'disable_Template_class' => True,
|
2001-03-31 13:43:14 +02:00
|
|
|
'currentapp' => 'logout',
|
|
|
|
'noheader' => True,
|
|
|
|
'nofooter' => True,
|
|
|
|
'nonavbar' => True
|
|
|
|
);
|
|
|
|
include('./header.inc.php');
|
|
|
|
|
2003-08-28 16:16:30 +02:00
|
|
|
$GLOBALS['sessionid'] = get_var('sessionid',array('GET','COOKIE'));
|
|
|
|
$GLOBALS['kp3'] = get_var('kp3',array('GET','COOKIE'));
|
2001-08-21 20:34:56 +02:00
|
|
|
|
|
|
|
$verified = $GLOBALS['phpgw']->session->verify();
|
2003-08-28 16:16:30 +02:00
|
|
|
if ($verified)
|
2001-03-31 13:43:14 +02:00
|
|
|
{
|
2003-08-28 16:16:30 +02:00
|
|
|
if (file_exists($GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . $GLOBALS['sessionid']))
|
2001-03-31 13:43:14 +02:00
|
|
|
{
|
2001-08-21 20:34:56 +02:00
|
|
|
$dh = opendir($GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . $GLOBALS['sessionid']);
|
2003-08-28 16:16:30 +02:00
|
|
|
while ($file = readdir($dh))
|
2001-03-31 13:43:14 +02:00
|
|
|
{
|
2003-08-28 16:16:30 +02:00
|
|
|
if ($file != '.' && $file != '..')
|
2001-03-31 13:43:14 +02:00
|
|
|
{
|
2001-08-21 20:34:56 +02:00
|
|
|
unlink($GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . $GLOBALS['sessionid'] . SEP . $file);
|
2001-03-31 13:43:14 +02:00
|
|
|
}
|
|
|
|
}
|
2001-08-21 20:34:56 +02:00
|
|
|
rmdir($GLOBALS['phpgw_info']['server']['temp_dir'] . SEP . $GLOBALS['sessionid']);
|
2001-03-31 13:43:14 +02:00
|
|
|
}
|
2002-01-02 15:33:05 +01:00
|
|
|
$GLOBALS['phpgw']->hooks->process('logout');
|
2001-09-28 23:40:45 +02:00
|
|
|
$GLOBALS['phpgw']->session->destroy($GLOBALS['sessionid'],$GLOBALS['kp3']);
|
2001-03-31 13:43:14 +02:00
|
|
|
}
|
2001-08-05 11:19:08 +02:00
|
|
|
else
|
|
|
|
{
|
2001-12-12 17:48:52 +01:00
|
|
|
if(is_object($GLOBALS['phpgw']->log))
|
2001-12-12 17:09:41 +01:00
|
|
|
{
|
|
|
|
$GLOBALS['phpgw']->log->write(array(
|
|
|
|
'text' => 'W-VerifySession, could not verify session during logout',
|
|
|
|
'line' => __LINE__,
|
|
|
|
'file' => __FILE__
|
|
|
|
));
|
|
|
|
}
|
2001-08-05 11:19:08 +02:00
|
|
|
}
|
2003-08-28 16:16:30 +02:00
|
|
|
$GLOBALS['phpgw']->session->phpgw_setcookie('sessionid');
|
|
|
|
$GLOBALS['phpgw']->session->phpgw_setcookie('kp3');
|
|
|
|
$GLOBALS['phpgw']->session->phpgw_setcookie('domain');
|
|
|
|
if($GLOBALS['phpgw_info']['server']['sessions_type'] == 'php4')
|
2002-03-04 01:59:29 +01:00
|
|
|
{
|
2003-08-28 16:16:30 +02:00
|
|
|
$GLOBALS['phpgw']->session->phpgw_setcookie(PHPGW_PHPSESSID);
|
2002-03-04 01:59:29 +01:00
|
|
|
}
|
2001-03-31 13:43:14 +02:00
|
|
|
|
2003-08-28 16:16:30 +02:00
|
|
|
$GLOBALS['phpgw']->redirect($GLOBALS['phpgw_info']['server']['webserver_url'].'/login.php?cd=1');
|
2001-12-12 17:09:41 +01:00
|
|
|
?>
|