Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
re2o
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nounous
re2o
Commits
b66dcff8
Commit
b66dcff8
authored
Jun 30, 2018
by
chirac
Committed by
Hugo LEVY-FALK
Aug 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapte freeradius pour le nouveau système de profil de ports
parent
ee79e21e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
freeradius_utils/auth.py
freeradius_utils/auth.py
+9
-6
No files found.
freeradius_utils/auth.py
View file @
b66dcff8
...
...
@@ -359,23 +359,26 @@ def decide_vlan_and_register_switch(nas_machine, nas_type, port_number,
if
not
port
:
return
(
sw_name
,
"Chambre inconnue"
,
u
'Port inconnu'
,
VLAN_OK
)
# On récupère le profil du port
port_profil
=
port
.
get_port_profil
# Si un vlan a été précisé, on l'utilise pour VLAN_OK
if
port
.
vlan_force
:
DECISION_VLAN
=
int
(
port
.
vlan_force
.
vlan_id
)
if
port
_profil
.
vlan_untagged
:
DECISION_VLAN
=
int
(
port
_profil
.
vlan_untagged
.
vlan_id
)
extra_log
=
u
"Force sur vlan "
+
str
(
DECISION_VLAN
)
else
:
DECISION_VLAN
=
VLAN_OK
if
port
.
radius
==
'NO'
:
if
port
_profil
.
radius_type
==
'NO'
:
return
(
sw_name
,
""
,
u
"Pas d'authentification sur ce port"
+
extra_log
,
DECISION_VLAN
)
if
port
.
radius
==
'BLOQ'
:
if
port
_profil
.
radius_type
==
'BLOQ'
:
return
(
sw_name
,
port
.
room
,
u
'Port desactive'
,
VLAN_NOK
)
if
port
.
radius
==
'STRICT'
:
if
port
_profil
.
radius_type
==
'STRICT'
:
room
=
port
.
room
if
not
room
:
return
(
sw_name
,
"Inconnue"
,
u
'Chambre inconnue'
,
VLAN_NOK
)
...
...
@@ -390,7 +393,7 @@ def decide_vlan_and_register_switch(nas_machine, nas_type, port_number,
return
(
sw_name
,
room
,
u
'Chambre resident desactive'
,
VLAN_NOK
)
# else: user OK, on passe à la verif MAC
if
port
.
radius
==
'COMMON'
or
port
.
radius
==
'STRICT'
:
if
port
_profil
.
radius_type
==
'COMMON'
or
port_profil
.
radius_type
==
'STRICT'
:
# Authentification par mac
interface
=
(
Interface
.
objects
.
filter
(
mac_address
=
mac_address
)
...
...
Write
Preview
Markdown
is supported
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