diff --git a/gestion/gest_crans.py b/gestion/gest_crans.py index f69be922..80713788 100644 --- a/gestion/gest_crans.py +++ b/gestion/gest_crans.py @@ -2210,6 +2210,15 @@ def menu_principal(): try: if choix == 'Fixe': becane = MachineFixe(proprio) + #Saisie prédictive de la mac + try: + prise = proprio.chbre().lower()[0] + becane.prise() + f = open('/usr/scripts/var/last_macs/' + prise, 'r') + becane.mac(f.read()) + f.close() + except: + pass + elif choix == 'Wifi': becane = MachineWifi(proprio) except ValueError, c: diff --git a/radius_auth.py b/radius_auth.py index fcab0fb8..7554f4ea 100644 --- a/radius_auth.py +++ b/radius_auth.py @@ -104,4 +104,12 @@ if __name__ == '__main__' : "Tunnel-Medium-Type = IEEE-802", "Tunnel-Private-Group-Id = \"%d\"" % vlans[vlan]]) + # On tente de logguer la dernière mac sur une prise donnée + try: + f = open('/usr/scripts/var/last_macs/' + prise,'w') + f.write(mac) + f.close() + except: + pass + sys.exit(r)