From da71e80be1853aa62100bdcd3c4d78e77b6cf776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre-Elliott=20B=C3=A9cue?= Date: Wed, 18 Feb 2015 20:43:10 +0100 Subject: [PATCH] =?UTF-8?q?Correctifs=20sur=20le=20pr=C3=A9c=C3=A9dent=20c?= =?UTF-8?q?ommit,=20et=20prise=20en=20compte=20dans=20mkhome.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gestion/gen_confs/adherents.py | 2 +- gestion/gest_crans.py | 4 +++- gestion/tools/mkhome.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gestion/gen_confs/adherents.py b/gestion/gen_confs/adherents.py index 0f63758d..339489f9 100644 --- a/gestion/gen_confs/adherents.py +++ b/gestion/gen_confs/adherents.py @@ -117,7 +117,7 @@ class home: try: login, oldLogin, oldHome = args.split(",") if login: - adh = CONN.search("uid=%s" % (uid,))['adherent'][0] + adh = CONN.search("login=%s" % (login,))['adherent'][0] home = adh.home() uid = adh.uidNumber() mail_redirect = adh.email_exterieur() diff --git a/gestion/gest_crans.py b/gestion/gest_crans.py index 5fc476ff..a3c3b2b9 100755 --- a/gestion/gest_crans.py +++ b/gestion/gest_crans.py @@ -457,6 +457,8 @@ def set_mail_ext(adher): if not adher.compte(): return 0 + cur = adher.email_exterieur() + if u'Nounou' in adher.droits() and not isadm: arg = u'--title "Adresse mail extérieure de %s" ' % adher.Nom() arg += u'--msgbox "Vous n\'avez pas les droits necessaires pour effectuer cette opération.\n\n\n" 0 0' @@ -477,7 +479,7 @@ def set_mail_ext(adher): return 0 arg = u'--title "Adresse mail extérieure pour %s" ' % adher.Nom() - arg += u'--inputbox "Adresse : " 0 0 "%s"' % default + arg += u'--inputbox "Adresse : " 0 0 "%s"' % (cur,) annul, result = dialog(arg) if annul: return 1 diff --git a/gestion/tools/mkhome.py b/gestion/tools/mkhome.py index a348ff38..fbcdd030 100755 --- a/gestion/tools/mkhome.py +++ b/gestion/tools/mkhome.py @@ -23,8 +23,8 @@ conn=lc_ldap.shortcuts.lc_ldap_readonly() l=[] for user in sys.argv[1:]: a=conn.search(u'uid=%s' % user) - if a and a[0]['homeDirectory'] and a[0]['uidNumber'] and a[0]['uid']: - l.append("%s,%s,%s" % (a[0]['homeDirectory'][0], a[0]['uidNumber'][0], a[0]['uid'][0])) + if a and a[0]['homeDirectory'] and a[0]['uidNumber'] and a[0]['uid']: + l.append("%s,," % (a[0]['uid'][0],)) if l: h=gestion.gen_confs.adherents.home(l)