[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

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

   1  #!/usr/bin/perl
   2  
   3  use Net::LDAP;
   4  use Encode::compat;
   5  use Encode qw(encode decode);
   6  #use Text::Unaccent;
   7  
   8  require '/etc/SeConfig.ph';
   9  
  10  die("Erreur d'argument.\n") if ($#ARGV != 1);
  11  ($uid, $act) = @ARGV;
  12  $dn = "uid=$uid,$peopleDn";
  13  
  14  #print $dn;
  15  $ldap = Net::LDAP->new(
  16                          "$slapdIp",
  17                          port    => "$slapdPort",
  18                          debug   => "$slapdDebug",
  19                          timeout => "$slapdTimeout",
  20                          version => "$slapdVersion"
  21                         );
  22  $ldap->bind(
  23               $adminDn,
  24               password => $adminPw
  25              );
  26  #print $act;
  27  if($act) { $valeur='[U           ]'; } else { $valeur='[UD          ]';}
  28  #print $valeur;
  29  if ($smbversion eq "samba3") {
  30      $res = $ldap->modify(
  31                           $dn,
  32                           replace => {
  33                                       sambaAcctFlags => $valeur,
  34                                      }
  35                          );
  36  } else {
  37      $res = $ldap->modify(
  38                           $dn,
  39                           replace => {
  40                                       acctFlags => $valeur,
  41                                      }
  42                          );
  43  }
  44    warn $res->error if $res->code != LDAP_SUCCESS;
  45    
  46  #print $res;


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