Allow to map usernames

This commit is contained in:
Michal Čihař 2020-08-18 13:22:21 +02:00
parent a6845330bc
commit 056b5009ac

View file

@ -34,7 +34,8 @@ TEMPLATE = """{
"rt_user": "",
"rt_pass": "",
"rt_start": 1,
"rt_end": 1000
"rt_end": 1000,
"usermap": {}
}
"""
@ -155,6 +156,8 @@ for user in target.user.all():
def get_user(userdata, attr="login"):
email = userdata["EmailAddress"]
lemail = email.lower()
if lemail in config["usermap"]:
email = lemail = config["usermap"][lemail]
# Search existing users
if lemail not in USERMAP:
for user in target.user.search({"query": email}):