From 95d711e690fe94a0a75d89aa2583510e331e4041 Mon Sep 17 00:00:00 2001 From: Daniel STAN Date: Sun, 8 Jul 2012 02:21:27 +0200 Subject: [PATCH] =?UTF-8?q?[gest=5Fcrans]=20petit=20bonus=20d'aide=20?= =?UTF-8?q?=C3=A0=20la=20saisie=20d'une=20mac=20fixe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ignore-this: 90bf93bf17aa83f1cd84b81dbc47f54 darcs-hash:20120708002127-28565-1d1c70264948c9cf538982e8a1029eeda8997ad4.gz --- gestion/gest_crans.py | 9 +++++++++ radius_auth.py | 8 ++++++++ 2 files changed, 17 insertions(+) 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)