projects
/
osm
/
NBI.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Bug 2308: Incorrect status update for user update
[osm/NBI.git]
/
osm_nbi
/
authconn_internal.py
diff --git
a/osm_nbi/authconn_internal.py
b/osm_nbi/authconn_internal.py
index
0f414b1
..
8b94a4c
100644
(file)
--- a/
osm_nbi/authconn_internal.py
+++ b/
osm_nbi/authconn_internal.py
@@
-550,6
+550,7
@@
class AuthconnInternal(Authconn):
unlock = user_info.get("unlock")
renew = user_info.get("renew")
permission_id = user_info.get("system_admin_id")
unlock = user_info.get("unlock")
renew = user_info.get("renew")
permission_id = user_info.get("system_admin_id")
+ now = time()
user_data = self.db.get_one(
self.users_collection, {BaseTopic.id_field("users", uid): uid}
user_data = self.db.get_one(
self.users_collection, {BaseTopic.id_field("users", uid): uid}
@@
-591,7
+592,10
@@
class AuthconnInternal(Authconn):
if role_assigned.get("permissions")["admin"]:
if role_assigned.get("permissions")["default"]:
user_data["_admin"]["retry_count"] = 0
if role_assigned.get("permissions")["admin"]:
if role_assigned.get("permissions")["default"]:
user_data["_admin"]["retry_count"] = 0
- user_data["_admin"]["user_status"] = "active"
+ if now > user_data["_admin"]["account_expire_time"]:
+ user_data["_admin"]["user_status"] = "expired"
+ else:
+ user_data["_admin"]["user_status"] = "active"
unlock_state = True
break
if not unlock_state:
unlock_state = True
break
if not unlock_state:
@@
-634,7
+638,13
@@
class AuthconnInternal(Authconn):
)
user_data["_admin"]["modified"] = present
user_data["_admin"]["account_expire_time"] = account_expire
)
user_data["_admin"]["modified"] = present
user_data["_admin"]["account_expire_time"] = account_expire
- user_data["_admin"]["user_status"] = "active"
+ if (
+ user_data["_admin"]["retry_count"]
+ >= self.config["max_pwd_attempt"]
+ ):
+ user_data["_admin"]["user_status"] = "locked"
+ else:
+ user_data["_admin"]["user_status"] = "active"
renew_state = True
break
if not renew_state:
renew_state = True
break
if not renew_state: