<commit_before><?php

require_once('_include.php');

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

/* Check if valid local session exists.. */
if ($config->getBoolean('admin.protectindexpage', false)) {
	SimpleSAML_Utilities::requireAdmin();
}
$loginurl = SimpleSAML_Utilities::getAdminLoginURL();
$isadmin = SimpleSAML_Utilities::isAdmin();


$warnings = array();

if (SimpleSAML_Utilities::getSelfProtocol() != 'https') {
	$warnings[] = 'warnings_https';
}

	
$links = array();


if ($config->getBoolean('enable.saml20-sp', TRUE) === true)
	$links[] = array(
		'href' => 'example-simple/saml2-example.php', 
		'text' => 'link_saml2example');

if ($config->getBoolean('enable.shib13-sp', FALSE) === true)
	$links[] = array(
		'href' => 'example-simple/shib13-example.php', 
		'text' => 'link_shib13example'
	);

if($config->getBoolean('idpdisco.enableremember', FALSE)) {
	$links[] = array(
		'href' => 'cleardiscochoices.php',
		'text' => 'link_cleardiscochoices',
	);
}

$publishURL = $config->getString('metashare.publishurl', NULL);
if ($publishURL !== NULL) {
	$metadataSources = array(
		'saml20-idp' => 'saml2/idp/metadata.php',
		'saml20-sp' => 'saml2/sp/metadata.php',
		'shib13-idp' => 'shib13/idp/metadata.php',
		'shib13-sp' => 'shib13/sp/metadata.php',
	);
	foreach($metadataSources as $name => $url) {
		if(!$config->getBoolean('enable.' . $name, FALSE)) continue;

		$url = SimpleSAML_Utilities::resolveURL($url);
		$linkTarget = SimpleSAML_Utilities::addURLparameter($publishURL, array('url' => $url));
		$links[] = array(
			'href' => $linkTarget,
			'text' => 'link_publish_' . $name,
		);
	}
}



$linksconf = array();

$linksconf[] = array(
	'href' => 'example-simple/hostnames.php?dummy=1', 
	'text' => 'link_diagnostics'
);

$linksconf[] = array(
	'href' => 'admin/phpinfo.php', 
	'text' => 'link_phpinfo'
);

$linksconf[] = array(
	'href' => 'admin/config.php',
	'text' => 'link_configcheck',
);






$linksmeta = array();

$linksmeta[] = array(
	'href' => 'admin/metadata.php', 
	'text' => 'link_meta_overview');

// if ($config->getValue('enable.saml20-sp') === true)
// 	$linksmeta[] = array(
// 		'href' => 'saml2/sp/metadata.php?output=xhtml', 
// 		'text' => 'link_meta_saml2sphosted');
// 
// if ($config->getValue('enable.saml20-idp') === true)
// 	$linksmeta[] = array(
// 		'href' => 'saml2/idp/metadata.php?output=xhtml', 
// 		'text' => 'link_meta_saml2idphosted');
// 
// if ($config->getValue('enable.shib13-sp') === true)
// 	$linksmeta[] = array(
// 		'href' => 'shib13/sp/metadata.php?output=xhtml', 
// 		'text' => 'link_meta_shib13sphosted');
// 
// if ($config->getValue('enable.shib13-idp') === true)
// 	$linksmeta[] = array(
// 		'href' => 'shib13/idp/metadata.php?output=xhtml', 
// 		'text' => 'link_meta_shib13idphosted');


$linksmeta[] = array(
	'href' => 'admin/metadata-converter.php',
	'text' => 'link_xmlconvert',
	);


$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();

