From 36e921a06dbd55c6fd9810da8d21df9548b25848 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 24 Feb 2021 12:08:36 +0000 Subject: [PATCH] Check the domain when adding or removing accounts from commandline --- epicyon.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/epicyon.py b/epicyon.py index cf0289c65..5b5d01b8b 100644 --- a/epicyon.py +++ b/epicyon.py @@ -1617,6 +1617,13 @@ if args.addaccount: if not args.domain or not getConfigParam(baseDir, 'domain'): print('Use the --domain option to set the domain name') sys.exit() + + configuredDomain = getConfigParam(baseDir, 'domain') + if configuredDomain: + if domain != configuredDomain: + print('The account domain is expected to be ' + configuredDomain) + sys.exit() + if not validNickname(domain, nickname): print(nickname + ' is a reserved name. Use something different.') sys.exit() @@ -1688,6 +1695,13 @@ if args.rmaccount: if not args.domain or not getConfigParam(baseDir, 'domain'): print('Use the --domain option to set the domain name') sys.exit() + + configuredDomain = getConfigParam(baseDir, 'domain') + if configuredDomain: + if domain != configuredDomain: + print('The account domain is expected to be ' + configuredDomain) + sys.exit() + if args.deactivate: if deactivateAccount(baseDir, nickname, domain): print('Account for ' + nickname + '@' + domain +