note 100348 added to function.ldap-modify
| From: | think at osu1 dot php dot net | Date: | Sun, 10 Oct 2010 00:39:01 +0000 |
| Subject: | note 100348 added to function.ldap-modify | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-173109@lists.php.net to get a copy of this message | ||
Oops, addendum to my last note - $entry is always an array (associative), but I was referring to the
case where any one of the array values is itself an array (which creates multiple-valued attributes
in the LDAP entry).
So, this probably won't work:
$entry = array('mail' => array(0 => 'aaa@example.com', 2 =>
'bbb@example.com');
Because array index 1 is missing for the nested array - you'll get anomalous behavior
(ldap_modify() returned FALSE for me, but ldap_error() reported "Success").
This won't work either:
$entry = array('mail' => array(0 => 'aaa@example.com', 1 =>
'', 2 => 'bbb@example.com');
Because array index 1 has a blank value, you should get a syntax error.
This is the best way to ensure nothing will go wrong:
$entry = array('mail' => array(0 => 'aaa@example.com', 1 =>
'bbb@example.com');
----
Server IP: 64.71.164.2
Probable Submitter: 69.107.104.23
----
Manual Page -- http://www.php.net/manual/en/function.ldap-modify.php
Edit -- https://master.php.net/note/edit/100348
Del: integrated -- https://master.php.net/note/delete/100348/integrated
Del: useless -- https://master.php.net/note/delete/100348/useless
Del: bad code -- https://master.php.net/note/delete/100348/bad+code
Del: spam -- https://master.php.net/note/delete/100348/spam
Del: non-english -- https://master.php.net/note/delete/100348/non-english
Del: in docs -- https://master.php.net/note/delete/100348/in+docs
Del: other reasons-- https://master.php.net/note/delete/100348
Reject -- https://master.php.net/note/reject/100348
Search -- https://master.php.net/manage/user-notes.php