To be consistent with backend code.

https://fedorahosted.org/freeipa/ticket/5622
--
Petr Vobornik
From 083644a9203745fe5e0a51647b076b4a42e38e5c Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Wed, 20 Jan 2016 19:00:33 +0100
Subject: [PATCH] webui: use API call ca_is_enabled instead of enable_ra env
 variable.

To be consistent with backend code.

https://fedorahosted.org/freeipa/ticket/5622
---
 install/ui/src/freeipa/certificate.js | 2 +-
 install/ui/src/freeipa/ipa.js         | 8 ++++++++
 install/ui/test/data/ipa_init.json    | 6 ++++++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/install/ui/src/freeipa/certificate.js b/install/ui/src/freeipa/certificate.js
index 93f3cfc68a95bfb8014aaf96d1b571568ac605dc..5d50a25571f0669250927895ebe52fbf4aad0584 100755
--- a/install/ui/src/freeipa/certificate.js
+++ b/install/ui/src/freeipa/certificate.js
@@ -592,7 +592,7 @@ IPA.cert.load_policy = function(spec) {
 };
 
 IPA.cert.is_enabled = function() {
-    return !!IPA.env.enable_ra;
+    return !!IPA.ca_enabled;
 };
 
 IPA.cert.view_action = function(spec) {
diff --git a/install/ui/src/freeipa/ipa.js b/install/ui/src/freeipa/ipa.js
index 23efd6916cdaa76973491a5741f0800caa186fee..29af4048740894c6d46b5419a941e2a48cd68775 100644
--- a/install/ui/src/freeipa/ipa.js
+++ b/install/ui/src/freeipa/ipa.js
@@ -232,6 +232,14 @@ var IPA = function () {
             }
         }));
 
+        batch.add_command(rpc.command({
+            entity: 'ca',
+            method: 'is_enabled',
+            on_success: function(data, text_status, xhr) {
+                that.ca_enabled = data.result;
+            }
+        }));
+
         batch.execute();
     };
 
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index 310eef1055a19dd40f8221c2967b09773595b80b..129ce4e26e7e6bdc2fac039e3628f608eaf4509f 100644
--- a/install/ui/test/data/ipa_init.json
+++ b/install/ui/test/data/ipa_init.json
@@ -971,6 +971,12 @@
             {
                 "error": null,
                 "result": 1
+            },
+            {
+                "error": null,
+                "result": true,
+                "summary": null,
+                "value": null
             }
         ]
     }
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to