From 68605943aef3748f6b29a529e10ef079ae8c256f Mon Sep 17 00:00:00 2001 From: paca70 Date: Thu, 3 Oct 2002 15:55:45 +0000 Subject: [PATCH] Corrected some comments. --- auth/ldap/lib.php | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/auth/ldap/lib.php b/auth/ldap/lib.php index c8eedf28f2..b98b846f17 100644 --- a/auth/ldap/lib.php +++ b/auth/ldap/lib.php @@ -1,5 +1,6 @@ wwwroot/auth/ldap/attr_mappings.php"); + //atribute mappings between moodle and ldap $moodleattributes['firstname'] ='givenname'; $moodleattributes['lastname'] ='sn'; @@ -127,21 +127,13 @@ function auth_ldap_find_userdn ($ldap_connection, $username){ //default return value $ldap_user_dn = FALSE; - - //$ldap_connection = auth_ldap_connect(); auth_ldap_bind($ldap_connection); - + //get all contexts and look for first matching user $ldap_contexts = explode(";",$CFG->ldap_contexts); - - - foreach($ldap_contexts as $context) { $context == trim($context); - //echo ("looking in context:".$context."
"); - //echo ("filter :"."(".$CFG->ldap_user_attribute."=".$username.")". "
"); - if($CFG->ldap_search_sub){ //use ldap_search to find first user from subtree $ldap_result = ldap_search($ldap_connection, $context, "(".$CFG->ldap_user_attribute."=".$username.")"); @@ -161,7 +153,4 @@ function auth_ldap_find_userdn ($ldap_connection, $username){ return $ldap_user_dn; } - - - ?> -- 2.39.5