11 |
|
|
12 |
BEGIN { Jifty->new; }; |
BEGIN { Jifty->new; }; |
13 |
|
|
14 |
my $ldap = Net::LDAP->new( 'ldap1.skole.local' ) or die "$@"; |
#warn "# config->app(LDAP) = ",dump( Jifty->config->app('LDAP') ); |
15 |
|
|
16 |
|
my $ldap = Net::LDAP->new( Jifty->config->app('LDAP')->{Server} ) or die "$@"; |
17 |
|
|
18 |
# an anonymous bind |
# an anonymous bind |
19 |
my $mesg = $ldap->bind; |
#my $mesg = $ldap->bind; |
20 |
|
my $mesg = $ldap->bind( |
21 |
|
DN => Jifty->config->app('LDAP')->{DN}, |
22 |
|
password => Jifty->config->app('LDAP')->{Password}, |
23 |
|
); |
24 |
|
|
25 |
# perform a search |
# perform a search |
26 |
$mesg = $ldap->search( |
$mesg = $ldap->search( |
27 |
base => "dc=skole,dc=hr", |
base => "dc=skole,dc=hr", |
28 |
# filter => "(&(sn=Barr) (o=Texas Instruments))", |
# filter => "(&(sn=Barr) (o=Texas Instruments))", |
29 |
filter => "(objectClass=hrEduPerson)", |
filter => "(objectClass=hrEduPerson)", |
30 |
sizelimit => 100, # off |
sizelimit => 3, # 0 = off |
31 |
); |
); |
32 |
|
|
33 |
if ( $mesg->code ) { |
if ( $mesg->code ) { |