<?php
	require_once 'init.php';

	if ($_SESSION['userid']) {
		$record = array();
		$record['updated'] = date('Y-m-d H:i:s');
		$record['user'] = $_SESSION['userid'];
		$record['host'] = $_SERVER['REMOTE_ADDR'];
		$record['operation'] = 'logout';
		$rs2 = $adodb->SelectLimit("SELECT * FROM qb_changelog", 1);
		$adodb->Execute($adodb->GetInsertSQL($rs2, $record));
	}

	session_destroy();
	header('Location: logout2.php');
?>
