[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 =head1 NAME 2 3 Net::LDAP::Schema - Load and manipulate an LDAP v3 Schema 4 5 =head1 SYNOPSIS 6 7 use Net::LDAP; 8 use Net::LDAP::Schema; 9 10 # 11 # Read schema from server 12 # 13 $ldap = Net::LDAP->new ( $server ); 14 $ldap->bind ( ); 15 $schema = $ldap->schema ( ); 16 17 # 18 # Load from LDIF 19 # 20 $schema = Net::LDAP::Schema->new; 21 $schema->parse ( "schema.ldif" ) or die $schema->error; 22 23 =head1 DESCRIPTION 24 25 C<Net::LDAP::Schema> provides a means to load an LDAP schema and query it 26 for information regarding supported objectclasses, attributes and syntaxes. 27 28 =head1 METHODS 29 30 Where a method is stated as taking the 'name or oid' of a schema item (which 31 may be an object class, attribute or syntax) then a case-insensitive name 32 or raw oid (object identifier, in dotted numeric string form, e.g. 2.5.4.0) 33 may be supplied. 34 35 Each returned item of schema (eg an attribute definition) is returned 36 in a HASH. The keys in the returned HASH are lowercased versions of 37 the keys read from the server. Here's a partial list (not all HASHes 38 define all keys) although note that RFC 2252 permits other keys as 39 well: 40 41 name 42 desc 43 obsolete 44 sup 45 equality 46 ordering 47 substr 48 syntax 49 single-value 50 collective 51 no-user-modification 52 usage 53 abstract 54 structural 55 auxiliary 56 must 57 may 58 applies 59 aux 60 not 61 oc 62 form 63 64 =over 4 65 66 =item all_attributes ( ) 67 68 =item all_ditcontentrules ( ) 69 70 =item all_ditstructurerules ( ) 71 72 =item all_matchingrules ( ) 73 74 =item all_matchingruleuses ( ) 75 76 =item all_nameforms ( ) 77 78 =item all_objectclasses ( ) 79 80 =item all_syntaxes ( ) 81 82 Returns a list of all the requested types in the schema. 83 84 =item attribute ( NAME ) 85 86 =item ditcontentrule ( NAME ) 87 88 =item ditstructurerule ( NAME ) 89 90 =item matchingrule ( NAME ) 91 92 =item matchingruleuse ( NAME ) 93 94 =item nameform ( NAME ) 95 96 =item objectclass ( NAME ) 97 98 =item syntax ( NAME ) 99 100 Returns a reference to a hash, or C<undef> if the schema item does not 101 exist. C<NAME> can be a name or an OID. 102 103 $attr_href = $schema->attribute( "attrname" ); 104 105 =item dump ( ) 106 107 Dump the raw schema information to standard out. 108 109 =item dump ( FILENAME ) 110 111 Dump the raw schema information to a file. 112 113 $result = $schema->dump ( "./schema.dump" ); 114 115 If no schema data is returned from directory server, the method will 116 return undefined. Otherwise a value of 1 is always returned. 117 118 =item error ( ) 119 120 Returns the last error encountered when parsing the schema. 121 122 =item may ( OBJECTCLASS ) 123 124 Given an argument which is the name or oid of a known object class, 125 returns a list of HASHes describing the attributes which are optional 126 in the class. 127 128 @may = $schema->may ( $oc ); 129 # First optional attr has the name '$may[0]->{name}' 130 131 =item must ( OBJECTCLASS ) 132 133 Given an argument which is the name or oid of a known object class, 134 returns a list of HASHes describing the attributes which are mandatory 135 in the class. 136 137 @must = $schema->must ( $oc ); 138 139 =item parse ( MESG ) 140 141 =item parse ( ENTRY ) 142 143 =item parse ( FILENAME ) 144 145 Takes a single argument which can be any of, a message object returned 146 from an LDAP search, a C<Net::LDAP::Entry> object or the name of a 147 file containing an LDIF form of the schema. 148 149 If the argument is a message result from a search, 150 C<Net::LDAP::Schema> will parse the schema from the first entry 151 returned. 152 153 Returns true on success and C<undef> on error. 154 155 =item superclass ( NAME ) 156 157 Given an argument which is the name or oid of a known objectclass, 158 returns the list of names of the immediate superclasses. 159 160 =item matchingrule_for_attribute ( NAME, RULE ) 161 162 Given an attribute name and a matching rule (C<equality>, 163 C<substr>, etc), return the actual rule taking into account attribute 164 supertypes. 165 166 =back 167 168 =head1 SEE ALSO 169 170 L<Net::LDAP>, 171 L<Net::LDAP::RFC> 172 173 =head1 AUTHORS 174 175 Graham Barr E<lt>gbarr@pobox.comE<gt> 176 John Berthels E<lt>jjb@nexor.co.ukE<gt> 177 178 Please report any bugs, or post any suggestions, to the perl-ldap mailing list 179 E<lt>perl-ldap@perl.orgE<gt>. 180 181 =head1 COPYRIGHT 182 183 Copyright (c) 1998-2004 Graham Barr. All rights reserved. This program is 184 free software; you can redistribute it and/or modify it under the same 185 terms as Perl itself. 186 187 =cut
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Mar 17 22:47:18 2015 | Cross-referenced by PHPXref 0.7.1 |