I'm trying to use the Net::LDAP::Schema with perl-ldap 0.29 .... can't figure out how
the heck the must method works now. It use to turn a list of scalar variables. Now
it returns hash references. What happened? How am I supposed to get attribute,
objectclass names, oids, etc .. now? There are no examples, that I've been able to
find nor are there any explanations. Hoping you can provide me with one:
if (scalar(@classdefs) >= 1) {
$ldap = Net::LDAP->new($hname,port => 389, version =>3, debug => 0);
if (defined $ldap) {
$mesg = $ldap->bind($binddn, password => $bindpw);
if ($mesg->code == 0) {
$schema = $ldap->schema();
foreach $classname ( @classdefs ) {
@must = $schema->must($classname);
if (scalar(@must) >= 1) {
foreach $attr ( @must ) {
print STDERR "Required Attribute found: ",$attr,"\n";
push @mustattrs,$attr;
}
}
}
foreach $classname ( @classdefs ) {
@may = $schema->may($classname);
if (scalar(@may) >= 1) {
foreach $attr ( @may ) {
print STDERR "Optional Attribute found: ",$attr,"\n";
push @mayattrs,$attr;
}
}
}
} else {
print STDERR "Bind failed, ",$mesg->error,". Abort\n";
exit;
}
Use default template for add operations? [y/n]: n
Configure class membership
Entry objectclass [ENTER to quit]: mirapointuser
Entry objectclass [ENTER to quit]: mirapointmailuser
Entry objectclass [ENTER to quit]:
Required Attribute found: HASH(0x8470f54)
Optional Attribute found: HASH(0x84a5460)
Optional Attribute found: HASH(0x849ef00)
Optional Attribute found: HASH(0x84aa658)
Optional Attribute found: HASH(0x849cc18)
Optional Attribute found: HASH(0x8470fd8)
Optional Attribute found: HASH(0x84905b0)
Optional Attribute found: HASH(0x84a0edc)
Optional Attribute found: HASH(0x84a2f6c)
Optional Attribute found: HASH(0x84a25bc)
Optional Attribute found: HASH(0x84a3484)
Optional Attribute found: HASH(0x84a3fb4)
Optional Attribute found: HASH(0x84a0d38)
Optional Attribute found: HASH(0x84a54f0)
Optional Attribute found: HASH(0x84a0538)
Optional Attribute found: HASH(0x84a26f4)
Optional Attribute found: HASH(0x84a3514)
Optional Attribute found: HASH(0x84aa658)
Optional Attribute found: HASH(0x8470f54)
Optional Attribute found: HASH(0x84a04a8)
Optional Attribute found: HASH(0x84aa7a8)
Optional Attribute found: HASH(0x84a0658)
Optional Attribute found: HASH(0x84a3634)
Optional Attribute found: HASH(0x84aaf0c)
Optional Attribute found: HASH(0x84aa70c)
Optional Attribute found: HASH(0x84a0c24)
Optional Attribute found: HASH(0x84a0dc8)
Optional Attribute found: HASH(0x84a249c)
Optional Attribute found: HASH(0x84a0424)
Optional Attribute found: HASH(0x84a05c8)
Optional Attribute found: HASH(0x84a2790)
Optional Attribute found: HASH(0x84a240c)
Optional Attribute found: HASH(0x84a0778)
Optional Attribute found: HASH(0x84a340c)
Optional Attribute found: HASH(0x84a06e8)
Optional Attribute found: HASH(0x84a0e4c)
Optional Attribute found: HASH(0x84a252c)
Optional Attribute found: HASH(0x84a0cb4)
Optional Attribute found: HASH(0x84a3598)
Optional Attribute found: HASH(0x84aaf84)
Optional Attribute found: HASH(0x84a0f6c)
Optional Attribute found: HASH(0x84a2c48)
Optional Attribute found: HASH(0x84a264c)
Specify a val template for each attribute using one of the following:
fullname
firstname
lastname
address
phone
fax
uniqueid
title
email
mobile
manager
hostname
integer
randomstring
randomdn
HASH(0x8470f54) value template: