[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  #!/usr/bin/perl
   2  
   3  use Net::LDAP;
   4  
   5  require '/etc/SeConfig.ph';
   6  
   7  # Suppression des comptes utilisateurs
   8  $lcs_ldap = Net::LDAP->new("$slapdIp");
   9  $lcs_ldap->bind(
  10          dn       => $adminDn,
  11          password => $adminPw,
  12          version  => '3'
  13          );
  14  $res = $lcs_ldap->search(base   => "$computersDn",
  15               scope  => 'one',
  16               filter => 'objectClass=ieee802Device');
  17  warn $res->error if $res->code;
  18  foreach $entry ($res->entries) {
  19    $cn = $entry->get_value('cn');
  20    $l = $entry->get_value('l');
  21    next if ($l eq 'Maitre' or $l eq 'esclave');
  22    $res = $lcs_ldap->delete("cn=$cn,$computersDn");
  23    print "Suppression de la machine $cn\n";
  24    warn $res->error if $res->code;
  25  }


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