<?php

require_once "ClassLoader.php";
Log::notice("START: /blueprints/session.php");
Login::requireLogin("blueprints", "/blueprints/login.php");
$meta_title = "Blueprints :: Session Sniffer";
$meta_description = "Blueprints";
$meta_keywords = "blueprints";
$action = @$_GET["action"];
if ($action == "restart") {
    Session::restart();
}
$nav = array("session");
$content = array();
$content[] = array("type" => "html", "data" => "<h1>Session Sniffer</h1>");
$session_id = Session::user("session_id");
$html = "\n\t<a class='textButton' href='?action=refresh'>Refresh</a> <a class='textButton' href='?action=restart'>Restart</a>\n\t<h2>SessionID: {$session_id}</h2>\n";
$html .= depthFirstArrayPrint($_SESSION);
$content[] = array("type" => "html", "data" => "{$html}");
$template = "blue";
include "template.inc";
Log::notice("END: /blueprints/session.php" . "\n");
?>

<?
function depthFirstArrayPrint($var, &$buff="")
{
	if(is_array($var))
	{
		$buff .= "<ul>";
		foreach($var as $key=>$value)