From 05cf7c53a69b7c999ac68c2869db924e2dccc3a0 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 28 Jun 2012 14:42:29 +0200 Subject: [PATCH] Display loginas information only after login Message 'Logged in as: user@FREEIPA.ORG' was displayed before user was logged in. It was wrong. Now 'Logged in as: XXX' is displayed only when user XXX is logged in. So no more user@FREEIPA.ORG :) . https://fedorahosted.org/freeipa/ticket/2882 --- install/ui/index.html | 6 +++--- install/ui/ipa.css | 4 ++++ install/ui/ipa.js | 6 +++++- install/ui/webui.js | 5 ++++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/install/ui/index.html b/install/ui/index.html index 33c0923c1..cfa7a4c81 100644 --- a/install/ui/index.html +++ b/install/ui/index.html @@ -71,10 +71,10 @@ - - Logged in as: user@FREEIPA.ORG + - + diff --git a/install/ui/ipa.css b/install/ui/ipa.css index dac345ac3..d6ad58060 100644 --- a/install/ui/ipa.css +++ b/install/ui/ipa.css @@ -262,6 +262,10 @@ body { color: #fff; } +.header-loggedinas .login { + font-weight: bold; +} + /* ---- Navigation ---- */ #navigation { position: absolute; diff --git a/install/ui/ipa.js b/install/ui/ipa.js index aadea8d2a..2547a24d2 100644 --- a/install/ui/ipa.js +++ b/install/ui/ipa.js @@ -157,7 +157,6 @@ var IPA = function() { on_success: function(data, text_status, xhr) { that.whoami = batch ? data.result[0] : data.result.result[0]; that.principal = that.whoami.krbprincipalname[0]; - that.update_password_expiration(); } }); }; @@ -516,6 +515,11 @@ IPA.password_selfservice = function() { self_service: true, on_success: function() { var command = IPA.get_whoami_command(); + var orig_on_success = command.on_success; + command.on_success = function(data, text_status, xhr) { + orig_on_success.call(this, data, text_status, xhr); + IPA.update_password_expiration(); + }; command.execute(); alert(IPA.messages.password.password_change_complete); diff --git a/install/ui/webui.js b/install/ui/webui.js index 0be4b1b63..66efdb2cf 100644 --- a/install/ui/webui.js +++ b/install/ui/webui.js @@ -167,7 +167,7 @@ $(function() { var whoami = IPA.whoami; IPA.whoami_pkey = whoami.uid[0]; - $('#loggedinas strong').text(whoami.cn[0]); + $('#loggedinas .login').text(whoami.cn[0]); $('#loggedinas a').fragment( {'user-facet': 'details', 'user-pkey': IPA.whoami_pkey}, 2); @@ -176,6 +176,9 @@ $(function() { return false; }).text(IPA.messages.login.logout); + $('.header-loggedinas').css('visibility','visible'); + IPA.update_password_expiration(); + IPA.nav = create_navigation(); IPA.nav.create(); IPA.nav.update();