Doc #55248 [Asn->Opn]: example data are inconsistent
| From: | frozenfire@php.net | Date: | Wed, 21 Dec 2011 19:01:19 +0000 |
| Subject: | Doc #55248 [Asn->Opn]: example data are inconsistent | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7697@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55248&edit=1
ID: 55248
Updated by: frozenfire@php.net
Reported by: drupal at paratio dot com
Summary: example data are inconsistent
-Status: Assigned
+Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: Ubuntu 10.4 LTS
PHP Version: Irrelevant
-Assigned To: frozenfire
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2011-12-02 17:14:41] drupal at paratio dot com
Hello frozenfire,
I think who wants to use this php function should know how LDAP works.
We can provide two examples are the best way to describe how to handle a simple and a more complex
LDAP data entry.
In the the first example the mail-attribute should be removed because it's wrong:
$info["cn"] = "John Jones";
$info["sn"] = "Jones";
$info["objectclass"] = "person";
The second example with email is a little bit more complex because a second objectclass:
$info["cn"] = "John Jones";
$info["sn"] = "Jones";
$info["mail"] = "jonj@example.com";
$info["objectclass"][] = "person";
$info["objectclass"][] = "inetOrgPerson";
Maybe an information about LDAP is helpful because LDAP only accept right structured data. If you
want to save any kind of
attribute you have to declare additionally the right objectclass. The next thing to understand is
that the LDAP server has
to know the right information schema where the objectclasses are described. This only ca be handled
with LDAP
configuration not by PHP.
The objectclass "person" is provided by the schema "core" and the objectclass
"inetOrgPerson" is provided by the schema
"inetorgperson". If somebody needs other data structures as existing schemas can provide
there is only one clean way to
declare: You need to request an organisation number from the IANA (Internet Assigned Numbers
Authority).
kind regards,
Carsten
------------------------------------------------------------------------
[2011-07-27 22:30:38] frozenfire@php.net
I'd prefer to make the latter change, expanding the example, rather than removing
that bit. But, I've not used LDAP, so I'm unsure how to represent that
functionality. Could you provide some example code to do so? I'd greatly
appreciate that.
Otherwise, I'll just remove the line.
------------------------------------------------------------------------
[2011-07-20 06:25:27] drupal at paratio dot com
Description:
------------
---
From manual page: http://www.php.net/function.ldap-add%23Examples
---
This are the example data:
$info["cn"] = "John Jones";
$info["sn"] = "Jones";
$info["mail"] = "jonj@example.com";
$info["objectclass"] = "person";
The objectclass "person" does not contain the mail attribute. So this example
doesn't work with LDAP.
Just remove the mail entry or expand the example with the object class
"inetOrgPerson" where "mail" is a MAY attribute.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55248&edit=1