<?php

/**
 * The _include script registers a autoloader for the simpleSAMLphp libraries. It also
 * initializes the simpleSAMLphp config class with the correct path.
 */
require_once('_include.php');


/* Load simpleSAMLphp, configuration and metadata */
$config = SimpleSAML_Configuration::getInstance();
$session = SimpleSAML_Session::getInstance();

if (empty($_REQUEST['RelayState'])) {
	SimpleSAML_Utilities::fatalError($session->getTrackID(), 'NORELAYSTATE');
}

if (! $session->isValid('openid') ) {
	/* Authenticate with an AuthSource. */
	$hints = array();
	if (array_key_exists('openid', $_REQUEST)) $hints['openid'] = $_REQUEST['openid'];
	SimpleSAML_Auth_Default::initLogin('openid', $_REQUEST['RelayState'], NULL, $hints);
}


?>
<?php

/**
 * The _include script registers a autoloader for the simpleSAMLphp libraries. It also
 * initializes the simpleSAMLphp config class with the correct path.
 */
require_once('_include.php');


/* Load simpleSAMLphp, configuration and metadata */
$config = SimpleSAML_Configuration::getInstance();
$session = SimpleSAML_Session::getInstance();

if (empty($_REQUEST['RelayState'])) {
	throw new SimpleSAML_Error_Error('NORELAYSTATE');
}

if (! $session->isValid('openid') ) {
	/* Authenticate with an AuthSource. */
	$hints = array();
	if (array_key_exists('openid', $_REQUEST)) $hints['openid'] = $_REQUEST['openid'];
	SimpleSAML_Auth_Default::initLogin('openid', $_REQUEST['RelayState'], NULL, $hints);
}


?>
Replace calls to SimpleSAML_Utilities::fatalError with throwing an exception.
Replace calls to SimpleSAML_Utilities::fatalError with throwing an exception.

Also remove those instances of the $session variable that became unused.

git-svn-id: a243b28a2a52d65555a829a95c8c333076d39ae1@2479 44740490-163a-0410-bde0-09ae8108e29a
