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:
2019-10-22 19:16:18 +02:00
parent 0a0aeb3a9b
commit f58797b35e
4 changed files with 137 additions and 68 deletions

View File

@@ -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=*))",