Check that account exists

master
Bob Mottram 2019-07-05 10:58:58 +01:00
parent 69975ca092
commit d9d0c886f8
1 changed files with 3 additions and 0 deletions

View File

@ -223,6 +223,9 @@ if args.changepassword:
if len(newPassword)<8: if len(newPassword)<8:
print('Password should be at least 8 characters') print('Password should be at least 8 characters')
sys.exit() sys.exit()
if not os.path.isdir(baseDir+'/accounts/'+nickname+'@'+domain):
print('Account '+nickname+'@'+domain+' not found')
sys.exit()
passwordFile=baseDir+'/accounts/passwords' passwordFile=baseDir+'/accounts/passwords'
if os.path.isfile(passwordFile): if os.path.isfile(passwordFile):
if nickname+':' in open(passwordFile).read(): if nickname+':' in open(passwordFile).read():