X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Fsqlradius.reimport;h=2218a3f138bf5d985940f7279fe73454db6995b7;hp=89eb8018bb3b3252577693cc72d2ac10dedb9d61;hb=97c0616b60819a23dbc6d7d6ebf2ff1dc3446e91;hpb=8129c04d556355377faf90a6207acbac5f9bb805 diff --git a/bin/sqlradius.reimport b/bin/sqlradius.reimport index 89eb8018b..2218a3f13 100755 --- a/bin/sqlradius.reimport +++ b/bin/sqlradius.reimport @@ -107,7 +107,8 @@ while ( defined ( $row = $sth->fetchrow_arrayref ) ) { } } - my( $password, $finger, $group ) = ( '', '', '' ); + #my( $password, $finger, $group ) = ( '', '', '' ); + my( $password, $group ) = ( '', '', '' ); my $rc_sth = $dbh->prepare( 'SELECT Attribute, Value, Name, GroupName'. @@ -118,9 +119,9 @@ while ( defined ( $row = $sth->fetchrow_arrayref ) ) { foreach my $rc_row ( @{$rc_sth->fetchall_arrayref} ) { my($attribute, $value, $name, $groupname) = @$rc_row; - if ( $attribute =~ /^(Crypt-)?Password$/ ) { + if ( $attribute =~ /^((Crypt|User)-)?Password$/ ) { $password = $value; - $finger = $name; + #$finger = $name; $group = $groupname; } else { #handle other params! @@ -131,7 +132,8 @@ while ( defined ( $row = $sth->fetchrow_arrayref ) ) { qsearch('svc_acct', { 'username' => $username, 'domsvc' => $svc_domain->svcnum, } ); - print "$r_username / $realm: $password / $finger: "; + #print "$r_username / $realm: $password / $finger: "; + print "$r_username / $realm: $password: "; if ( scalar(@svc_acct) == 0 ) { print "not found\n"; next; @@ -139,11 +141,13 @@ while ( defined ( $row = $sth->fetchrow_arrayref ) ) { print "multiple matches found?!?!\n"; next; } else { - print "correcting password and name\n"; + #print "correcting password and name\n"; + print "correcting password\n"; } my $svc_acct = $svc_acct[0]; - my $new = new FS::svc_acct { $svc_acct->hash, '_password' => $password, 'finger' => $finger }; + #my $new = new FS::svc_acct { $svc_acct->hash, '_password' => $password, 'finger' => $finger }; + my $new = new FS::svc_acct { $svc_acct->hash, '_password' => $password }; my $error = $new->replace($svc_acct); #my $error = $new->check; die "$r_username / $realm: $error" if $error; @@ -151,6 +155,6 @@ while ( defined ( $row = $sth->fetchrow_arrayref ) ) { } sub usage { - die "Usage:\n\n sqlradius.import user\n"; + die "Usage:\n\n sqlradius.reimport user\n"; }