From 7c264e8d7e434f685e2c8b811d18ebe4553b809e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Wed, 5 Mar 2008 07:48:46 +0000
Subject: [PATCH] Removed some unneccessary includes, as well as fixing the
 attribute filtering options for LDAP auth

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@354 44740490-163a-0410-bde0-09ae8108e29a
---
 config-templates/config.php  | 7 +++++--
 lib/SimpleSAML/Auth/LDAP.php | 2 +-
 www/auth/login.php           | 6 ------
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/config-templates/config.php b/config-templates/config.php
index cbbf74c1b..c52d1a96c 100644
--- a/config-templates/config.php
+++ b/config-templates/config.php
@@ -191,12 +191,15 @@ $config = array (
 		),
 
 
-	/*
+	/**
 	 * LDAP configuration. This is only relevant if you use the LDAP authentication plugin.
+	 *
+	 * The attributes parameter is a list of attributes that should be retrieved.
+	 * If the attributes parameter is set to null, all attributes will be retrieved.
 	 */
 	'auth.ldap.dnpattern'  => 'uid=%username%,dc=feide,dc=no,ou=feide,dc=uninett,dc=no',
 	'auth.ldap.hostname'   => 'ldap.uninett.no',
-	'auth.ldap.attributes' => 'objectclass=*',
+	'auth.ldap.attributes' => null,
 	
 	/*
 	 * Radius authentication. This is only relevant if you use the Radius authentication plugin.
diff --git a/lib/SimpleSAML/Auth/LDAP.php b/lib/SimpleSAML/Auth/LDAP.php
index 62b423bbd..854bace4b 100644
--- a/lib/SimpleSAML/Auth/LDAP.php
+++ b/lib/SimpleSAML/Auth/LDAP.php
@@ -102,7 +102,7 @@ class SimpleSAML_Auth_LDAP {
 		$searchtxt = (is_array($attributes) ? join(',', $attributes) : 'all attributes');
 		SimpleSAML_Logger::debug('Library - LDAP: Get attributes from ' . $dn . ' (' . $searchtxt . ')');
 		
-		if (is_array($search)) 
+		if (is_array($attributes)) 
 			$sr = @ldap_read($this->ldap, $dn, 'objectClass=*', $attributes );
 		else 
 			$sr = @ldap_read($this->ldap, $dn, 'objectClass=*');
diff --git a/www/auth/login.php b/www/auth/login.php
index 8d86828c3..ea5b4e579 100644
--- a/www/auth/login.php
+++ b/www/auth/login.php
@@ -3,18 +3,13 @@
 
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . '../../www/_include.php');
 
-
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Utilities.php');
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Session.php');
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Metadata/MetaDataStorageHandler.php');
-require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/XML/SAML20/AuthnRequest.php');
-require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Bindings/SAML20/HTTPRedirect.php');
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/XHTML/Template.php');
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Logger.php');
-
 require_once((isset($SIMPLESAML_INCPREFIX)?$SIMPLESAML_INCPREFIX:'') . 'SimpleSAML/Auth/LDAP.php');
 
-
 $config = SimpleSAML_Configuration::getInstance();
 $metadata = SimpleSAML_Metadata_MetaDataStorageHandler::getMetadataHandler();
 $session = SimpleSAML_Session::getInstance(true);
@@ -22,7 +17,6 @@ $session = SimpleSAML_Session::getInstance(true);
 SimpleSAML_Logger::info('AUTH  - ldap: Accessing auth endpoint login');
 
 
-
 $error = null;
 $attributes = array();
 $username = null;
-- 
GitLab