Espaces, commentaire obsolte.

darcs-hash:20060326124146-68412-fecc95b516e9679ecedfe340f889ade92ba8979e.gz
This commit is contained in:
glondu 2006-03-26 14:41:46 +02:00
parent d8b2c5b48d
commit c2fe8df391

View file

@ -60,13 +60,13 @@ else:
##################################################################################
### Items de la blackliste
blacklist_items = { u'bloq' : u'Bloquage total de tous les services',
u'virus' : u'Bloquage sur squid',
u'upload' : u"Bloquage total de l'accès à l'extérieur",
u'warez' : u'Bloquage sur squid',
u'p2p' : u"Bloquage total de l'accès à l'extérieur",
u'autodisc_upload' : u'Autodisconnect pour upload',
u'autodisc_p2p' : u'Autodisconnect pour P2P' }
blacklist_items = { u'bloq': u'Bloquage total de tous les services',
u'virus': u'Bloquage sur squid',
u'upload': u"Bloquage total de l'accès à l'extérieur",
u'warez': u'Bloquage sur squid',
u'p2p': u"Bloquage total de l'accès à l'extérieur",
u'autodisc_upload': u'Autodisconnect pour upload',
u'autodisc_p2p': u'Autodisconnect pour P2P' }
##################################################################################
### Droits possibles
@ -304,13 +304,13 @@ class crans_ldap:
def connect(self, readonly=False):
""" Initialisation la connexion vers le serveur LDAP """
if readonly :
if readonly:
self.conn = ldap.initialize(ro_uri)
return
self.conn = ldap.initialize(uri)
nbessais = 0
while True :
while True:
try:
self.conn.bind_s(ldap_auth_dn, ldap_password, ldap.AUTH_SIMPLE)
break
@ -670,9 +670,9 @@ class crans_ldap:
# si c'est un champ uniquement adherent (genre droit), on ignore les clubs et vice versa
if champ in self.search_champs['club'] and champ not in self.search_champs['adherent']:
if 'adherent' not in ignore_filtre : ignore_filtre.append('adherent')
if 'adherent' not in ignore_filtre: ignore_filtre.append('adherent')
if champ in self.search_champs['adherent'] and champ not in self.search_champs['club']:
if 'club' not in ignore_filtre : ignore_filtre.append('club')
if 'club' not in ignore_filtre: ignore_filtre.append('club')
# Construction du filtre
for i in filtres:
@ -942,7 +942,6 @@ class base_classes_crans(crans_ldap):
liste.append(new_c)
if liste != self._data['blacklist']:
# La ligne suivante est inutile, elle est laissée dans un souci de clarté
self._data['blacklist'] = liste
self.modifs.setdefault('blacklist_' + new[2], None)
if not hasattr(self, "_blacklist_restart"):
@ -1236,7 +1235,7 @@ class base_proprietaire(base_classes_crans):
if new == None:
try: return decode(self._data.get('loginShell', [''])[0])
except: return ''
else :
else:
new = preattr(new)[1]
self._set('loginShell', [new])
return new
@ -1943,7 +1942,7 @@ class Adherent(base_proprietaire):
if new == None:
try: return decode(self._data['canonicalAlias'][0])
except: return ''
else :
else:
a = strip_accents(new)
a = preattr(a)[1]
@ -2552,7 +2551,7 @@ class Machine(base_classes_crans):
# Reconfiguration firewalls et dhcps
if reconf_ip:
self.services_to_restart('macip', reconf_ip)
if self.__typ == 'wifi' :
if self.__typ == 'wifi':
self.services_to_restart('ragnarok-dhcp')
else:
self.services_to_restart('rouge-dhcp')
@ -2611,7 +2610,7 @@ class Machine(base_classes_crans):
self._delete(self.dn, comment)
# Services à redémarrer
if self.__typ == 'wifi' :
if self.__typ == 'wifi':
self.services_to_restart('conf_wifi_ng')
self.services_to_restart('ragnarok-dhcp')
else: