[freeside-commits] freeside/FS/FS/part_export broadband_sqlradius.pm, 1.1.2.3, 1.1.2.4
Mark Wells
mark at wavetail.420.am
Wed Dec 7 13:35:15 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv2316/FS/FS/part_export
Modified Files:
Tag: FREESIDE_2_3_BRANCH
broadband_sqlradius.pm
Log Message:
delimited MAC addresses, #15478
Index: broadband_sqlradius.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/broadband_sqlradius.pm,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -w -d -r1.1.2.3 -r1.1.2.4
--- broadband_sqlradius.pm 23 Nov 2011 18:40:06 -0000 1.1.2.3
+++ broadband_sqlradius.pm 7 Dec 2011 21:35:13 -0000 1.1.2.4
@@ -26,6 +26,10 @@
# 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',
@@ -69,7 +73,8 @@
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 {
@@ -87,7 +92,9 @@
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');
More information about the freeside-commits
mailing list