X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fbroadband_sqlradius.pm;h=2d6681e74a1736687126370815546c6da633468d;hp=5806362b52c559780bd2a540207417c19b92a2d1;hb=87c195131764ee7307e834bfb5b36b9e6ba14d07;hpb=cc6bedada3c99e3e9ca4748546f3b4ab847c3cba diff --git a/FS/FS/part_export/broadband_sqlradius.pm b/FS/FS/part_export/broadband_sqlradius.pm index 5806362b5..2d6681e74 100644 --- a/FS/FS/part_export/broadband_sqlradius.pm +++ b/FS/FS/part_export/broadband_sqlradius.pm @@ -6,15 +6,20 @@ use Tie::IxHash; use FS::Conf; use FS::Record qw( dbh str2time_sql ); #qsearch qsearchs ); use FS::part_export::sqlradius qw(sqlradius_connect); +use FS::Password_Mixin; +use NEXT; -FS::UID->install_callback(sub { $conf = new FS::Conf }); +FS::UID->install_callback( + sub { + $conf = new FS::Conf; + @pw_set = FS::Password_Mixin->pw_set; + } +); @ISA = qw(FS::part_export::sqlradius); $DEBUG = 0; -@pw_set = ( 'a'..'z', 'A'..'Z', '0'..'9', '(', ')', '#', '.', ',' ); - tie %options, 'Tie::IxHash', 'datasrc' => { label=>'DBI data source ' }, 'username' => { label=>'Database username' }, @@ -55,6 +60,7 @@ tie %options, 'Tie::IxHash', 'svc' => 'svc_broadband', 'desc' => 'Real-time export to SQL-backed RADIUS (such as FreeRadius) for broadband services', 'options' => \%options, + 'no_machine' => 1, 'nas' => 'Y', 'notes' => <radcheck, radreply, and usergroup @@ -87,7 +93,9 @@ sub export_username { sub radius_reply { my($self, $svc_broadband) = (shift, shift); - my %reply; + # start with attributes the service wants + my %reply = $self->NEXT::radius_reply($svc_broadband); + # add export-specific stuff if ( length($self->option('ip_addr_as',1)) and length($svc_broadband->ip_addr) ) { $reply{$self->option('ip_addr_as')} = $svc_broadband->ip_addr; @@ -97,8 +105,9 @@ sub radius_reply { sub radius_check { my($self, $svc_broadband) = (shift, shift); + + my %check = $self->SUPER::radius_check($svc_broadband); my $password_attrib = $conf->config('radius-password') || 'Password'; - my %check; if ( $self->option('mac_as_password') ) { $check{$password_attrib} = $self->export_username($svc_broadband); } @@ -124,6 +133,8 @@ sub radius_check_suspended { sub _export_suspend { my( $self, $svc_broadband ) = (shift, shift); + return '' if $self->option('skip_provisioning'); + local $SIG{HUP} = 'IGNORE'; local $SIG{INT} = 'IGNORE'; local $SIG{QUIT} = 'IGNORE';