-Res = raw_input("Subscribe to debian-private (space is none) [" + privsub + "]? ");
-if Res != "":
- privsub = Res;
-
-# GID
-Res = raw_input("Group ID Number [" + gidNumber + "]? ");
-if Res != "":
- gidNumber = Group2GID(Res);
+if HavePrivateList and not GuestAccount:
+ Res = raw_input("Subscribe to debian-private (space is none) [" + privsub + "]? ");
+ if Res != "":
+ privsub = Res;
+else:
+ privsub = " "
+
+
+(uidNumber, generatedGID) = GetFreeID(l)
+if not gidNumber:
+ gidNumber = generatedGID
+
+UserGroup = 1
+if NoAutomaticIDs:
+ # UID
+ if not Update:
+ Res = raw_input("User ID Number [%s]? " % (uidNumber));
+ if Res != "":
+ uidNumber = Res;
+
+ # GID
+ Res = raw_input("Group ID Number (new usergroup is %s) [%s]" % (generatedGID, gidNumber));
+ if Res != "":
+ if Res.isdigit():
+ gidNumber = int(Res);
+ else:
+ gidNumber = Group2GID(l, Res);
+
+ if gidNumber != generatedGID:
+ UserGroup = 0
+
+if GuestAccount:
+ supplementaryGid = 'guest'
+else:
+ supplementaryGid = DefaultGroup
+
+shadowExpire = None
+hostacl = []
+if GuestAccount:
+ res = raw_input("Expires in xx days [60] (0 to disable)")
+ if res == "": res = '60'
+ exp = int(res)
+ if exp > 0:
+ shadowExpire = int(time.time() / 3600 / 24) + exp
+ res = raw_input("Hosts to grant access to: ")
+ for h in res.split():
+ if not '.' in h: h = h + '.' + HostDomain
+ if exp > 0: h = h + " " + datetime.datetime.fromtimestamp( time.time() + exp * 24*3600 ).strftime("%Y%m%d")
+ hostacl.append(h)