X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fbroadband_sqlradius.pm;h=dc117b05c6d179239e5e89b09f8bc64ab09a7978;hb=5df49c99a8c9cb241910b2cf262d19bdbae1f612;hp=ae0876ddf59a4b4365bcf7391aeeb701e5b86ec0;hpb=7aef2e455fe8a4722036f231ee8609ac63b2a9c9;p=freeside.git diff --git a/FS/FS/part_export/broadband_sqlradius.pm b/FS/FS/part_export/broadband_sqlradius.pm index ae0876ddf..dc117b05c 100644 --- a/FS/FS/part_export/broadband_sqlradius.pm +++ b/FS/FS/part_export/broadband_sqlradius.pm @@ -26,6 +26,10 @@ tie %options, 'Tie::IxHash', # type => 'checkbox', # label => 'Hide IP address on session reports', # }, + 'mac_delimiter' => { + label => 'Separate MAC address octets with', + default => '-', + }, 'mac_as_password' => { type => 'checkbox', default => '1', @@ -34,7 +38,11 @@ tie %options, 'Tie::IxHash', 'radius_password' => { label=>'Fixed password' }, 'ip_addr_as' => { label => 'Send IP address as', default => 'Framed-IP-Address' }, -; + 'export_attrs' => { + type => 'checkbox', + label => 'Export RADIUS group attributes to this database', + }, + ; %info = ( 'svc' => 'svc_broadband', @@ -65,7 +73,8 @@ sub rebless { shift; } sub export_username { my($self, $svc_broadband) = (shift, shift); - $svc_broadband->mac_addr; + my $mac_addr = $svc_broadband->mac_addr; + join( ($self->option('mac_delimiter',1) || ''), $mac_addr =~ /../g ); } sub radius_reply { @@ -83,7 +92,9 @@ sub radius_check { my $password_attrib = $conf->config('radius-password') || 'Password'; my %check; if ( $self->option('mac_as_password') ) { - $check{$password_attrib} = $svc_broadband->mac_addr; #formatting? + my $mac_addr = $svc_broadband->mac_addr; + $check{$password_attrib} = + join( ($self->option('mac_delimiter',1) || ''), $mac_addr =~ /../g ); } elsif ( length( $self->option('radius_password',1)) ) { $check{$password_attrib} = $self->option('radius_password');