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)