Module: check_mk
Branch: master
Commit: a502ab9cb2a725edb42202940dc511be8b10d8a4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a502ab9cb2a725…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Dec 20 15:08:28 2013 +0100
FIX Users are not logged out anymore during changing their own passwords
The login cookie is now automatically updated with the new valid value.
---
.werks/423 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 12 +++++-------
3 files changed, 16 insertions(+), 7 deletions(-)
diff --git a/.werks/423 b/.werks/423
new file mode 100644
index 0000000..ecb7a53
--- /dev/null
+++ b/.werks/423
@@ -0,0 +1,10 @@
+Title: Users are not logged out anymore during changing their own passwords
+Level: 1
+Component: multisite
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387548439
+Targetversion: future
+
+The login cookie is now automatically updated with the new valid value.
diff --git a/ChangeLog b/ChangeLog
index 288b58e..5eb042e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -96,6 +96,7 @@
* 0436 FIX: Fix broken Site status switching via sidebar snapin...
* 0420 FIX: LDAP: Roles/Groups are now synced even if case of DNs do not match...
* 0421 FIX: UserDB: Fixed lost passwords when changing users in large user
databases...
+ * 0423 FIX: Users are not logged out anymore during changing their own passwords...
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 9cdcc1e..afa3a2a 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -105,7 +105,7 @@
import sys, pprint, socket, re, subprocess, time, datetime, \
shutil, tarfile, StringIO, math, fcntl, pickle, random
-import config, table, multitar, userdb, hooks, weblib
+import config, table, multitar, userdb, hooks, weblib, login
from lib import *
from valuespec import *
import forms
@@ -12689,15 +12689,13 @@ def page_user_profile():
else:
users[config.user_id]['serial'] += 1
+ # Set the new cookie to prevent logout for the current user
+ login.set_auth_cookie(config.user_id,
users[config.user_id]['serial'])
+
userdb.save_users(users)
success = True
- if password:
- html.javascript(
- "if(top) top.location.reload(); "
- "else document.location.reload();")
- else:
- html.reload_sidebar()
+ html.reload_sidebar()
except MKUserError, e:
html.add_user_error(e.varname, e.message)