Module: check_mk
Branch: master
Commit: f82e4d39e1bdac05bf1e085615910e7000038072
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f82e4d39e1bdac…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 1 13:56:49 2014 +0200
FIX Fixed problem where user access times were not updated correctly
---
.werks/826 | 8 ++++++++
ChangeLog | 1 +
web/htdocs/sidebar.py | 2 +-
web/htdocs/userdb.py | 6 +++---
4 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/.werks/826 b/.werks/826
new file mode 100644
index 0000000..3745a00
--- /dev/null
+++ b/.werks/826
@@ -0,0 +1,8 @@
+Title: Fixed problem where user access times were not updated correctly
+Level: 1
+Component: wato
+Version: 1.2.5i5
+Date: 1404215789
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 32a3365..d4e628c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@
* 0990 FIX: Fix HTTP error handling in bulk inventory...
* 1004 FIX: Fix exception when saving rules, caused by empty item
* 0947 FIX: WATO snapshots: fixed missing files on restoring nagvis backup domains
+ * 0826 FIX: Fixed problem where user access times were not updated correctly
Reporting & Availability:
* 0991 FIX: Availability: optionally show time stamps as UNIX epoch time...
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 72480fc..13786b4 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -346,7 +346,7 @@ def ajax_openclose():
def ajax_snapin():
# Update online state of the user (if enabled)
- userdb.update_user_access_time()
+ userdb.update_user_access_time(config.user_id)
snapname = html.var("name")
if snapname:
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index 0a911cb..7fbecee 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -127,17 +127,17 @@ def user_locked(username):
users = load_users()
return users[username].get('locked', False)
-def update_user_access_time():
+def update_user_access_time(username):
if not config.save_user_access_times:
return
- save_custom_attr(html.user, 'last_seen', repr(time.time()))
+ save_custom_attr(username, 'last_seen', repr(time.time()))
def on_succeeded_login(username):
num_failed = load_custom_attr(username, 'num_failed', saveint)
if num_failed != None and num_failed != 0:
save_custom_attr(username, 'num_failed', '0')
- update_user_access_time()
+ update_user_access_time(username)
def on_failed_login(username):
users = load_users(lock = True)