From 85d7ec5cab08971dd80447c3cc62e962ba6227d5 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 9 Dec 2015 16:56:15 -0800 Subject: deal when Net::MAC::Vendor-lookup doesn't return an arrayref, RT#39384 --- httemplate/view/elements/svc_Common.html | 4 ++-- httemplate/view/elements/svc_radius_usage.html | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index 771bfb276..207838759 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -283,8 +283,8 @@ my $format_field = sub { } elsif ( $type eq 'checkbox' ) { $value = $value eq 'Y' ? emt('Yes') : emt('No'); } elsif ( $type =~ /(input-)?mac_addr/ and $value =~ /\w/) { - my $vendor = Net::MAC::Vendor::lookup($value)->[0]; - $value .= " ($vendor)" if $vendor; + my $vendor = Net::MAC::Vendor::lookup($value); + $value .= ' ('. $vendor->[0]. ')' if $vendor; $value = $m->scomp('/elements/mac_addr.html', $value); } diff --git a/httemplate/view/elements/svc_radius_usage.html b/httemplate/view/elements/svc_radius_usage.html index 08d6d53d3..5a958ee76 100644 --- a/httemplate/view/elements/svc_radius_usage.html +++ b/httemplate/view/elements/svc_radius_usage.html @@ -27,8 +27,11 @@ % ) / 1048576; % % my $last_mac = $svc->attribute_last_sqlradacct( 'CallingStationId' ); -% if ( $last_mac =~ /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i ) { -% $last_mac .= ' ('. (Net::MAC::Vendor::lookup($1))->[0]. ')'; +% if ( $last_mac =~ /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i +% && my $vendor = Net::MAC::Vendor::lookup($1) +% ) +% { +% $last_mac .= ' ('. $vendor->[0]. ')'; % } -- cgit v1.2.1 From 311a694bf1cb816a48efca116e260d940c5a646f Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 9 Dec 2015 22:20:38 -0800 Subject: mask more of the card in new installs by default --- conf/card_masking_method | 1 + 1 file changed, 1 insertion(+) create mode 100644 conf/card_masking_method diff --git a/conf/card_masking_method b/conf/card_masking_method new file mode 100644 index 000000000..7f6ed5c40 --- /dev/null +++ b/conf/card_masking_method @@ -0,0 +1 @@ +first4last2 -- cgit v1.2.1