| [ PHPXref.com ] | [ Generated: Sun Jul 20 17:10:18 2008 ] | [ DCL 0.9.4.4 ] |
| [ Index ] [ Variables ] [ Functions ] [ Classes ] [ Constants ] [ Statistics ] | ||
[Summary view] [Print] [Text view]
1 <?php 2 /* 3 * $Id: logout.php,v 1.1.2.4 2003/12/14 01:09:26 mdean Exp $ 4 * 5 * Double Choco Latte - Source Configuration Management System 6 * Copyright (C) 1999 Michael L. Dean & Tim R. Norman 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License 10 * as published by the Free Software Foundation; either version 2 11 * of the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 21 * 22 * Select License Info from the Help menu to view the terms and conditions of this license. 23 */ 24 25 if (!defined('__DCL_CONFIG_INCLUDED__')) 26 include('inc/config.php'); 27 28 include (DCL_ROOT . 'inc/functions.inc.php'); 29 30 $g_oSession = CreateObject('dcl.dbSession'); 31 list($dcl_session_id, $DOMAIN) = explode('/', $HTTP_COOKIE_VARS['DCLINFO']); 32 if (strlen($dcl_session_id) == 32) 33 { 34 $g_oSession->Connect(); 35 if (!$g_oSession->conn) 36 Refresh(DCL_WWW_ROOT . 'index.php?cd=3'); 37 38 if ($g_oSession->Load($dcl_session_id) == false) 39 Refresh(DCL_WWW_ROOT . 'index.php?cd=2'); 40 41 if ($g_oSession->IsValidSession()) 42 { 43 $g_oSession->Delete($g_oSession->dcl_session_id); 44 $g_oSession->Clear(); 45 } 46 } 47 48 Refresh(DCL_WWW_ROOT . 'index.php?cd=4'); 49 50 function Refresh($toHere = 'index.php', $session_id = '', $domain = 'default') 51 { 52 global $DCLINFO, $DCLUI; 53 if (!empty($_SERVER)) 54 extract($_SERVER); 55 else if (!empty($HTTP_SERVER_VARS)) 56 extract($HTTP_SERVER_VARS); 57 58 $bIsLogin = (substr($toHere, 0, 9) == 'index.php'); 59 60 if ($bIsLogin) 61 { 62 $theCookie = ''; 63 if (IsSet($QUERY_STRING) && $QUERY_STRING != '') 64 $toHere .= sprintf('%srefer_to=%s', strpos($toHere, '?') > 0 ? '&' : '?', urlencode($QUERY_STRING)); 65 } 66 else 67 $theCookie = $session_id . '/' . $domain; 68 69 if (DCL_COOKIE_METHOD == 'header') 70 { 71 $hdr = ''; 72 if ($GLOBALS['redirMethod'] == 'php') 73 $hdr = "Location: $toHere\n"; 74 75 $hdr .= "Set-Cookie: DCLINFO=$theCookie\n"; 76 $hdr .= "\n"; 77 78 Header($hdr); 79 if ($bIsLogin) 80 exit; 81 } 82 83 if (DCL_COOKIE_METHOD == 'php') 84 { 85 $httpDomain = ''; 86 if (ereg('^[0-9]{2,3}\.[0-9]{2,3}\.[0-9]{2,3}\.[0-9]{2,3}$', $HTTP_HOST)) 87 { 88 $httpDomain = $HTTP_HOST; 89 } 90 else if (ereg('.*\..*$', $HTTP_HOST)) 91 { 92 $httpDomain = eregi_replace('^www\.', '', $HTTP_HOST); 93 $httpDomain = '.' . $httpDomain; 94 } 95 96 SetCookie('DCLINFO', $theCookie, 0, '/', $httpDomain); 97 98 if (DCL_REDIR_METHOD == 'php') 99 { 100 Header("Location: $toHere\n\n"); 101 if ($bIsLogin) 102 exit; 103 } 104 } 105 106 print('<html><head>'); 107 108 if (DCL_COOKIE_METHOD == 'meta') 109 { 110 print("<meta http-equiv=\"Set-Cookie\" content=\"DCLINFO=$theCookie\">"); 111 } 112 113 print("<meta http-equiv=\"refresh\" content=\"00;URL=$toHere\">"); 114 print('</head>'); 115 if ($bIsLogin) 116 { 117 print('<body bgcolor="#FFFFFF"></body></html>'); 118 exit; 119 } 120 } 121 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| [ Powered by PHPXref - Served by Debian GNU/Linux ] |