2004-10-20 23:06:45 +02:00
|
|
|
<?php
|
2004-07-27 16:56:03 +02:00
|
|
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
2004-08-14 15:17:07 +02:00
|
|
|
* Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
|
|
|
|
|
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
2003-08-30 14:17:08 +02:00
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*/
|
2003-10-28 12:03:40 +01:00
|
|
|
|
2005-07-07 02:44:49 +02:00
|
|
|
/**
|
|
|
|
|
\file htdocs/user/logout.php
|
|
|
|
|
\brief Fichier de deconnexion
|
2008-05-02 03:10:00 +02:00
|
|
|
\version $Id$
|
2003-10-28 12:03:40 +01:00
|
|
|
*/
|
2004-08-14 15:17:07 +02:00
|
|
|
|
2008-05-02 03:10:00 +02:00
|
|
|
if ($_SESSION["dol_authmode"] == 'forceuser'
|
|
|
|
|
&& $_SESSION["dol_authmode"] == 'http')
|
|
|
|
|
{
|
2008-05-02 08:39:53 +02:00
|
|
|
die("Disconnection does not work when connection was made in mode ".$_SESSION["dol_authmode"]);
|
2008-05-02 03:10:00 +02:00
|
|
|
}
|
2004-07-27 16:56:03 +02:00
|
|
|
|
2004-07-27 17:00:52 +02:00
|
|
|
include_once("../conf/conf.php");
|
2007-12-31 01:02:26 +01:00
|
|
|
require_once("../main.inc.php");
|
2004-07-27 16:59:53 +02:00
|
|
|
|
2007-10-02 15:54:34 +02:00
|
|
|
// Module Phenix
|
|
|
|
|
if ($conf->phenix->enabled && $conf->phenix->cookie)
|
|
|
|
|
{
|
|
|
|
|
// Destruction du cookie
|
|
|
|
|
setcookie($conf->phenix->cookie, '', 1, "/");
|
|
|
|
|
}
|
2006-07-02 02:43:40 +02:00
|
|
|
|
|
|
|
|
dolibarr_syslog("End session in DOLSESSID_".$dolibarr_main_db_name);
|
|
|
|
|
|
2007-12-31 01:02:26 +01:00
|
|
|
session_destroy();
|
2008-10-12 13:41:13 +02:00
|
|
|
|
|
|
|
|
// Init session
|
2008-10-10 22:39:16 +02:00
|
|
|
$sessionname="DOLSESSID_".$dolibarr_main_db_name;
|
2008-10-12 13:41:13 +02:00
|
|
|
if (! empty($conf->global->MAIN_SESSION_TIMEOUT)) ini_set('session.gc_maxlifetime',$conf->global->MAIN_SESSION_TIMEOUT);
|
2008-10-10 22:39:16 +02:00
|
|
|
session_name($sessionname);
|
2006-07-02 02:43:40 +02:00
|
|
|
session_start();
|
2008-10-12 13:41:13 +02:00
|
|
|
dolibarr_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"]);
|
|
|
|
|
|
2006-12-13 20:15:43 +01:00
|
|
|
session_unregister("dol_login");
|
2004-07-27 16:56:03 +02:00
|
|
|
|
2007-12-16 11:55:29 +01:00
|
|
|
header("Location: ".DOL_URL_ROOT."/index.php");
|
2003-08-30 11:27:49 +02:00
|
|
|
?>
|