projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
35b2337
)
fix bug where user could log in to RADIUS with uppercase usernameand avoid bandwidth...
author
ivan
<ivan>
Thu, 23 Aug 2007 08:23:29 +0000
(08:23 +0000)
committer
ivan
<ivan>
Thu, 23 Aug 2007 08:23:29 +0000
(08:23 +0000)
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/part_export/sqlradius.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
e1fa051
..
0d37fea
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-1099,7
+1099,7
@@
httemplate/docs/config.html
{
'key' => 'username-uppercase',
'section' => 'username',
{
'key' => 'username-uppercase',
'section' => 'username',
- 'description' => 'Allow uppercase characters in usernames',
+ 'description' => 'Allow uppercase characters in usernames
. Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.
',
'type' => 'checkbox',
},
'type' => 'checkbox',
},
diff --git
a/FS/FS/part_export/sqlradius.pm
b/FS/FS/part_export/sqlradius.pm
index
2615a16
..
fec4949
100644
(file)
--- a/
FS/FS/part_export/sqlradius.pm
+++ b/
FS/FS/part_export/sqlradius.pm
@@
-626,6
+626,8
@@
sub usage_sessions {
sub update_svc_acct {
my $self = shift;
sub update_svc_acct {
my $self = shift;
+ my $conf = new FS::Conf;
+
my $dbh = sqlradius_connect( map $self->option($_),
qw( datasrc username password ) );
my $dbh = sqlradius_connect( map $self->option($_),
qw( datasrc username password ) );
@@
-650,7
+652,10
@@
sub update_svc_acct {
"$RadAcctId ($UserName\@$Realm for ${AcctSessionTime}s"
if $DEBUG;
"$RadAcctId ($UserName\@$Realm for ${AcctSessionTime}s"
if $DEBUG;
+ $UserName = lc($UserName) unless $conf->exists('username-uppercase');
+
my %search = ( 'username' => $UserName );
my %search = ( 'username' => $UserName );
+
my $extra_sql = '';
if ( ref($self) =~ /withdomain/ ) { #well...
$extra_sql = " AND '$Realm' = ( SELECT domain FROM svc_domain
my $extra_sql = '';
if ( ref($self) =~ /withdomain/ ) { #well...
$extra_sql = " AND '$Realm' = ( SELECT domain FROM svc_domain