<?php
	$elOutputHeader = "";
	$elOutputBody = "";
	$O__logNotes .= "";

	function O__logout(){
		global $elOutputHeader,
				$elOutputBody,
				$elOutputBodyBottom,
				$O__logNotes,
				$O__PT;

		if (isset($_SESSION["O__userID"])){
			$O__userAcctID = $_SESSION["O__userID"];
			session_unset();
			session_destroy();
			$O__logNotes .= "User '" . $O__userAcctID . "' logout succeeded.";
		}
		
		$elOutputHeader = "<meta http-equiv=\"refresh\" content=\"1; url=/" . $O__PT . "\">\n";
		$elOutputBody = "Signing out...";
		$elOutputBodyBottom = "";
	}
	
	function O__createOutput(){
		global $elOutputBody, $elOutputBodyBottom;
		
		$O__output = "<table cellspacing=\"0\" cellpadding=\"2\" border=\"0\" width=\"100%\">";
		$O__output .= "<tr><td class=\"O__text\">Verification:</td></tr>";
		$O__output .= "<tr><td class=\"O__text\">" . $elOutputBody . "</td></tr>";
		$O__output .= "<tr><td class=\"O__text\">" . $elOutputBodyBottom . "</td></tr>";
		$O__output .= "</table>";
		
		return $O__output;
	}

	O__logout();
	$O__output = O__createOutput();

?>

<script>	
	// Swap visuals on load
	var	O__menuInfoArea = "O__menuItemDesc";
	
	window.addEventListener("load", function(){
		document.getElementById(O__menuInfoArea).innerHTML = "Leaving OutSCIRT. Bye!";
	});
</script>

<?php echo($elOutputHeader); ?>
