On 09/24/2010 07:57 PM, Adam Young wrote:
On 09/24/2010 06:57 PM, Endi Sukma Dewata wrote:
----- "Adam Young"<ayo...@redhat.com>  wrote:

On 09/24/2010 10:53 AM, Adam Young wrote:
Whoami link
The 'logged in as' message in the header into an active hypoerlink
that loads the details page for the current user.
Also fixed a bug where, when reloading, the search page would fail
due to scl being undefined
NACK. There's a small problem, it should use user-pkey instead of pkey:

diff --git a/install/static/webui.js b/install/static/webui.js
index b537938..a3d354b 100644
--- a/install/static/webui.js
+++ b/install/static/webui.js
@@ -57,7 +57,7 @@ $(function() {
              whoami_pkey=whoami.uid[0];
$('#loggedinas').find('strong').text(whoami.krbprincipalname[0]);
              $('#loggedinas a').fragment(
-                {'user-facet':'details', 'pkey':whoami_pkey},2);
+                {'user-facet':'details', 'user-pkey':whoami_pkey},2);
              if (whoami.hasOwnProperty('memberof_rolegroup')&&
                  whoami.memberof_rolegroup.length>  0){
                  nav_tabs_lists = admin_tabs_lists;

--
Endi S. Dewata
Fixed


_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-develF


Forgot that crucial "git add" step before committing. Fix is in this patch.


>From 30ed462dc79a63c064de7ff37fd63a536fbd0137 Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Fri, 24 Sep 2010 10:47:40 -0400
Subject: [PATCH] Whoami link
 The 'logged in as' message in the header into an active hypoerlink that loads the details page for the current user.
 Also fixed a bug where, when reloading, the search page would fail due to scl being undefined.

Fixed a typo
replaced                {'user-facet':'details', 'pkey':whoami_pkey},2);
with                    {'user-facet':'details', 'user-pkey':whoami_pkey},2);
---
 install/static/index.xhtml |    2 +-
 install/static/ipa.css     |    3 ++-
 install/static/search.js   |    4 ++++
 install/static/webui.js    |    9 +++++++--
 4 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/install/static/index.xhtml b/install/static/index.xhtml
index 3fcb5f6..062a4a7 100644
--- a/install/static/index.xhtml
+++ b/install/static/index.xhtml
@@ -40,7 +40,7 @@
             <img src="ipalogo.png" />
         </span>
         <span id="loggedinas" class="header-loggedinas">
-            <a>Logged in as <strong>hardco...@freeip.org</strong></a>
+            <a href="#">Logged in as <strong>hardco...@freeip.org</strong></a>
         </span>
     </div>
 
diff --git a/install/static/ipa.css b/install/static/ipa.css
index 7e518b1..c562a20 100644
--- a/install/static/ipa.css
+++ b/install/static/ipa.css
@@ -14,7 +14,6 @@ body{ font: 62.5% "Trebuchet MS", sans-serif; margin: 50px;}
 .input_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
 
 
-
 a {
     text-decoration: none;
     border: 0;
@@ -39,10 +38,12 @@ div.header a {
 
 div.header a:link {
     text-decoration: none;
+    color: white;
 }
 
 div.header a:visited {
     text-decoration: none;
+    color: white;
 }
 
 div.header div.header-logo {
diff --git a/install/static/search.js b/install/static/search.js
index 7347dfc..6c88e41 100644
--- a/install/static/search.js
+++ b/install/static/search.js
@@ -23,6 +23,10 @@
 
 function search_create(obj_name, scl, container)
 {
+    if (!scl){
+        scl = [];
+    }
+
     function find_on_click() {
         var filter = $(this).prev('input[type=text]').val();
         var state = {};
diff --git a/install/static/webui.js b/install/static/webui.js
index 153a609..b8c1d45 100644
--- a/install/static/webui.js
+++ b/install/static/webui.js
@@ -37,7 +37,7 @@ var admin_tabs_lists = [
 ];
 
 
-var self_serv_tabs_lists = 
+var self_serv_tabs_lists =
     [
     ['identity', 'IDENTITY', [
         ['user', 'Users', ipa_entity_setup]]]];
@@ -47,11 +47,16 @@ var nav_tabs_lists;
 /* main (document onready event handler) */
 $(function() {
 
+    var whoami_pkey;
+
     function whoami_on_win(data, text_status, xhr) {
         $(window).bind('hashchange', window_hashchange);
         if (!data.error){
             var whoami = data.result.result[0];
+            whoami_pkey=whoami.uid[0];
             $('#loggedinas').find('strong').text(whoami.krbprincipalname[0]);
+            $('#loggedinas a').fragment(
+                {'user-facet':'details', 'user-pkey':whoami_pkey},2);
             if (whoami.hasOwnProperty('memberof_rolegroup') &&
                 whoami.memberof_rolegroup.length > 0){
                 nav_tabs_lists = admin_tabs_lists;
@@ -59,7 +64,7 @@ $(function() {
             }else{
                 nav_tabs_lists = self_serv_tabs_lists;
 
-                var state = {'user-pkey': whoami.uid[0],
+                var state = {'user-pkey':whoami_pkey ,
                              'user-facet': jQuery.bbq.getState('user-facet') ||
                              'details'};
                 $.bbq.pushState(state);
-- 
1.7.1

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to