From af4332cd54f1f0a600f06a67c067cdb01629e0a5 Mon Sep 17 00:00:00 2001
From: Jaime Perez <jaime.perez@uninett.no>
Date: Wed, 5 Mar 2014 10:44:03 +0100
Subject: [PATCH] Move www/example-simple/hostnames.php to
 www/admin/hostnames.php, where it belongs.

---
 modules/core/www/frontpage_config.php |  2 +-
 www/admin/hostnames.php               | 47 +++++++++++++++++++++++++++
 2 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 www/admin/hostnames.php

diff --git a/modules/core/www/frontpage_config.php b/modules/core/www/frontpage_config.php
index c911f904b..9f25737c4 100644
--- a/modules/core/www/frontpage_config.php
+++ b/modules/core/www/frontpage_config.php
@@ -44,7 +44,7 @@ $links_federation = array();
 
 
 $links_config[] = array(
-	'href' => SimpleSAML_Utilities::getBaseURL() . 'example-simple/hostnames.php?dummy=1',
+	'href' => SimpleSAML_Utilities::getBaseURL() . 'admin/hostnames.php?dummy=1',
 	'text' => '{core:frontpage:link_diagnostics}'
 );
 
diff --git a/www/admin/hostnames.php b/www/admin/hostnames.php
new file mode 100644
index 000000000..87e5ca422
--- /dev/null
+++ b/www/admin/hostnames.php
@@ -0,0 +1,47 @@
+<?php
+
+require_once('../_include.php');
+
+/* Load simpleSAMLphp, configuration */
+$config = SimpleSAML_Configuration::getInstance();
+$session = SimpleSAML_Session::getInstance();
+
+/* Check if valid local session exists.. */
+SimpleSAML_Utilities::requireAdmin();
+
+
+
+
+
+$attributes = array();
+
+
+$attributes['HTTP_HOST'] = array($_SERVER['HTTP_HOST']);
+$attributes['HTTPS'] = array($_SERVER['HTTPS']);
+$attributes['SERVER_PROTOCOL'] = array($_SERVER['SERVER_PROTOCOL']);
+$attributes['SERVER_PORT'] = array($_SERVER['SERVER_PORT']);
+
+$attributes['Utilities_getBaseURL()'] = array(SimpleSAML_Utilities::getBaseURL());
+$attributes['Utilities_getSelfHost()'] = array(SimpleSAML_Utilities::getSelfHost());
+$attributes['Utilities_selfURLhost()'] = array(SimpleSAML_Utilities::selfURLhost());
+$attributes['Utilities_selfURLNoQuery()'] = array(SimpleSAML_Utilities::selfURLNoQuery());
+$attributes['Utilities_getSelfHostWithPath()'] = array(SimpleSAML_Utilities::getSelfHostWithPath());
+$attributes['Utilities_getFirstPathElement()'] = array(SimpleSAML_Utilities::getFirstPathElement());
+$attributes['Utilities_selfURL()'] = array(SimpleSAML_Utilities::selfURL());
+
+
+
+
+
+$et = new SimpleSAML_XHTML_Template($config, 'status.php');
+
+$et->data['header'] = '{status:header_diagnostics}';
+$et->data['remaining'] = 'na';
+$et->data['attributes'] = $attributes;
+$et->data['valid'] = 'na';
+$et->data['logout'] = null;
+
+$et->show();
+
+
+?>
\ No newline at end of file
-- 
GitLab