From aee52168afbc50176d6c1f1e3e1c1f7024f99718 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Mon, 19 Jan 2009 21:13:59 +0000
Subject: [PATCH] Add check for whether test user exists in config and add a
 separate column for that.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1172 44740490-163a-0410-bde0-09ae8108e29a
---
 .../templates/default/ldapstatus.php          | 24 +++++++++----------
 modules/ldapstatus/www/index.php              |  5 ++--
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/modules/ldapstatus/templates/default/ldapstatus.php b/modules/ldapstatus/templates/default/ldapstatus.php
index 6c3283135..670b1784e 100644
--- a/modules/ldapstatus/templates/default/ldapstatus.php
+++ b/modules/ldapstatus/templates/default/ldapstatus.php
@@ -8,18 +8,18 @@ $this->includeAtTemplateBase('includes/header.php');
 
 <h2>LDAP test</h2>
 
-<table class="attributes" style="width: 100%; border: 1px solid #aaa">
+<table class="attributes" style="font-size: small; width: 100%; border: 1px solid #aaa">
 	<tr>
-	<th>Name of institusion</th>
-	<!-- th>Identifier</th -->
-	<th>Conf</th>
-	<th>Meta</th>
-	<th>Ping</th>
-	<th>Admin bind()</th>
-	<th>Search bogus</th>
-	<th>Search test</th>
-	<th>Bind test</th>
-	<th>GetAttr test</th>
+		<th>Name of institusion</th>
+		<th>Conf</th>
+		<th>Meta</th>
+		<th>Ping</th>
+		<th>Admin bind()</th>
+		<th>Search bogus</th>
+		<th>Search test</th>
+		<th>test</th>
+		<th>Bind test</th>
+		<th>GetAttr</th>
 	</tr>
 
 <?php
@@ -59,13 +59,13 @@ foreach($this->data['sortedOrgIndex'] as $orgkey) {
 	} else {
 		echo('<td><span style="color: #b4b4b4; font-size: x-small">NA</span> <tt>' . $orgkey . '</tt></td>');
 	}
-#	echo('<td><tt>' . htmlspecialchars($orgkey) . '</tt></td>');
 	showRes('config',  $res, $this);
 	showRes('configMeta',  $res, $this);
 	showRes('ping',  $res, $this);
 	showRes('adminBind',  $res, $this);
 	showRes('ldapSearchBogus',  $res, $this);
 	showRes('ldapSearchTestUser',  $res, $this);
+	showRes('configTest',  $res, $this);
 	showRes('ldapBindTestUser',  $res, $this);
 	showRes('ldapGetAttributesTestUser',  $res, $this);
 	echo('</tr>');
diff --git a/modules/ldapstatus/www/index.php b/modules/ldapstatus/www/index.php
index f48e94bb1..d547a4016 100644
--- a/modules/ldapstatus/www/index.php
+++ b/modules/ldapstatus/www/index.php
@@ -59,7 +59,8 @@ foreach ($orgs AS $orgkey => $orgconfig) {
 	
 
 	$results[$orgkey]['config'] = checkConfig($orgconfig, array('description', 'searchbase', 'hostname'));
-	$results[$orgkey]['configMeta'] = checkConfig($orgconfig, array('enable_tls', 'testUser', 'testPassword', 'contactMail', 'contactURL'));
+	$results[$orgkey]['configMeta'] = checkConfig($orgconfig, array('enable_tls', 'contactMail', 'contactURL'));
+	$results[$orgkey]['configTest'] = checkConfig($orgconfig, array('testUser', 'testPassword'));
 
 	if (!$results[$orgkey]['config'][0]) continue;
 
@@ -149,7 +150,7 @@ foreach ($orgs AS $orgkey => $orgconfig) {
 
 function resultCode($res) {
 	$code = '';
-	$columns = array('config', 'configMeta', 'ping', 'adminUser', 'ldapSearchBogus', 'ldapSearchTestUser', 'ldapBindTestUser', 'ldapGetAttributesTestUser');
+	$columns = array('config', 'configMeta', 'ping', 'adminUser', 'ldapSearchBogus', 'configTest', 'ldapSearchTestUser', 'ldapBindTestUser', 'ldapGetAttributesTestUser');
 	foreach ($columns AS $c) {
 		if (array_key_exists($c, $res)) {
 			$code .= ($res[$c][0] ? '0' : '2');
-- 
GitLab