ACK Looks good.

----- Original Message -----
> _______________________________________________
> Freeipa-devel mailing list
> Freeipa-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/freeipa-devel
From 40c765b901e23d4677f82439796563241a6d40bd Mon Sep 17 00:00:00 2001
From: Adam Young <ayo...@redhat.com>
Date: Tue, 25 Jan 2011 21:58:49 -0500
Subject: [PATCH] dns visible if enabled
 use the result of the is_dns_enabled command to show or hid the dns tab

Also, Javascript lint cleanup from recent patches.
---
 install/ui/entity.js |    2 +-
 install/ui/ipa.js    |    1 +
 install/ui/webui.js  |   13 ++++++++++---
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/install/ui/entity.js b/install/ui/entity.js
index 34e34d6cfccc199ee68404cd7276d22a0b342494..e7fa6a7a3e96ea850e87036a4cb06029cd8d2eba 100644
--- a/install/ui/entity.js
+++ b/install/ui/entity.js
@@ -434,7 +434,7 @@ IPA.nested_tabs = function(entity_name){
                     IPA.nested_tab_labels[entity_name] =
                         top_tab.children[subtab_index].label;
                     if (top_tab.children[subtab_index].children){
-                        label = top_tab.children[subtab_index].label
+                        label = top_tab.children[subtab_index].label;
                         nested_entities = top_tab.children[subtab_index].children;
                         for ( nested_index = 0;
                               nested_index < nested_entities.length;
diff --git a/install/ui/ipa.js b/install/ui/ipa.js
index 5e22b2c3f08781f2f5a7bce1b72bd3142bcde240..725bf17c593aa30115d318bf3614239ef58948a6 100644
--- a/install/ui/ipa.js
+++ b/install/ui/ipa.js
@@ -95,6 +95,7 @@ var IPA = ( function () {
                 that.messages = data.result.results[1].messages;
                 that.whoami  = data.result.results[2].result[0];
                 that.env = data.result.results[3].result;
+                that.dns_enabled = data.result.results[4].result;
                 if (on_success) {
                     on_success(data, text_status, xhr);
                 }
diff --git a/install/ui/webui.js b/install/ui/webui.js
index b1097f63a1f5ec843961ed1b90a86d8d6e05a1c9..f5b77c851a798e3fbea328178be70e49fb86a7f6 100644
--- a/install/ui/webui.js
+++ b/install/ui/webui.js
@@ -27,7 +27,7 @@
 
 
 IPA.admin_tab_set = function () {
-    return [
+    var tabset = [
         {name:'identity', label: IPA.messages.tabs.identity,  children:[
             {name:'user', entity:'user'},
             {name:'group', entity:'group'},
@@ -37,7 +37,6 @@ IPA.admin_tab_set = function () {
             {name:'service', entity:'service'}
         ]},
         {name:'policy', label: IPA.messages.tabs.policy, children:[
-            {name:'dnszone', entity:'dnszone'},
             {name:'hbacrule', label: IPA.messages.tabs.hbac ,
              entity:'hbacrule', children:[
                 {name:'hbacsvc', entity:'hbacsvc'},
@@ -60,6 +59,14 @@ IPA.admin_tab_set = function () {
             {name:'delegation'  ,entity:'delegation'},
             {name:'config', entity:'config'}
         ]}];
+
+    if (IPA.dns_enabled){
+        tabset[1].children.unshift(
+            {name:'dnszone', entity:'dnszone'}
+        );
+    }
+
+    return tabset;
 };
 
 IPA.self_serv_tab_set = function(){
@@ -139,7 +146,7 @@ $(function() {
             IPA.tab_set = IPA.admin_tab_set();
             nav_create(IPA.tab_set, navigation, 'tabs');
         } else {
-            IPA.tab_set = self_serv_tab_set();
+            IPA.tab_set = IPA.self_serv_tab_set();
             nav_create(IPA.tab_set, navigation, 'tabs');
 
             var state = {'user-pkey':IPA.whoami_pkey ,
-- 
1.7.3.5

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

Reply via email to