rajout doc
mise au point password.pl qui prend une branche en parametre mise au point add_attribute.pl qui rajoute l'OC le cas echeant
This commit is contained in:
16
password.pl
16
password.pl
@@ -9,7 +9,9 @@ use Net::LDAP;
|
||||
my $ldapserver = "localhost";
|
||||
my $binddn = "cn=manager,o=od";
|
||||
my $bindpw = "123Soleil" ;
|
||||
my $base = 'ou=peopleEnt,o=od' ;
|
||||
|
||||
|
||||
my $base = $ARGV[0] or die 'gimme a valid ldap base\n' ;
|
||||
|
||||
my $ldap = Net::LDAP->new( $ldapserver ) or die "$@" ;
|
||||
|
||||
@@ -19,6 +21,18 @@ my $mesg = $ldap->bind( $binddn,
|
||||
|
||||
$mesg->code and die $mesg->error; # check for errors
|
||||
|
||||
$mesg = $ldap->search(
|
||||
scope => 'base',
|
||||
attrs => ['1.1'],
|
||||
base => $base ,
|
||||
filter=> '(objectClass=*)',
|
||||
);
|
||||
die $mesg->error if $mesg->code ;
|
||||
|
||||
if( $mesg -> count() ==0 ) {
|
||||
die( "Wrong base or unknown error\n") ;
|
||||
}
|
||||
|
||||
$mesg = $ldap->search(
|
||||
base=> $base,
|
||||
filter=>"(&(objectClass=person)(userpassword=*))",
|
||||
|
||||
Reference in New Issue
Block a user