From: Peter Palfrader Date: Fri, 8 Jan 2010 23:27:37 +0000 (+0100) Subject: ud-useradd: Only ask for private subscription if this installation has a debian-priva... X-Git-Tag: userdir-ldap-0.3.76~11 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=5e4961c91009a15736f426c918c8d9dc8013cde2 ud-useradd: Only ask for private subscription if this installation has a debian-private like mailinglist whose membership is configured by ud-ldap. (defaults to true.) --- diff --git a/debian/changelog b/debian/changelog index 92fadd2..b111ef7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,11 @@ userdir-ldap (0.3.76xXx) unstable; urgency=low * ud-useradd: Fix usergroup support: - Move ldap call to actually add the user to the right place, - Properly compare strings and numbers. + * ud-useradd: Only ask for private subscription if this installation + has a debian-private like mailinglist whose membership is configured + by ud-ldap. (defaults to true.) - -- Peter Palfrader Sat, 09 Jan 2010 00:19:44 +0100 + -- Peter Palfrader Sat, 09 Jan 2010 00:27:02 +0100 userdir-ldap (0.3.75) unstable; urgency=low diff --git a/ud-useradd b/ud-useradd index 52689b3..243443f 100755 --- a/ud-useradd +++ b/ud-useradd @@ -25,6 +25,8 @@ import email.Header from userdir_ldap import *; from userdir_gpg import *; +HavePrivateList = getattr(ConfModule, "haveprivatelist", True) + # This tries to search for a free UID. There are two possible ways to do # this, one is to fetch all the entires and pick the highest, the other # is to randomly guess uids until one is free. This uses the former. @@ -167,9 +169,12 @@ if Res != "": emailaddr = Res; # Debian-Private subscription -Res = raw_input("Subscribe to debian-private (space is none) [" + privsub + "]? "); -if Res != "": - privsub = Res; +if HavePrivateList: + Res = raw_input("Subscribe to debian-private (space is none) [" + privsub + "]? "); + if Res != "": + privsub = Res; +else: + privsub = " " (uidNumber, generatedGID) = GetFreeID(l) if not gidNumber: @@ -226,7 +231,8 @@ print "Final information collected:" print " %s <%s@%s>:" % (FullName,account,EmailAppend); print " Assigned UID:",uidNumber," GID:", gidNumber; print " Email forwarded to:",emailaddr -print " Private Subscription:",privsub; +if HavePrivateList: + print " Private Subscription:",privsub; print " GECOS Field: \"%s,,,,\"" % (FullName); print " Login Shell: /bin/bash"; print " Key Fingerprint:",Keys[0][1]; diff --git a/userdir-ldap.conf b/userdir-ldap.conf index cb4a5cb..78a2fee 100644 --- a/userdir-ldap.conf +++ b/userdir-ldap.conf @@ -30,6 +30,9 @@ replaycachefile = "/var/cache/userdir-ldap/mail/replay"; #replaycachefile = "/tmp/replay"; fingerprintfile = "/etc/userdir-ldap/badfingerprints" +# do we have a debian-private like list that we should ask about in ud-useradd +haveprivatelist = True; + # Echelon ech_errorlog = "/org/db.debian.org/mail/Log/ech-errors.log" ech_mainlog = "/org/db.debian.org/mail/Log/ech.log"