diff --git a/gestion/gen_confs/adherents.py b/gestion/gen_confs/adherents.py index 8b88b110..323cdbde 100644 --- a/gestion/gen_confs/adherents.py +++ b/gestion/gen_confs/adherents.py @@ -212,28 +212,3 @@ class mail_ajout_droits: if self.debug: import traceback traceback.print_exc() - - -class ML_ens: - debug = True - - def __init__(self, mails): - self.mails = mails - - def reconfigure(self): - cprint(u'Inscription ML-ENS', 'gras') - mlist = MailList('com-ens') - for mail in self.mails: - anim('\t' + mail) - try: - mlist.ApprovedAddMember(UserDesc(mail)) - except MMAlreadyAMember: - cprint(u"DÉJÀ INSCRIT", "jaune") - except: - print ERREUR - if self.debug: - traceback.print_exc() - else: - print OK - mlist.Save() - mlist.Unlock() diff --git a/gestion/gen_confs/firewall4.py b/gestion/gen_confs/firewall4.py index 398f7360..625ab0a2 100755 --- a/gestion/gen_confs/firewall4.py +++ b/gestion/gen_confs/firewall4.py @@ -509,8 +509,14 @@ class firewall_komaz(firewall_base_routeur): self.blacklist_upload_maj(ips) def raw_table(self): + """Génère les règles pour la table ``raw`` et remplis les chaines de la table""" + table = 'raw' + + chain = 'PREROUTING' + self.add(table, chain, '-d 225.0.0.50 -j DROP') return + def mangle_table(self): table = 'mangle' super(self.__class__, self).mangle_table() @@ -955,7 +961,7 @@ class firewall_komaz(firewall_base_routeur): #Classe des decos upload tc('class add dev %s parent 1:2 classid 1:11 ' - 'htb rate 30kbps ceil 30kbps prio 1' % dev['out']) + 'htb rate 60kbps ceil 60kbps prio 1' % dev['out']) tc('qdisc add dev %s parent 1:11 ' 'handle 11: sfq perturb 10' % dev['out']) diff --git a/gestion/gen_confs/generate.py b/gestion/gen_confs/generate.py index 4b4b2c4d..80170d84 100755 --- a/gestion/gen_confs/generate.py +++ b/gestion/gen_confs/generate.py @@ -182,10 +182,6 @@ class redisdead(base_reconfigure): d.args = args self._do(d) - def ML_ens(self, mails): - from adherents import ML_ens - self._do(ML_ens(mails)) - def mail_ajout_droits(self, args): from adherents import mail_ajout_droits self._do(mail_ajout_droits(args)) diff --git a/gestion/gest_crans.py b/gestion/gest_crans.py index 94c6d2b3..34125689 100755 --- a/gestion/gest_crans.py +++ b/gestion/gest_crans.py @@ -1523,7 +1523,10 @@ def set_machine(machine): except ValueError, c: err += c.args[0] + '\n' except EnvironmentError, c: err += c.args[0] + '\n' else: - err += c.args[0] + '\n' + try: + err += c.args[0] + '\n' + except UnicodeDecodeError: + raise Exception("UnicodeDecodeError on %s" % repr(c.args)) except EnvironmentError, c: err += c.args[0] + '\n' @@ -1626,14 +1629,6 @@ def new_adher(adher): if not confirm(adher): break - arg = u'--title "Inscription Mailing liste de communication ENS" --yesno "\nInscrire l\'adhérent à la mailing liste de communication de l\'ENS ?\n\n\n" 0 0' - no, res = dialog(arg) - if not no: - mail = adher.mail() - if adher._data.get('uid', '') != '' and not mail.endswith('@crans.org'): - mail += '@crans.org' - adher.services_to_restart('ML_ens', [mail]) - def modif_adher(adher): u""" Modification de l'adhérent fourni (instance de adhérent) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 3c380860..9548712b 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -109,7 +109,7 @@ blacklist_items = { u'bloq': u'Bloquage total de tous les services', ### Droits possibles droits_possibles = [u'Multimachines', u'Cableur', u'Imprimeur', u'Apprenti', u'Webmaster', u'Moderateur', u'Webradio', - u'Nounou', u'Tresorier', u'Bureau'] + u'Nounou', u'Tresorier', u'Bureau', u'Troll'] ################################################################################## ### Droits critiques, ie que seules les nounous peuvent attribuer @@ -1431,7 +1431,7 @@ class BaseProprietaire(BaseClasseCrans): self.dn = data[0] if mode == 'w': try: - self.lock(self.idn, self.id()) +# self.lock(self.idn, self.id()) self._modifiable = 'w' except EnvironmentError , c: self._modifiable = 0 diff --git a/gestion/ldap_crans_test.py b/gestion/ldap_crans_test.py deleted file mode 120000 index 6c3b34a0..00000000 --- a/gestion/ldap_crans_test.py +++ /dev/null @@ -1 +0,0 @@ -ldap_crans.py \ No newline at end of file diff --git a/gestion/tools/list_droits.py b/gestion/tools/list_droits.py index f9382a02..b050e3cb 100755 --- a/gestion/tools/list_droits.py +++ b/gestion/tools/list_droits.py @@ -9,7 +9,7 @@ from ldap_crans import crans_ldap, decode db = crans_ldap() txts = [] -for droit in [ u'Nounou', u'Apprenti', u'Moderateur', u'Cableur', u'Webradio' , u'Imprimeur', u'Bureau', u'Tresorier'] : +for droit in [ u'Nounou', u'Apprenti', u'Moderateur', u'Cableur', u'Webradio' , u'Imprimeur', u'Bureau', u'Tresorier', u'Troll'] : adhs = db.search('droits=%s' % droit)['adherent'] noms = [] diff --git a/impression/impression_canon.py b/impression/impression_canon.py index 19037497..a0ee3ac7 100644 --- a/impression/impression_canon.py +++ b/impression/impression_canon.py @@ -379,8 +379,6 @@ class impression: """ self._jid = _uniq_jid() - # imprime le document - self._exec_imprime() # debite l'adhérent si adherent il y a if (self._adh != None): adh = self._adh.split('@') @@ -392,6 +390,8 @@ class impression: adh.solde(-self._prix, "impression(%d): %s par %s" % (self._jid,self._fichier,self._adh)) adh.save() del adh + # imprime le document + self._exec_imprime() def _calcule_prix(self): diff --git a/respbats/crans b/respbats/crans index a770890c..cd3eaf40 100755 --- a/respbats/crans +++ b/respbats/crans @@ -5,6 +5,8 @@ if [ ! -e /usr/scripts/var/encodage_scripts/$UID ]; then touch /usr/scripts/var/encodage_scripts/$UID else # Si le script sort avec une erreur, on purge les locks deads - LANG=fr_FR.UTF-8 sudo -u respbats /usr/scripts/gestion/gest_crans.py "$@" \ - || LANG=fr_FR.UTF-8 sudo -u respbats /usr/scripts/gestion/ldap_crans.py --zombielock + LANG=fr_FR.UTF-8 sudo -u respbats /usr/scripts/gestion/gest_crans.py "$@" + trucmuche=$? + [ $trucmuche -eq 0 ] || LANG=fr_FR.UTF-8 sudo -u respbats /usr/scripts/gestion/ldap_crans.py --zombielock + exit $(($trucmuche + $?)) fi;