This commit is contained in:
Aitzol 2023-11-16 13:21:09 +01:00
parent a16cb64606
commit 7553c6a443

5
app.py
View File

@ -676,7 +676,7 @@ def update_email_address(conf, username, old_email, new_email):
c.modify(user_dn, {'mail': [( MODIFY_REPLACE, new_email_addresses )]}) c.modify(user_dn, {'mail': [( MODIFY_REPLACE, new_email_addresses )]})
newSession().set(get_user_data(user_dn, c)) newSession().set(get_user_data(user_dn, c))
# ADD SECUREAUTH ATTRIBUTE - 2FA # ADD AUTHCODE ATTRIBUTE - 2FA
def add_auth_attribute_step1(username, code): def add_auth_attribute_step1(username, code):
changed = [] changed = []
@ -724,8 +724,7 @@ def add_auth_attribute_step3(conf, username, code):
with connect_ldap(conf, user=superUser.admin_dn, password=superUser.admin_pwd) as c: with connect_ldap(conf, user=superUser.admin_dn, password=superUser.admin_pwd) as c:
user_dn = find_user_dn(conf, c, username) user_dn = find_user_dn(conf, c, username)
'''OBJECT_CLASS = ['top', 'inetOrgPerson', 'posixAccount', 'accountsManagement']''' OBJECT_CLASS = ['top', 'inetOrgPerson', 'posixAccount', 'accountsManagement']
OBJECT_CLASS = ['accountsManagement']
c.add(dn=user_dn,object_class=OBJECT_CLASS, attributes={'authCode': code}) c.add(dn=user_dn,object_class=OBJECT_CLASS, attributes={'authCode': code})
newSession().set(get_user_data(user_dn, c)) newSession().set(get_user_data(user_dn, c))