Net::LDAP::Schema(3pm) | User Contributed Perl Documentation | Net::LDAP::Schema(3pm) |
Net::LDAP::Schema - Load and manipulate an LDAP v3 Schema
use Net::LDAP; use Net::LDAP::Schema; # # Read schema from server # $ldap = Net::LDAP->new ( $server ); $ldap->bind ( ); $schema = $ldap->schema ( ); # # Load from LDIF # $schema = Net::LDAP::Schema->new; $schema->parse ( "schema.ldif" ) or die $schema->error;
"Net::LDAP::Schema" provides a means to load an LDAP schema and query it for information regarding supported objectclasses, attributes and syntaxes.
Where a method is stated as taking the 'name or OID' of a schema item (which may be an object class, attribute or syntax) then a case-insensitive name or raw OID (object identifier, in dotted numeric string form, e.g. 2.5.4.0) may be supplied.
Each returned item of schema (eg an attribute definition) is returned in a HASH. The keys in the returned HASH are lowercase versions of the keys read from the server. Here's a partial list (not all HASHes define all keys) although note that RFC 4512 permits other keys as well:
name desc obsolete sup equality ordering substr syntax single-value collective no-user-modification usage abstract structural auxiliary must may applies aux not oc form
$attr_href = $schema->attribute( "attrname" );
$result = $schema->dump ( "./schema.dump" );
If no schema data is returned from directory server, the method will return undefined. Otherwise a value of 1 is always returned.
@may = $schema->may ( $oc ); # First optional attr has the name '$may[0]->{name}'
@must = $schema->must ( $oc );
If the argument is a message result from a search, "Net::LDAP::Schema" will parse the schema from the first entry returned.
Returns true on success and "undef" on error.
Net::LDAP, Net::LDAP::RFC
Graham Barr <gbarr@pobox.com> John Berthels <jjb@nexor.co.uk>
Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org>.
Copyright (c) 1998-2004 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
2015-04-02 | perl v5.20.2 |