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