Skip to content
Snippets Groups Projects
Commit 889f5375 authored by Jaime Pérez Crespo's avatar Jaime Pérez Crespo
Browse files

Revert "Add support for binary attributes in AttributeAddFromLDAP (Issue...

Revert "Add support for binary attributes in AttributeAddFromLDAP (Issue #620). Also, remove hardcoded attribute names, and detect binary attributes 'automatically'."

This reverts commit ec82fe0480a1891eff80493e5a95e66984c3ac2a.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@3369 44740490-163a-0410-bde0-09ae8108e29a
parent e4a64374
No related branches found
No related tags found
No related merge requests found
...@@ -361,25 +361,6 @@ class SimpleSAML_Auth_LDAP { ...@@ -361,25 +361,6 @@ class SimpleSAML_Auth_LDAP {
); );
} }
// parse each entry and process its attributes
for ($i = 0; $i < $results['count']; $i++) {
$entry = $results[$i];
// iterate over the attributes of the entry
for ($j = 0; $j < $entry['count']; $j++) {
$name = $entry[$j];
$attribute = $entry[$name];
// decide whether to base64 encode or not
for ($k = 0; $k < $attribute['count']; $k++) {
// base64 encode binary attributes
if (!ctype_print($attribute[$k])) {
$results[$i][$name][$k] = base64_encode($attribute[$k]);
}
}
}
}
// Remove the count and return // Remove the count and return
unset($results['count']); unset($results['count']);
return $results; return $results;
...@@ -541,12 +522,12 @@ class SimpleSAML_Auth_LDAP { ...@@ -541,12 +522,12 @@ class SimpleSAML_Auth_LDAP {
continue; continue;
} }
// base64 encode binary attributes // Base64 encode jpegPhoto.
if (!ctype_print($value)) { if (strtolower($name) === 'jpegphoto') {
$values[] = base64_encode($value); $values[] = base64_encode($value);
} else { } else
$values[] = $value; $values[] = $value;
}
} }
// Adding. // Adding.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment