summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2001-09-19 00:24:27 +0000
committerivan <ivan>2001-09-19 00:24:27 +0000
commita08088c61827caac7d518ffa771494f4eceb11a9 (patch)
tree20bf7d4507c81371bb4e43f85c7039364d76ddda
parent87661d51ce44b78c5b156f4ee7c52e75a9d38746 (diff)
icradius transactional password changes (suspensions, unsuspensions)
-rw-r--r--FS/FS/svc_acct.pm25
1 files changed, 24 insertions, 1 deletions
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index c6b65936a..fb773c09a 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -572,10 +572,33 @@ sub replace {
}
}
+ if ( $icradius_dbh ) {
+ my $queue = new FS::queue { 'job' => 'FS::svc_acct::icradius_rc_replace' };
+ $error = $queue->insert( $new->username,
+ $new->_password,
+ );
+ if ( $error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "queueing job (transaction rolled back): $error";
+ }
+ }
+
$dbh->commit or die $dbh->errstr if $oldAutoCommit;
''; #no error
}
+sub icradius_rc_replace {
+ my( $username, $new_password ) = @_;
+
+ my $sth = $icradius_dbh->prepare(
+ "UPDATE radcheck SET Value = ? WHERE UserName = ? and Attribute = ?"
+ );
+ $sth->execute($new_password, $username, 'Password' )
+ or die "can't update radcheck table: ". $sth->errstr;
+
+ 1;
+}
+
=item suspend
Suspends this account by prefixing *SUSPENDED* to the password. If there is an
@@ -844,7 +867,7 @@ sub email {
=head1 VERSION
-$Id: svc_acct.pm,v 1.40 2001-09-16 12:45:35 ivan Exp $
+$Id: svc_acct.pm,v 1.41 2001-09-19 00:24:27 ivan Exp $
=head1 BUGS