diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 0c99cf4a..26b598e9 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -2661,6 +2661,17 @@ class BorneWifi(Machine): mac[-1] = "%0.2x" % (int(mac[-1], 16) + 2) return ":".join(mac) + def hotspot(self, new=None): + """ Cette borne est-elle partagée avec l'ENS ? """ + if new == None: + # Le schéma nous assure que ce champ existe toujours + return self._data['hotspot'][0] == "TRUE" + else: + if new: + self._set('hotspot', ['TRUE']) + else: + self._set('hotspot', ['FALSE']) + def canal(self, new=None, raw=False): """ Attribution ou visualisation du canal d'une borne wifi """ if not new: diff --git a/gestion/whos.py b/gestion/whos.py index faae0534..19d4ad98 100755 --- a/gestion/whos.py +++ b/gestion/whos.py @@ -496,6 +496,11 @@ def machine_details(machine) : # Borne wifi if isinstance(machine, BorneWifi): + f += coul(u'Hotspot : ', 'gras') + if machine.hotspot(): + f += 'oui\n' + else: + f += 'non\n' f += coul(u'Puissance : ','gras') + u"%4.d" % int(machine.puissance()) f += coul(u'\tCanaux : ', 'gras') + machine.canal() f += coul(u'\tÉtat : ', 'gras')