$metaentries = array('hosted' => array(), 'remote' => array() );
if ($config->getBoolean('enable.saml20-sp', TRUE) === true) {
	try {
		$metaentries['hosted']['saml20-sp'] = $metadata->getMetaDataCurrent('saml20-sp-hosted');
		$metaentries['hosted']['saml20-sp']['metadata-url'] = '/' . $config->getBaseURL() . 'saml2/sp/metadata.php?output=xhtml';
		if ($isadmin)
			$metaentries['remote']['saml20-idp-remote'] = $metadata->getList('saml20-idp-remote');
	} catch(Exception $e) {}
}
if ($config->getBoolean('enable.saml20-idp', FALSE) === true) {
	try {<commit_msg>index.php: Remove old (commented out) code.<commit_after><?php

require_once('_include.php');

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

/* Check if valid local session exists.. */
if ($config->getBoolean('admin.protectindexpage', false)) {
	SimpleSAML_Utilities::requireAdmin();
}
$loginurl = SimpleSAML_Utilities::getAdminLoginURL();
$isadmin = SimpleSAML_Utilities::isAdmin();


$warnings = array();

if (SimpleSAML_Utilities::getSelfProtocol() != 'https') {
	$warnings[] = 'warnings_https';
}

	
$links = array();


if ($config->getBoolean('enable.saml20-sp', TRUE) === true)
	$links[] = array(
		'href' => 'example-simple/saml2-example.php', 
		'text' => 'link_saml2example');

if ($config->getBoolean('enable.shib13-sp', FALSE) === true)
	$links[] = array(
		'href' => 'example-simple/shib13-example.php', 
		'text' => 'link_shib13example'
	);

if($config->getBoolean('idpdisco.enableremember', FALSE)) {
	$links[] = array(
		'href' => 'cleardiscochoices.php',
		'text' => 'link_cleardiscochoices',
	);
}

$publishURL = $config->getString('metashare.publishurl', NULL);
if ($publishURL !== NULL) {
	$metadataSources = array(
		'saml20-idp' => 'saml2/idp/metadata.php',
		'saml20-sp' => 'saml2/sp/metadata.php',
		'shib13-idp' => 'shib13/idp/metadata.php',
		'shib13-sp' => 'shib13/sp/metadata.php',
	);
	foreach($metadataSources as $name => $url) {
		if(!$config->getBoolean('enable.' . $name, FALSE)) continue;

		$url = SimpleSAML_Utilities::resolveURL($url);
		$linkTarget = SimpleSAML_Utilities::addURLparameter($publishURL, array('url' => $url));
		$links[] = array(
			'href' => $linkTarget,
			'text' => 'link_publish_' . $name,
		);
	}
}



$linksconf = array();

$linksconf[] = array(
	'href' => 'example-simple/hostnames.php?dummy=1', 
	'text' => 'link_diagnostics'
);

$linksconf[] = array(
	'href' => 'admin/phpinfo.php', 
	'text' => 'link_phpinfo'
);

$linksconf[] = array(
	'href' => 'admin/config.php',
	'text' => 'link_configcheck',
);






$linksmeta = array();

$linksmeta[] = array(
	'href' => 'admin/metadata.php', 
	'text' => 'link_meta_overview');

$linksmeta[] = array(
	'href' => 'admin/metadata-converter.php',
	'text' => 'link_xmlconvert',
	);


$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();

$metaentries = array('hosted' => array(), 'remote' => array() );
if ($config->getBoolean('enable.saml20-sp', TRUE) === true) {
	try {
		$metaentries['hosted']['saml20-sp'] = $metadata->getMetaDataCurrent('saml20-sp-hosted');
		$metaentries['hosted']['saml20-sp']['metadata-url'] = '/' . $config->getBaseURL() . 'saml2/sp/metadata.php?output=xhtml';
		if ($isadmin)
			$metaentries['remote']['saml20-idp-remote'] = $metadata->getList('saml20-idp-remote');
	} catch(Exception $e) {}
}
if ($config->getBoolean('enable.saml20-idp', FALSE) === true) {
	try {
{'fraction_non_alphanumeric': 0.2210122699386503, 'fraction_numerical': 0.015337423312883436, 'mean_word_length': 5.175189393939394, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 89, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7006507', 'n_tokens_mistral': 2595, 'n_tokens_neox': 2427, 'n_words': 359}