<?php
header('HTTP/1.0 200 Ok');
if (isset($_SERVER['REMOTE_USER'])){
	if(!(is_readable(realpath(dirname(__FILE__))."/../include/loginroutines.inc"))) {
	    die("Error - Could not open or read file ".realpath(dirname(__FILE__))."/../include/loginroutines.inc");
	} else {
	    include_once(realpath(dirname(__FILE__))."/../include/loginroutines.inc");
	}
	$cred = explode('\\',$_SERVER['REMOTE_USER']);
	if (count($cred) == 1) array_unshift($cred, "(no domain)");
	list($domain, $user) = $cred;
	$_SESSION['sspi_key'] = createGuid();;
	$_SESSION['sspi_user'] = $domain.'\\'.$user;
	echo $_SESSION['sspi_key'];
}
?>

