lastlogin attribute

This commit is contained in:
aitzol 2023-11-29 23:30:29 +01:00
parent 48be235fde
commit 253c5c2491

5
app.py
View File

@ -1034,7 +1034,10 @@ def get_user_data(user_dn, conn):
#ts = conn.entries[0].lastLogin.values[0] #ts = conn.entries[0].lastLogin.values[0]
#ts = datetime.strptime(ts, '%Y-%m-%d %H:%M:%S%z') #ts = datetime.strptime(ts, '%Y-%m-%d %H:%M:%S%z')
#ts = datetime.strftime(t, '%Y-%m-%d %H:%M:%S') #ts = datetime.strftime(t, '%Y-%m-%d %H:%M:%S')
data.append(str(conn.entries[0].lastLogin.values[0])[:-6]) if(conn.entries[0].lastLogin):
data.append(str(conn.entries[0].lastLogin.values[0])[:-6])
else:
data.append(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))
data.append(conn.entries[0].secureAuth.values[0]) data.append(conn.entries[0].secureAuth.values[0])
if(conn.entries[0].authCode): if(conn.entries[0].authCode):
data.append(conn.entries[0].authCode.values[0]) data.append(conn.entries[0].authCode.values[0])