Ticket #843: logoff.php

File logoff.php, 3.4 KB (added by Volker Strähle, 10 years ago)
Line 
1<?php
2/* -----------------------------------------------------------------------------------------
3 $Id: logoff.php 3072 2012-06-18 15:01:13Z hhacker $
4
5 modified eCommerce Shopsoftware
6 http://www.modified-shop.org
7
8 Copyright (c) 2009 - 2013 [www.modified-shop.org]
9 -----------------------------------------------------------------------------------------
10 based on:
11 (c) 2000-2001 The Exchange Project (earlier name of osCommerce)
12 (c) 2002-2003 osCommerce(logoff.php,v 1.12 2003/02/13); www.oscommerce.com
13 (c) 2003 nextcommerce (logoff.php,v 1.16 2003/08/17); www.nextcommerce.org
14 (c) 2006 XT-Commerce (logoff.php 1071 2005-07-22)
15
16 Released under the GNU General Public License
17 -----------------------------------------------------------------------------------------
18 Third Party contribution:
19
20 Credit Class/Gift Vouchers/Discount Coupons (Version 5.10)
21 http://www.oscommerce.com/community/contributions,282
22 Copyright (c) Strider | Strider@oscworks.com
23 Copyright (c Nick Stanko of UkiDev.com, nick@ukidev.com
24 Copyright (c) Andre ambidex@gmx.net
25 Copyright (c) 2001,2002 Ian C Wilson http://www.phesis.org
26
27 Released under the GNU General Public License
28 ---------------------------------------------------------------------------------------*/
29
30include ('includes/application_top.php');
31
32// create smarty elements
33$smarty = new Smarty;
34
35if ($messageStack->size('logoff') > 0) {
36 $smarty->assign('info_message', $messageStack->output('logoff'));
37}
38
39if ($_SESSION['account_type'] == '1' && DELETE_GUEST_ACCOUNT == 'true') {
40 xtc_db_query("DELETE FROM ".TABLE_CUSTOMERS." WHERE customers_id = '".(int)$_SESSION['customer_id']."'");
41 xtc_db_query("DELETE FROM ".TABLE_ADDRESS_BOOK." WHERE customers_id = '".(int)$_SESSION['customer_id']."'");
42 xtc_db_query("DELETE FROM ".TABLE_CUSTOMERS_INFO." WHERE customers_info_id = '".(int)$_SESSION['customer_id']."'");
43 xtc_db_query("DELETE FROM ".TABLE_CUSTOMERS_IP." WHERE customers_id = '".(int)$_SESSION['customer_id']."'");
44}
45
46xtc_session_destroy();
47
48unset ($_SESSION['customer_id']);
49unset ($_SESSION['customer_default_address_id']);
50unset ($_SESSION['customer_first_name']);
51unset ($_SESSION['customer_country_id']);
52unset ($_SESSION['customer_zone_id']);
53unset ($_SESSION['comments']);
54unset ($_SESSION['user_info']);
55unset ($_SESSION['customers_status']);
56unset ($_SESSION['selected_box']);
57unset ($_SESSION['navigation']);
58unset ($_SESSION['shipping']);
59unset ($_SESSION['payment']);
60unset ($_SESSION['ccard']);
61unset ($_SESSION['gv_id']);
62unset ($_SESSION['cc_id']);
63
64$_SESSION['cart']->reset();
65
66// write customers status guest in session again
67//require (DIR_WS_INCLUDES.'write_customers_status.php'); // webald - included already in application_top.php
68write_customers_status_in_session(); // webald
69
70// include boxes
71require (DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/source/boxes.php');
72
73$breadcrumb->add(NAVBAR_TITLE_LOGOFF);
74
75require (DIR_WS_INCLUDES.'header.php');
76
77$smarty->assign('BUTTON_CONTINUE', '<a href="'.xtc_href_link(FILENAME_DEFAULT).'">'.xtc_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE).'</a>');
78$smarty->assign('language', $_SESSION['language']);
79$main_content = $smarty->fetch(CURRENT_TEMPLATE.'/module/logoff.html');
80$smarty->assign('main_content', $main_content);
81$smarty->caching = 0;
82if (!defined('RM'))
83 $smarty->load_filter('output', 'note');
84$smarty->display(CURRENT_TEMPLATE.'/index.html');
85include ('includes/application_bottom.php');
86?>