Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nigel Kukard
smradius
Commits
85814f63
Commit
85814f63
authored
Sep 10, 2016
by
Nigel Kukard
Browse files
Fixed new CLASS to CLASS->new
parent
57bded4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
smradius/modules/system/mod_config_sql.pm
View file @
85814f63
# SQL config database support
# SQL config database support
# Copyright (C) 2007-201
1
, AllWorldIT
# Copyright (C) 2007-201
6
, AllWorldIT
#
#
# This program is free software; you can redistribute it and/or modify
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
...
@@ -199,7 +199,7 @@ sub getConfig
...
@@ -199,7 +199,7 @@ sub getConfig
# Extract realm from username
# Extract realm from username
if
(
defined
(
$user
->
{'
Username
'})
&&
$user
->
{'
Username
'}
=~
/^\S+@(\S+)$/
)
{
if
(
defined
(
$user
->
{'
Username
'})
&&
$user
->
{'
Username
'}
=~
/^\S+@(\S+)$/
)
{
$realmName
=
$
1
;
$realmName
=
$
1
;
$server
->
log
(
LOG_DEBUG
,"
Processing realm attributes for '
$realmName
'
");
$server
->
log
(
LOG_DEBUG
,"
Processing realm attributes for '
$realmName
'
");
$sth
=
DBSelect
(
$config
->
{'
get_config_realm_id_query
'},
$realmName
);
$sth
=
DBSelect
(
$config
->
{'
get_config_realm_id_query
'},
$realmName
);
...
@@ -264,7 +264,6 @@ sub getConfig
...
@@ -264,7 +264,6 @@ sub getConfig
# Grab peer address object
# Grab peer address object
my
$peerAddrObj
=
AWITPT::
NetIP
->
new
(
$server
->
{'
server
'}{'
peeraddr
'});
my
$peerAddrObj
=
AWITPT::
NetIP
->
new
(
$server
->
{'
server
'}{'
peeraddr
'});
# Check if we know this client
# Check if we know this client
my
@accessList
;
my
@accessList
;
while
(
my
$row
=
$sth
->
fetchrow_hashref
())
{
while
(
my
$row
=
$sth
->
fetchrow_hashref
())
{
...
@@ -274,9 +273,9 @@ sub getConfig
...
@@ -274,9 +273,9 @@ sub getConfig
@accessList
=
split
('
,
',
$res
->
{'
AccessList
'});
@accessList
=
split
('
,
',
$res
->
{'
AccessList
'});
# Loop with what we get and check if we have match
# Loop with what we get and check if we have match
foreach
my
$range
(
@accessList
)
{
foreach
my
$range
(
@accessList
)
{
my
$rangeObj
=
new
AWITPT::
NetIP
->
new
(
$range
);
my
$rangeObj
=
AWITPT::
NetIP
->
new
(
$range
);
# Check for match
# Check for match
if
(
$peerAddrObj
->
is_within
(
$rangeObj
))
{
if
(
$peerAddrObj
->
is_within
(
$rangeObj
))
{
$clientID
=
$res
->
{'
ID
'};
$clientID
=
$res
->
{'
ID
'};
$server
->
log
(
LOG_INFO
,"
(SETCACHE) Got client ID '
$clientID
' from DB
");
$server
->
log
(
LOG_INFO
,"
(SETCACHE) Got client ID '
$clientID
' from DB
");
last
;
last
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment