- my( $self, $new, $old ) = (shift, shift, shift);
-
- #return "can't (yet) change username with sqlradius"
- # if $old->username ne $new->username;
- if ( $old->username ne $new->username ) {
- my $error = $self->sqlradius_queue( $new->svcnum, 'rename',
- $new->username, $old->username );
- return $error if $error;
- }
-
- foreach my $table (qw(reply check)) {
- my $method = "radius_$table";
- my %new = $new->$method;
- my %old = $old->$method;
- if ( grep { !exists $old{$_} #new attributes
- || $new{$n} ne $old{$n} #changed
- } keys %new
- ) {
- my $error = $self->sqlradius_queue( $new->svcnum, 'insert'
- $table, $new->username, %new );
- return $error if $error;
- }
-
- my @del = grep { !exists $new{$_} } keys %old;
- my $error = $self->sqlradius_queue( $new->svcnum, 'sqlradius_attrib_delete',
- $table, $new->username, @del );
- return $error if $error;
- }
-
- '';