cvs: pear /Net_LDAP/doc manual.txt

From: Date: Tue, 03 Aug 2004 10:05:32 +0000
Subject: cvs: pear /Net_LDAP/doc manual.txt
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-22509@lists.php.net to get a copy of this message
tarjei Tue Aug 3 06:05:32 2004 EDT Modified files: /pear/Net_LDAP/doc manual.txt Log: Some day .. this will be done. :-) Added: * Added schemahandling. http://cvs.php.net/diff.php/pear/Net_LDAP/doc/manual.txt?r1=1.1&r2=1.2&ty=u Index: pear/Net_LDAP/doc/manual.txt diff -u pear/Net_LDAP/doc/manual.txt:1.1 pear/Net_LDAP/doc/manual.txt:1.2 --- pear/Net_LDAP/doc/manual.txt:1.1 Wed Jul 7 15:53:10 2004 +++ pear/Net_LDAP/doc/manual.txt Tue Aug 3 06:05:32 2004 @@ -90,4 +90,75 @@ 'sub' => All subentries. 'one' => All entries just below the searchbase. -Searching with scope 'base' may be handy for getting just one entry. But then again, that's what you got the getEntry function for. \ No newline at end of file +Searching with scope 'base' may be handy for getting just one entry. But then again, that's what you got the getEntry function for. + +<h2>Entrys</h2> + +Getting an entry. Modifying it. + + +<h2>Schemas</h2> +You may also use Net_LDAP to find out what schemas your ldap-server supports. Here's an example of how: + +$schema = $ldap->schema(); + +Now you got a schemaobject. + +To read from this schemaobject, you have several methods. + +For example, to find out which attributes are required for inetOrgPerson, you do this: + +$required = $schema->must( 'inetOrgUser' ); + +print_r($required) yeelds: +Array +( + [0] => sn + [1] => cn +) + +Ok, but what kind of attribute is sn? Let's check: + +$att = $schema->get('attribute','sn'); + +Array +( + [aliases] => Array + ( + [0] => surname + ) + + [oid] => 2.5.4.4 + [name] => sn + [desc] => RFC2256: last (family) name(s) for which the entity is known by + [sup] => Array + ( + [0] => name + ) + [type] => attribute +) + +Hmm, ok, the sup part is important. It means that surname derives it's syntax from another attribute, +the name attribute. So , we need to check that as well. +We do: +$att_dep = $schema->get('attribute',$att['sup'][0]); + +Array +( + [aliases] => Array + ( + ) + + [oid] => 2.5.4.41 + [name] => name + [desc] => RFC2256: common supertype of name attributes + [equality] => caseIgnoreMatch + [substr] => caseIgnoreSubstringsMatch + [syntax] => 1.3.6.1.4.1.1466.115.121.1.15{32768} + [max_length] => 32768 + [type] => attribute +) +From this we find out that the attribute has a maxlength of 32768 characters and has the syntax 1.3.6.1.4.1.1466.115.121.1.15{32768}. + + +

« previous php.pear.cvs (#22509) next »