mirror of https://gitlab.com/bashrc2/epicyon
Check the domain when adding or removing accounts from commandline
parent
a0a800c980
commit
36e921a06d
14
epicyon.py
14
epicyon.py
|
@ -1617,6 +1617,13 @@ if args.addaccount:
|
||||||
if not args.domain or not getConfigParam(baseDir, 'domain'):
|
if not args.domain or not getConfigParam(baseDir, 'domain'):
|
||||||
print('Use the --domain option to set the domain name')
|
print('Use the --domain option to set the domain name')
|
||||||
sys.exit()
|
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):
|
if not validNickname(domain, nickname):
|
||||||
print(nickname + ' is a reserved name. Use something different.')
|
print(nickname + ' is a reserved name. Use something different.')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
@ -1688,6 +1695,13 @@ if args.rmaccount:
|
||||||
if not args.domain or not getConfigParam(baseDir, 'domain'):
|
if not args.domain or not getConfigParam(baseDir, 'domain'):
|
||||||
print('Use the --domain option to set the domain name')
|
print('Use the --domain option to set the domain name')
|
||||||
sys.exit()
|
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 args.deactivate:
|
||||||
if deactivateAccount(baseDir, nickname, domain):
|
if deactivateAccount(baseDir, nickname, domain):
|
||||||
print('Account for ' + nickname + '@' + domain +
|
print('Account for ' + nickname + '@' + domain +
|
||||||
|
|
Loading…
Reference in New Issue