Topic on Extension talk:LDAP Authentication

Modification of searchGroups - LDAP Search

2
88.73.149.65 (talkcontribs)

Hi,

please modify the following code block in function searchGroups( $dn ) in the LDAP Authentication script:

from:

1532 	$this->printDebug( "Search string: $filter", SENSITIVE );
1533 	
1534 	$info = @ldap_search( $this->ldapconn, $base, $filter );
1535 	if ( !$info ) {
1536 	$this->printDebug( "No entries returned from search.", SENSITIVE );
1537 	
1538 	// Return an array so that other functions
1539 	// don't error out.
1540 	return array( "short" => array(), "dn" => array() );
1541 	}
1542

TO:

$this->printDebug( "Search string: $filter", SENSITIVE );
		
		$this->printDebug( "LDAP Search: base: $base filter: $filter", SENSITIVE );
		$justthese = array( "dn", strtolower( $nameattribute));
		$info = @ldap_search( $this->ldapconn, $base, $filter, $justthese );
		if ( !$info ) {
			$this->printDebug( "No entries returned from search.", SENSITIVE );

			// Return an array so that other functions
			// don't error out.
			return array( "short" => array(), "dn" => array() );
		}

This modification has the effect that the LDAP lookup only request the required information instead of requesting the whole entries.

Reply to "Modification of searchGroups - LDAP Search"