projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix RADIUS attribute capitalization
[freeside.git]
/
bin
/
fs-radius-add-check
diff --git
a/bin/fs-radius-add-check
b/bin/fs-radius-add-check
index
fadba01
..
eedd9b6
100755
(executable)
--- a/
bin/fs-radius-add-check
+++ b/
bin/fs-radius-add-check
@@
-5,8
+5,13
@@
use strict;
use DBI;
use FS::UID qw(adminsuidsetup checkeuid getsecrets);
use strict;
use DBI;
use FS::UID qw(adminsuidsetup checkeuid getsecrets);
+use FS::raddb;
+
die "Not running uid freeside!" unless checkeuid();
die "Not running uid freeside!" unless checkeuid();
+my %attrib2db =
+ map { $FS::raddb::attrib{lc($_)} => $_ } keys %FS::raddb::attrib;
+
my $user = shift or die &usage;
getsecrets($user);
my $user = shift or die &usage;
getsecrets($user);
@@
-18,7
+23,8
@@
print "\n\n", <<END, ":";
Enter the additional RADIUS check attributes you need to track for
each user, separated by whitespace.
END
Enter the additional RADIUS check attributes you need to track for
each user, separated by whitespace.
END
-my @attributes = map { s/\-/_/g; $_; } split(" ",&getvalue);
+my @attributes = map { $attrib2db{lc($_)} or die "unknown attribute $_"; }
+ split(" ",&getvalue);
sub getvalue {
my($x)=scalar(<STDIN>);
sub getvalue {
my($x)=scalar(<STDIN>);