projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c5e3161
)
delimited MAC addresses, #15478
author
mark
<mark>
Wed, 7 Dec 2011 21:35:13 +0000
(21:35 +0000)
committer
mark
<mark>
Wed, 7 Dec 2011 21:35:13 +0000
(21:35 +0000)
FS/FS/part_export/broadband_sqlradius.pm
patch
|
blob
|
history
FS/FS/svc_broadband.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_export/broadband_sqlradius.pm
b/FS/FS/part_export/broadband_sqlradius.pm
index
9b6fbec
..
dc117b0
100644
(file)
--- 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',
# },
# 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',
'mac_as_password' => {
type => 'checkbox',
default => '1',
@@
-69,7
+73,8
@@
sub rebless { shift; }
sub export_username {
my($self, $svc_broadband) = (shift, 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 {
}
sub radius_reply {
@@
-87,7
+92,9
@@
sub radius_check {
my $password_attrib = $conf->config('radius-password') || 'Password';
my %check;
if ( $self->option('mac_as_password') ) {
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');
}
elsif ( length( $self->option('radius_password',1)) ) {
$check{$password_attrib} = $self->option('radius_password');
diff --git
a/FS/FS/svc_broadband.pm
b/FS/FS/svc_broadband.pm
index
5469a66
..
2ac24e5
100755
(executable)
--- a/
FS/FS/svc_broadband.pm
+++ b/
FS/FS/svc_broadband.pm
@@
-347,6
+347,11
@@
sub check {
my $lat_lower = $nw_coords ? 1 : -90;
my $lon_upper = $nw_coords ? -1 : 180;
my $lat_lower = $nw_coords ? 1 : -90;
my $lon_upper = $nw_coords ? -1 : 180;
+ # remove delimiters
+ my $mac_addr = uc($self->get('mac_addr'));
+ $mac_addr =~ s/[-: ]//g;
+ $self->set('mac_addr', $mac_addr);
+
my $error =
$self->ut_numbern('svcnum')
|| $self->ut_numbern('blocknum')
my $error =
$self->ut_numbern('svcnum')
|| $self->ut_numbern('blocknum')