From 3ff9e44f6adf9988ed3ff5e8404da2995786b9dc Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Tue, 11 May 2010 13:06:29 +0000
Subject: [PATCH] Remove www/admin/metadata.php. It wasn't linked to, and it
 was wrong.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2296 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/core/www/frontpage_federation.php |   5 -
 templates/admin-metadatalist.php          | 132 ------------------
 www/admin/metadata.php                    | 155 ----------------------
 3 files changed, 292 deletions(-)
 delete mode 100644 templates/admin-metadatalist.php
 delete mode 100644 www/admin/metadata.php

diff --git a/modules/core/www/frontpage_federation.php b/modules/core/www/frontpage_federation.php
index 436a82082..dfefd2704 100644
--- a/modules/core/www/frontpage_federation.php
+++ b/modules/core/www/frontpage_federation.php
@@ -56,11 +56,6 @@ if ($publishURL !== NULL) {
 }
 
 
-// $links_federation[] = array(
-// 	'href' => SimpleSAML_Utilities::getBaseURL() . 'admin/metadata.php',
-// 	'text' => '{core:frontpage:link_meta_overview}'
-// );
-
 $links_federation[] = array(
 	'href' => SimpleSAML_Utilities::getBaseURL() . 'admin/metadata-converter.php',
 	'text' => '{core:frontpage:link_xmlconvert}',
diff --git a/templates/admin-metadatalist.php b/templates/admin-metadatalist.php
deleted file mode 100644
index 0ca1b7ed0..000000000
--- a/templates/admin-metadatalist.php
+++ /dev/null
@@ -1,132 +0,0 @@
-<?php
-$this->data['header'] = $this->t('metaover_header');
-
-$this->includeAtTemplateBase('includes/header.php');
-?>
-
-
-
-		<p><?php echo $this->t('metaover_intro'); ?></p>
-
-		<?php
-		
-		
-		function showEntry($t, $id) {
-
-			if (!array_key_exists($id, $t->data)) {
-				/* This metadata does not exist. */
-				return;
-			}
-
-
-			$header = $t->t('metaover_group_' . $id);
-			$list = $t->data[$id];
-			$baseurl = $t->data['baseurlpath'];
-
-			echo '<h3>' . $header . '</h3>';
-			
-
-			
-			foreach ($list AS $entityid => $entity) {
-			
-				$encodedEntityID = preg_replace('/=/', '_', base64_encode($entityid . $header));
-				$name = $entityid;
-				if (isset($entity['optional.found']['name'])) $name = $entity['optional.found']['name'];
-
-				//print_r($entity);
-				
-				$warning = false;
-				if (count($entity['leftovers']) > 0) $warning = TRUE;
-				if (count($entity['required.notfound']) > 0) $warning = TRUE;
-
-				$t->includeInlineTranslation('spname', $name);
-				$name = $t->t('spname', array(), false, true);
-
-				echo '<h4 style="padding-left: 2em; clear: both;" onclick="document.getElementById(\'metadatasection-' . $encodedEntityID . '\').style.display=\'block\';">' . htmlspecialchars($name) . '</h4>';
-				
-				if ($warning) {
-					echo '<div><img src="/' . $baseurl . 'resources/icons/experience/gtk-dialog-warning.48x48.png" style="float: left; margin-right: 1em" />';
-					echo $t->t('metaover_errorentry') . '</div>';
-				}
-				
-				echo '<div id="metadatasection-' . $encodedEntityID . '" style="display: none">';
-				
-				if (isset($entity['optional.found']['description'])) {
-					$t->includeInlineTranslation('spdescription', $entity['optional.found']['description']);
-					$description = $t->t('spdescription');
-					echo '<p>' . htmlspecialchars($description) . '</p>';
-				}
-				
-				echo '<div style="margin-left: 1em">';
-				echo '<div class="efieldlist"><h5>' . $t->t('metaover_required_found') . '</h5>';
-				echo '<dl>';
-				foreach ($entity['required.found'] AS $key => $value) {
-					echo '<dt>' . htmlspecialchars($key) . '</dt><dd>' . htmlspecialchars(var_export($value, TRUE)) . '</dd>';
-				}
-				echo '</dl>' . "\n\n";
-
-
-	
-				if (count($entity['required.notfound']) > 0) {
-					echo '</div><div class="efieldlist warning">';
-					echo '<h5>' . $t->t('metaover_required_not_found') . '</h5><ul>';
-					foreach ($entity['required.notfound'] AS $key) {
-						echo '<li>' . htmlspecialchars($key) . '</li>';
-					}
-					echo '</ul>';				
-				}
-			
-				
-				if (count($entity['optional.found']) > 0) {
-					echo '</div><div class="efieldlist">';
-					echo '<h5>' . $t->t('metaover_optional_found') . '</h5>';
-					echo '<dl>';
-					foreach ($entity['optional.found'] AS $key => $value) {
-						echo '<dt>' . htmlspecialchars($key) . '</dt><dd>' . htmlspecialchars(var_export($value, TRUE)) . '</dd>';
-					}
-					echo '</dl>';
-				}
-				
-				
-	
-				if (count($entity['optional.notfound']) > 0) {
-					echo '</div><div class="efieldlist info">';				
-					echo '<h5>' . $t->t('metaover_optional_not_found') . '</h5><ul>';
-					foreach ($entity['optional.notfound'] AS $key) {
-						echo '<li>' . htmlspecialchars($key) . '</li>';
-					}
-					echo '</ul>';				
-				}
-				
-				if (count($entity['leftovers']) > 0) {
-					echo '</div><div class="efieldlist warning">';
-					echo '<h5>' . $t->t('metaover_unknown_found') . '</h5><ul>';
-					foreach ($entity['leftovers'] AS $key => $value) {
-						echo '<li>' . htmlspecialchars($key) . '</li>';
-					}
-					echo '</ul>';				
-				}
-				echo '</div></div>';
-				echo '</div>' . "\n\n";;
-			}
-		}
-		
-		
-		showEntry($this, 'metadata.saml20-sp-hosted');
-		showEntry($this, 'metadata.saml20-sp-remote');
-		showEntry($this, 'metadata.saml20-idp-hosted');
-		showEntry($this, 'metadata.saml20-idp-remote');
-
-		showEntry($this, 'metadata.shib13-sp-hosted');
-		showEntry($this, 'metadata.shib13-sp-remote');
-		showEntry($this, 'metadata.shib13-idp-hosted');
-		showEntry($this, 'metadata.shib13-idp-remote');
-
-		showEntry($this, 'metadata.wsfed-sp-hosted');
-		showEntry($this, 'metadata.wsfed-idp-remote');
-
-		
-		?>
-
-		
-<?php $this->includeAtTemplateBase('includes/footer.php'); ?>
diff --git a/www/admin/metadata.php b/www/admin/metadata.php
deleted file mode 100644
index 8caab3063..000000000
--- a/www/admin/metadata.php
+++ /dev/null
@@ -1,155 +0,0 @@
-<?php
-
-require_once('../_include.php');
-
-/* Load simpleSAMLphp, configuration and metadata */
-$config = SimpleSAML_Configuration::getInstance();
-$session = SimpleSAML_Session::getInstance();
-
-
-/* Check if valid local session exists.. */
-SimpleSAML_Utilities::requireAdmin();
-
-
-try {
-
-	$metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
-
-	$et = new SimpleSAML_XHTML_Template($config, 'admin-metadatalist.php', 'admin');
-
-
-	if ($config->getBoolean('enable.saml20-sp', TRUE) === true) {
-		$results = array();	
-		
-		$metalist = $metadata->getList('saml20-sp-hosted');
-		foreach ($metalist AS $entityid => $mentry) {
-			$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
-				array('entityid', 'host'),
-				array('redirect.sign','redirect.validate','certificate','privatekey', 'privatekey_pass', 'NameIDFormat', 'ForceAuthn', 'AuthnContextClassRef', 'SPNameQualifier', 'attributes', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'idpdisco.url', 'authproc', 'certData', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
-			);
-		}
-		$et->data['metadata.saml20-sp-hosted'] = $results;
-		
-		$results = array();	
-		$metalist = $metadata->getList('saml20-idp-remote');
-		foreach ($metalist AS $entityid => $mentry) {
-			$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
-				array('entityid', 'SingleSignOnService', 'SingleLogoutService', 'certFingerprint'),
-				array('name', 'description', 'base64attributes', 'certificate', 'hint.cidr', 'saml2.relaxvalidation', 'SingleLogoutServiceResponse', 'redirect.sign', 'redirect.validate', 'sharedkey', 'assertion.encryption', 'icon', 'authproc', 'certData', 'send_metadata_email', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
-			);
-			$index = array_search('certFingerprint', $results[$entityid]['required.notfound']);
-			if ($index !== FALSE) {
-				if (array_key_exists('certificate', $mentry)) {
-					unset($results[$entityid]['required.notfound'][$index]);
-				}
-			}
-		}
-		$et->data['metadata.saml20-idp-remote'] = $results;
-		
-	}
-	
-	if ($config->getBoolean('enable.saml20-idp', FALSE) === true) {
-		$results = array();	
-		$metalist = $metadata->getList('saml20-idp-hosted');
-		foreach ($metalist AS $entityid => $mentry) {
-			$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
-				array('entityid', 'host', 'privatekey', 'certificate', 'auth'),
-				array('redirect.sign', 'redirect.validate', 'privatekey_pass', 'authority', 'userid.attribute', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'AttributeNameFormat', 'name', 'authproc', 'saml20.sign.assertion', 'saml20.sign.response', 'certData', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
-			);
-		}
-		$et->data['metadata.saml20-idp-hosted'] = $results;
-		
-		$results = array();	
-		$metalist = $metadata->getList('saml20-sp-remote');
-		foreach ($metalist AS $entityid => $mentry) {
-			$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
-				array('entityid', 'AssertionConsumerService'),
-				array('SingleLogoutService', 'NameIDFormat', 'SPNameQualifier', 'base64attributes', 'simplesaml.nameidattribute', 'simplesaml.attributes', 'attributes', 'name', 'description', 'redirect.sign', 'redirect.validate', 'certificate', 'ForceAuthn', 'sharedkey', 'assertion.encryption', 'userid.attribute', 'AttributeNameFormat', 'authproc', 'saml20.sign.assertion', 'saml20.sign.response', 'certData', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
-			);
-		}
-		$et->data['metadata.saml20-sp-remote'] = $results;
-		
-	}
-
-
-
-
-	if ($config->getBoolean('enable.shib13-sp', FALSE) === true) {
-		$results = array();	
-
-		$metalist = $metadata->getList('shib13-sp-hosted');
-		foreach ($metalist AS $entityid => $mentry) {
-			$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
-				array('entityid', 'host'),
-				array('NameIDFormat', 'ForceAuthn', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'idpdisco.url', 'authproc', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
-			);
-		}
-		$et->data['metadata.shib13-sp-hosted'] = $results;
-
-		$results = array();	
-		$metalist = $metadata->getList('shib13-idp-remote');
-		foreach ($metalist AS $entityid => $mentry) {
-			$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
-				array('entityid', 'SingleSignOnService', 'certFingerprint'),
-				array('name', 'description', 'base64attributes', 'icon', 'authproc', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
-			);
-		}
-		$et->data['metadata.shib13-idp-remote'] = $results;
-		
-	}
-	
-	if ($config->getBoolean('enable.shib13-idp', FALSE) === true) {
-		$results = array();	
-		$metalist = $metadata->getList('shib13-idp-hosted');
-		foreach ($metalist AS $entityid => $mentry) {
-			$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
-				array('entityid', 'host', 'privatekey', 'certificate', 'auth'),
-				array('name', 'authority', 'privatekey_pass', 'scopedattributes', 'authproc', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
-			);
-		}
-		$et->data['metadata.shib13-idp-hosted'] = $results;
-		
-		$results = array();	
-		$metalist = $metadata->getList('shib13-sp-remote');
-		foreach ($metalist AS $entityid => $mentry) {
-			$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
-				array('entityid', 'AssertionConsumerService'),
-				array('base64attributes', 'audience', 'simplesaml.attributes', 'attributes', 'name', 'description', 'metadata.sign.enable', 'metadata.sign.privatekey', 'metadata.sign.privatekey_pass', 'metadata.sign.certificate', 'scopedattributes', 'authproc', 'OrganizationName', 'OrganizationDisplayName', 'OrganizationURL')
-			);
-		}
-		$et->data['metadata.shib13-sp-remote'] = $results;
-		
-	}
-
-	if ($config->getBoolean('enable.wsfed-sp', FALSE) === true) {
-		$results = array();
-		$metalist = $metadata->getList('wsfed-sp-hosted');
-		foreach ($metalist AS $entityid => $mentry) {
-			$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
-				array('entityid', 'host'),
-				array()
-			);
-		}
-		$et->data['metadata.wsfed-sp-hosted'] = $results;
-
-		$results = array();
-		$metalist = $metadata->getList('wsfed-idp-remote');
-		foreach ($metalist AS $entityid => $mentry) {
-			$results[$entityid] = SimpleSAML_Utilities::checkAssocArrayRules($mentry,
-				array('entityid', 'prp', 'certificate'),
-				array()
-			);
-		}
-		$et->data['metadata.wsfed-idp-remote'] = $results;
-
-	}
-
-	
-	$et->show();
-	
-} catch(Exception $exception) {
-	SimpleSAML_Utilities::fatalError($session->getTrackID(), 'METADATA', $exception);
-
-}
-
-?>
-- 
GitLab