note 103586 added to function.ldap-get-values-len
| From: | Stav at osu1 dot php dot net | Date: | Thu, 21 Apr 2011 12:38:31 +0000 |
| Subject: | note 103586 added to function.ldap-get-values-len | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-179041@lists.php.net to get a copy of this message | ||
I had a lot of issues with decoding errors using ldap_get_values_len() and found a of unanswered
calls for help on a lot of forums.
The error message is - Warning: ldap_get_values(): Cannot get the value(s) of attribute Decoding
error in xxx.php.
It appears that this error seems to cover a multitude sins including simple typos in the attribute
name.
After using PHP to list the attributes of a particular record I noticed that the attribute
userCertificate wasn't listed simply as userCertificate but userCertificate;binary instead. I
wrote this into my code and all was fixed.
So my code looks as follows.
if (!$val = @ldap_get_values_len($con, $entry, "$attribute;binary"))
die ('Error retrieving value (' . ldap_error($con) . ')');
I hope this saves someone the pain I went through trawling Google for an answer.
----
Server IP: 69.147.83.197
Probable Submitter: 86.149.195.100
----
Manual Page -- http://www.php.net/manual/en/function.ldap-get-values-len.php
Edit -- https://master.php.net/note/edit/103586
Del: integrated -- https://master.php.net/note/delete/103586/integrated
Del: useless -- https://master.php.net/note/delete/103586/useless
Del: bad code -- https://master.php.net/note/delete/103586/bad+code
Del: spam -- https://master.php.net/note/delete/103586/spam
Del: non-english -- https://master.php.net/note/delete/103586/non-english
Del: in docs -- https://master.php.net/note/delete/103586/in+docs
Del: other reasons-- https://master.php.net/note/delete/103586
Reject -- https://master.php.net/note/reject/103586
Search -- https://master.php.net/manage/user-notes.php