summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmagne <jmagne@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-05-20 21:07:51 +0000
committerjmagne <jmagne@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-05-20 21:07:51 +0000
commitbc395eb0b33bd17e0e80c8f3cb0baa4bcd74d583 (patch)
tree9aa15e40ad74976fcbd85a5f214b48026aa90345
parent5c408cae66651900db0236f81012cdc0b91e249a (diff)
Fix bug #491019.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@471 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
-rwxr-xr-xpki/dogtag/tps-ui/shared/docroot/esc/sow/util.js70
1 files changed, 70 insertions, 0 deletions
diff --git a/pki/dogtag/tps-ui/shared/docroot/esc/sow/util.js b/pki/dogtag/tps-ui/shared/docroot/esc/sow/util.js
index a1973c7be..48bd2dcc1 100755
--- a/pki/dogtag/tps-ui/shared/docroot/esc/sow/util.js
+++ b/pki/dogtag/tps-ui/shared/docroot/esc/sow/util.js
@@ -1698,3 +1698,73 @@ function DoCoolKeySetConfigValue(configValue,newValue)
return result;
}
+
+//Is the user "uid" an "agent" or "user"
+// Input "type" either "agent" or "user"
+
+function IsAgentOrUser(uid,type)
+{
+ var url = window.location.href;
+ var lastSlash = 0;
+
+ var result = false;
+
+ if(!uid || !type)
+ return false;
+
+ var isAgent = 0;
+
+ if(type == "agent")
+ isAgent = 1;
+
+ //Accept either uid=name or name
+
+ if(uid.lastIndexOf("uid=") < 0)
+ {
+ uid = "uid=" + uid;
+ }
+
+ if(url)
+ {
+ lastSlash = url.lastIndexOf("/");
+ }
+ if(lastSlash > 0)
+ {
+ url = url.substring(0,lastSlash);
+ }
+
+ if(isAgent)
+ url = url + "/is_agent.cgi?" + uid;
+ else
+ url = url + "/is_user.cgi?" + uid;
+
+ var req = new XMLHttpRequest();
+ req.open('GET',url,false);
+ req.send(null);
+ if(req.status == 200)
+ {
+ //alert(req.responseText);
+ if(req.responseText.lastIndexOf("yes") >= 0)
+ {
+ result = true;
+ }
+ }
+ return result;
+}
+
+function GetCoolKeyIssuedTo(keyType,keyID)
+{
+ var keyStatus = GetStatusForKeyID(keyType,keyID);
+
+ var issuedTo = null;
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ issuedTo = netkey.GetCoolKeyIssuedTo(keyType,keyID);
+
+ } catch (e)
+ {
+ }
+ return issuedTo;
+}
+