[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/usr/share/se3/sbin/ -> coursDel.pl (source)

   1  #!/usr/bin/perl
   2  
   3  use Net::LDAP;
   4  
   5  require '/etc/SeConfig.ph';
   6  
   7  $dn = shift @ARGV;
   8  $rdnValue = (split /=/, (split /,/, $dn)[0])[1];
   9  
  10  $ldap = Net::LDAP->new(
  11                           "$slapdIp",
  12                         port    => "$slapdPort",
  13                         debug   => "$slapdDebug",
  14                         timeout => "$slapdTimeout",
  15                         version => "$slapdVersion"
  16                        );
  17  $ldap->bind(
  18              $adminDn,
  19              password => $adminPw
  20             );
  21  
  22  $res = $ldap->search(
  23                      base     => "ou=groups,$baseDn",
  24                      scope    => 'sub',
  25                      attrs    => ['dn'],
  26                      filter   => "(&(cn=Cours*))"
  27                      );
  28  
  29  foreach $entry ($res->entries) {
  30      $del = $ldap->delete($entry->dn);
  31  }
  32  
  33  exit O;


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1