From cc1de32737d30bd60edf6e3b7929f5a43d209eb1 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 5 Dec 2005 14:27:47 +0000 Subject: [PATCH] fix for binary attributes --- lam/lib/modules.inc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 937bc2ca..a427146a 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -901,7 +901,7 @@ class accountContainer { echo "\n"; echo "\n"; echo "\n"; - echo "
\n"; + echo "\n"; // Display error-messages if (is_array($result)) { foreach ($result as $result2) { @@ -1369,6 +1369,15 @@ class accountContainer { } for ($i = 0; $i < sizeof($attrNames); $i++) unset($attr[$attrNames[$i]]['count']); unset($attr['count']); + // get binary attributes + $binaryAttr = array('jpegPhoto'); + for ($i = 0; $i < sizeof($binaryAttr); $i++) { + if (isset($attr[$binaryAttr[$i]][0])) { + $binData = ldap_get_values_len($_SESSION['ldap']->server(), $entry, $binaryAttr[$i]); + unset($binData['count']); + $attr[$binaryAttr[$i]] = $binData; + } + } // save original attributes $this->attributes_orig = $attr; @@ -1564,7 +1573,7 @@ class accountContainer { $stopprocessing = true; } } - // removce attributes + // remove attributes if (isset($attributes[$DNs[$i]]['remove']) && !$stopprocessing) { $success = @ldap_mod_del($_SESSION['ldap']->server(), $DNs[$i], $attributes[$DNs[$i]]['remove']); if (!$success) {