Module: check_mk
Branch: master
Commit: 6224e8a5f4d502446163c8ab86ed0854fed696ca
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6224e8a5f4d502…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu May 30 09:56:30 2013 +0200
Fixed exception when logging in as unknown user
---
ChangeLog | 1 +
web/htdocs/userdb.py | 17 +++++++++--------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9a6dc55..147c735 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@
* lnx_if: Fixed crash on missing "Address" field
* viprinet_router: Now able to set required target state via rule
* windows_agent: Now available as 64 bit version
+
Notifications:
* Flexible Notification can now filter service levels
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index 2c4f043..5063b53 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -126,16 +126,17 @@ def on_succeeded_login(username):
def on_failed_login(username):
users = load_users()
- if "num_failed" in users[username]:
- users[username]["num_failed"] += 1
- else:
- users[username]["num_failed"] = 1
+ if username in users:
+ if "num_failed" in users[username]:
+ users[username]["num_failed"] += 1
+ else:
+ users[username]["num_failed"] = 1
- if config.lock_on_logon_failures:
- if users[username]["num_failed"] >= config.lock_on_logon_failures:
- users[username]["locked"] = True
+ if config.lock_on_logon_failures:
+ if users[username]["num_failed"] >=
config.lock_on_logon_failures:
+ users[username]["locked"] = True
- save_users(users)
+ save_users(users)
root_dir = defaults.check_mk_configdir + "/wato/"
multisite_dir = defaults.default_config_dir + "/multisite.d/wato/"