mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 15:12:25 +00:00
Cas où il n'y a pas d'ipv4 sur machine active, on assigne
This commit is contained in:
parent
c75c204d8d
commit
0ed60c64fd
1 changed files with 11 additions and 3 deletions
|
@ -247,6 +247,9 @@ def check_user_machine_and_register(nas_type, username, mac_address):
|
||||||
return (False, u"Machine enregistrée sur le compte d'un autre user...", '')
|
return (False, u"Machine enregistrée sur le compte d'un autre user...", '')
|
||||||
elif not interface.is_active:
|
elif not interface.is_active:
|
||||||
return (False, u"Machine desactivée", '')
|
return (False, u"Machine desactivée", '')
|
||||||
|
elif not interface.ipv4:
|
||||||
|
interface.assign_ipv4()
|
||||||
|
return (True, u"Ok, Reassignation de l'ipv4", user.pwd_ntlm)
|
||||||
else:
|
else:
|
||||||
return (True, u"Access ok", user.pwd_ntlm)
|
return (True, u"Access ok", user.pwd_ntlm)
|
||||||
elif nas_type:
|
elif nas_type:
|
||||||
|
@ -324,8 +327,13 @@ def decide_vlan_and_register_switch(nas, nas_type, port_number, mac_address):
|
||||||
return (sw_name, u'Access Ok, Capture de la mac...' + extra_log, DECISION_VLAN)
|
return (sw_name, u'Access Ok, Capture de la mac...' + extra_log, DECISION_VLAN)
|
||||||
else:
|
else:
|
||||||
return (sw_name, u'Erreur dans le register mac %s' % reason + unicode(mac_address), VLAN_NOK)
|
return (sw_name, u'Erreur dans le register mac %s' % reason + unicode(mac_address), VLAN_NOK)
|
||||||
elif not interface.first().is_active:
|
else:
|
||||||
|
interface = interface.first()
|
||||||
|
if not interface.is_active:
|
||||||
return (sw_name, u'Machine non active / adherent non cotisant', VLAN_NOK)
|
return (sw_name, u'Machine non active / adherent non cotisant', VLAN_NOK)
|
||||||
|
elif not interface.ipv4:
|
||||||
|
interface.assign_ipv4()
|
||||||
|
return (sw_name, u"Ok, Reassignation de l'ipv4" + extra_log, DECISION_VLAN)
|
||||||
else:
|
else:
|
||||||
return (sw_name, u'Machine OK' + extra_log, DECISION_VLAN)
|
return (sw_name, u'Machine OK' + extra_log, DECISION_VLAN)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue