X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=bin%2Fsvc_acct.import;h=eaf0c03c53985c837d4d3cc647bdacc76e87804a;hb=a03e44937be8d6c2f99dc830ef2583cbbbb36dfc;hp=6541a9fd4b2f258259f419b84f6af55270813458;hpb=eb815cc14f3fea0a8d68b22b2fbf282eae09a92a;p=freeside.git diff --git a/bin/svc_acct.import b/bin/svc_acct.import index 6541a9fd4..eaf0c03c5 100755 --- a/bin/svc_acct.import +++ b/bin/svc_acct.import @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: svc_acct.import,v 1.7 1999-07-08 02:32:26 ivan Exp $ +# $Id: svc_acct.import,v 1.15 2001-07-30 06:07:47 ivan Exp $ # # ivan@sisd.com 98-mar-9 # @@ -17,7 +17,28 @@ # don't import /var/spool/freeside/conf/shells! ivan@sisd.com 98-aug-13 # # $Log: svc_acct.import,v $ -# Revision 1.7 1999-07-08 02:32:26 ivan +# Revision 1.15 2001-07-30 06:07:47 ivan +# allow !! for locked accounts instead of changing to *SUSPENDED* +# +# Revision 1.14 2001/05/07 15:24:15 ivan +# s/!/*/ +# +# Revision 1.13 2001/05/05 08:51:16 ivan +# http://www.sisd.com/freeside/list-archive/msg01915.html +# +# Revision 1.12 2001/04/22 01:56:15 ivan +# get rid of FS::SSH.pm (became Net::SSH and Net::SCP on CPAN) +# +# Revision 1.11 2000/06/29 12:27:01 ivan +# s/password/_password/ for PostgreSQL wasn't done in the import. +# +# Revision 1.10 2000/06/28 12:32:30 ivan +# allow RADIUS lines with "Auth-Type = Local" too +# +# Revision 1.8 2000/02/03 05:16:52 ivan +# beginning of DNS and Apache support +# +# Revision 1.7 1999/07/08 02:32:26 ivan # import fix, noticed by Ben Leibig and Joel Griffiths # # Revision 1.6 1999/07/08 01:49:00 ivan @@ -40,7 +61,7 @@ use strict; use vars qw(%part_svc); use Date::Parse; use Term::Query qw(query); -use FS::SSH qw(iscp); +use Net::SCP qw(iscp); use FS::UID qw(adminsuidsetup datasrc); use FS::Record qw(qsearch); use FS::svc_acct; @@ -142,12 +163,13 @@ my(%upassword,%ip,%allparam); my(%param,$username); while () { chop; - next if /^$/; + next if /^\s*$/; + next if /^\s*#/; if ( /^\S/ ) { - /^(\w+)\s+Password\s+=\s+"([^"]+)"(,\s+Expiration\s+=\s+"([^"]*")\s*)?$/ + /^(\w+)\s+(Auth-Type\s+=\s+Local,\s+)Password\s+=\s+"([^"]+)"(,\s+Expiration\s+=\s+"([^"]*")\s*)?$/ or die "1Unexpected line in users.import: $_"; my($password,$expiration); - ($username,$password,$expiration)=(lc($1),$2,$4); + ($username,$password,$expiration)=(lc($1),$3,$5); $password = '' if $password eq 'UNIX'; $upassword{$username}=$password; undef %param; @@ -187,6 +209,8 @@ my(%password); while () { chop; my($username,$password)=split(/:/); + #$password =~ s/^\!$/\*/; + #$password =~ s/\!+/\*SUSPENDED\* /; $password{$username}=$password; } @@ -212,15 +236,15 @@ while () { } my($svc_acct) = new FS::svc_acct ({ - 'svcpart' => $svcpart, - 'username' => $username, - 'password' => $password, - 'uid' => $uid, - 'gid' => $gid, - 'finger' => $finger, - 'dir' => $dir, - 'shell' => $shell, - 'slipip' => $ip{$username}, + 'svcpart' => $svcpart, + 'username' => $username, + '_password' => $password, + 'uid' => $uid, + 'gid' => $gid, + 'finger' => $finger, + 'dir' => $dir, + 'shell' => $shell, + 'slipip' => $ip{$username}, %{$allparam{$username}}, }); my($error); @@ -246,10 +270,10 @@ foreach $username ( keys %upassword ) { } my($svc_acct) = new FS::svc_acct ({ - 'svcpart' => $svcpart, - 'username' => $username, - 'password' => $password, - 'slipip' => $ip{$username}, + 'svcpart' => $svcpart, + 'username' => $username, + '_password' => $password, + 'slipip' => $ip{$username}, %{$allparam{$username}}, }); my($error); @@ -263,6 +287,6 @@ foreach $username ( keys %upassword ) { # sub usage { - die "Usage:\n\n svc_acct.export user\n"; + die "Usage:\n\n svc_acct.import user\n"; }