Skip to content
Snippets Groups Projects
Commit 65acb7a9 authored by Olav Morken's avatar Olav Morken
Browse files

SimpleSAML_Auth_LDAP: Clean up unnecessary code.

The search()-function contained some code that was unnecessary. This
patch removes that code and simplifies the function.

Thanks to Ryan Panning for fixing this!

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2982 44740490-163a-0410-bde0-09ae8108e29a
parent e570cf86
No related branches found
No related tags found
No related merge requests found
...@@ -190,24 +190,11 @@ class SimpleSAML_Auth_LDAP { ...@@ -190,24 +190,11 @@ class SimpleSAML_Auth_LDAP {
// Create the search filter. // Create the search filter.
$attribute = self::escape_filter_value($attribute, FALSE); $attribute = self::escape_filter_value($attribute, FALSE);
$value = self::escape_filter_value($value); $value = self::escape_filter_value($value);
if (is_array($attribute)) { $filter = '';
foreach ($attribute AS $attr) {
// We have more than one attribute. $filter .= '(' . $attr . '=' . $value. ')';
$filter = '';
foreach ($attribute AS $attr) {
$filter .= '(' . $attr . '=' . $value. ')';
}
$filter = '(|' . $filter . ')';
} elseif (is_string($attribute)) {
// We have only one attribute.
$filter = '(' . $attribute . '=' . $value. ')';
} else {
// We have an unknown attribute type...
throw $this->makeException('Library - LDAP search(): Search attribute must be an array or a string', ERR_INTERNAL);
} }
$filter = '(|' . $filter . ')';
// Search using generated filter. // Search using generated filter.
SimpleSAML_Logger::debug('Library - LDAP search(): Searching base \'' . $base . '\' for \'' . $filter . '\''); SimpleSAML_Logger::debug('Library - LDAP search(): Searching base \'' . $base . '\' for \'' . $filter . '\'');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment