Changeset 575


Ignore:
Timestamp:
01/06/10 08:01:09 (14 years ago)
Author:
nanardon
Message:
  • properly get main address, department and cells
File:
1 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/import/epo.pl

    r571 r575  
    4040        $changes{sn} = $passwd[0]; 
    4141        $changes{sn} =~ s/_/ /g; 
    42         $changes{givenName} = $passwd[1]; 
    43         $changes{givenName} =~ s/_/ /g; 
     42        if ($passwd[1] ne 'Compte-de-service') { 
     43            $changes{givenName} = $passwd[1]; 
     44            $changes{givenName} =~ s/_/ /g; 
     45        } 
    4446        if ($passwd[10] =~ /^NICK(.*)$/) { 
    4547            if ($1 eq 'zzz') { 
     
    4749            } else { $changes{nickname} = $1 } 
    4850        } 
    49         $changes{mail} = $passwd[9]; 
    50         $changes{mail} =~ s/cetp.ipsl.fr/latmos.ipsl.fr/; 
     51 
     52        if ($passwd[1] ne 'Compte-de-service') { 
     53            $changes{mail} = $passwd[13]; 
     54            $changes{mail} =~ s/cetp.ipsl.fr/latmos.ipsl.fr/; 
     55        } 
    5156    } 
    5257 
     
    5863 
    5964 
     65        if ($passwd[1] ne 'Compte-de-service') { 
    6066        foreach my $col (3, 5, 7) { 
    6167            if($passwd[$col] ne 'AJETER') { 
     
    7278                    /^SAV$/i and do { 
    7379                        $param{site} = 'VerriÚres'; 
    74                         $passwd[14] =~ /aerov/ and $param{isMainAddress} = 1; 
     80                        $passwd[18] =~ /aerov/ and $param{isMainAddress} = 1; 
    7581                        last; 
    7682                    }; 
    7783                    /^Vel$/i and do { 
    7884                        $param{site} = 'Vélizy'; 
    79                         $passwd[14] =~ /cetp/ and $param{isMainAddress} = 1; 
     85                        $passwd[18] =~ /cetp/ and $param{isMainAddress} = 1; 
    8086                        last; 
    8187                    }; 
     
    8692                    /^SAJ$/i and do { 
    8793                        $param{site} = 'Jussieu'; 
    88                         $passwd[14] =~ /aero$/ and $param{isMainAddress} = 1; 
     94                        $passwd[18] =~ /aero$/ and $param{isMainAddress} = 1; 
    8995                        last; 
    9096                    }; 
     
    113119            $changes{grade} = $1; 
    114120        }; 
     121        } # Not compte-de-service 
     122        else { 
     123            $changes{grade} = undef, 
     124            $changes{expire} = undef; 
     125            $changes{description} = "$passwd[1] $passwd[0]"; 
     126        } 
    115127    } 
    116128 
    117129    { 
    118130        my @group = @{ $obj->get_c_field('memberOf') || []}; 
    119         foreach ($passwd[20] =~ /^DOM(.*)/g) { 
    120             $changes{departement} = '$1'; 
    121             push @group, $1; 
     131        foreach (split('DOM', $passwd[19])) { 
     132            $_ or next; 
     133            $changes{department} ||= $_; 
     134            push @group, $_; 
    122135            next; 
     136        } 
     137        foreach (split('CEL', $passwd[20])) { 
     138            $_ or next; 
     139            push @group, $_; 
    123140        } 
    124141        $changes{'memberOf'} = \@group; 
Note: See TracChangeset for help on using the changeset viewer.