1
0
Fork 0

- non destructive default behaviour

git-svn-id: file:///home/www/usr01/svn/gnuviechadmin/gnuviech.info/gnuviechadmin/trunk@151 a67ec6bc-e5d5-0310-a910-815c51eb3124
This commit is contained in:
Jan Dittberner 2006-01-31 09:04:53 +00:00
parent da5aa67ac9
commit 61569aa807

View file

@ -83,9 +83,12 @@ class Domain:
result = cr.fetchall()
if (not result):
return sysuser + "p01"
return sysuser + "p1"
maxpopuser = result[0][0]
if (not maxpopuser):
return sysuser + "p1"
num = int(maxpopuser[len(sysuser)+1:])+1
return "%sp%d" % (sysuser, num)
@ -161,10 +164,12 @@ Password: %(password)s""" % {'domain': self.domain,
raise InvalidPopUser(self, username)
if __name__ == '__main__':
domain = Domain('efs-sohland.de')
domain = Domain('centrum-warenhaus-dresden.de')
# list pop users
print ", ".join(domain.listPopUsers())
# check for not existing user
try:
domain.updatePopPassword('usr03p2', 'test')
except InvalidPopUser, ipu:
print ipu
domain.updatePopPassword('usr05p2')
#try:
# domain.updatePopPassword('usr03p2', 'test')
#except InvalidPopUser, ipu:
# print ipu
#domain.updatePopPassword('usr05p2')