<?php
	/*
	** File: LOGOUT_USER
	** Description: remove the user from the session table
	** Version: $Revision: 1.6 $
	** Created: 03/25/99
	** Author: Leon Atkinson
	** Email: leon@clearink.com
	** CVS Author: $Author: leon $
	** Last Revised: $Date: 1999/08/20 20:03:13 $
	**
	** Log : $Log: LOGOUT_USER,v $
	** Log : Revision 1.6  1999/08/20 20:03:13  leon
	** Log : Added support to allow checking out if you aren't logged in.  To do this,
	** Log : I added a column to the session table to track the ID of current invoice
	** Log : for the session.  Before, we were getting the current invoice by looking
	** Log : in the invoice table for an inactive invoice for the same user.  This
	** Log : doesn't work for anonymous sessions because they all have user=0.
	** Log :
	** Log : Note that the invoice column is now set or unset by LOGIN_USER and
	** Log : LOGOUT_USER.  If a session creates an invoice, then logs into an
	** Log : account that has an inactive invoice, the invoice the session already
	** Log : has will be preserved.
	** Log :
	** Log : The purgeInvoice function was changed to set Invoice=0 for any session
	** Log : that is associated with the invoice to be purged.
	** Log :
	** Log : Revision 1.5  1999/08/18 22:31:50  leon
	** Log : Returning opening PHP tag to XML-friendly tag
	** Log :
	** Log : Revision 1.4  1999/07/28 19:27:14  leon
	** Log : Mass update based on code donation from a live project
	** Log :
	**
	** Copyright (c) 1999 Working Dogs.  All rights reserved.
	*/

	//set user id to zero, set invoice to zero
	$Query = "UPDATE session SET User=0, Invoice=0 WHERE ID='$sid'";
	mysql_query($Query, $DatabaseLink);

	//clear basket
	$Query = "DELETE FROM session_sku WHERE Session='$sid'";
	mysql_query($Query, $DatabaseLink);

	unset($UserInfo);
?>
