summaryrefslogtreecommitdiffstats
path: root/install/ffextension
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-08-29 13:18:20 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-09-11 09:41:51 +0200
commit388a6432ed9c45ca84240c596f091268176d46f9 (patch)
tree9ddc355518703cb9b3aa9fcac26c5ad4d2b3f3ed /install/ffextension
parent8cb27bfa4fe73fa4c236f5e7d9591a28ee064f2b (diff)
downloadfreeipa-388a6432ed9c45ca84240c596f091268176d46f9.tar.gz
freeipa-388a6432ed9c45ca84240c596f091268176d46f9.tar.xz
freeipa-388a6432ed9c45ca84240c596f091268176d46f9.zip
webui: append network.negotiate-auth.trusted-uris
https://fedorahosted.org/freeipa/ticket/4478 Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
Diffstat (limited to 'install/ffextension')
-rw-r--r--install/ffextension/chrome/content/kerberosauth.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/install/ffextension/chrome/content/kerberosauth.js b/install/ffextension/chrome/content/kerberosauth.js
index a79c925bf..c5afde984 100644
--- a/install/ffextension/chrome/content/kerberosauth.js
+++ b/install/ffextension/chrome/content/kerberosauth.js
@@ -42,7 +42,8 @@ var kerberosauth = {
referer: '2',
native_gss_lib: 'true',
trusted_uris: '',
- allow_proxies: 'true'
+ allow_proxies: 'true',
+ append: ['trusted_uris']
}
},
@@ -125,14 +126,25 @@ var kerberosauth = {
var self = this;
var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
+ var append_opts = options.append || [];
for (var opt in options) {
+ if (!self.config_options[opt]) continue;
+
var name = self.config_options[opt][0];
var type = self.config_options[opt][1];
var value = options[opt];
if (type === 'str') {
+ if (value && append_opts.indexOf(opt) > -1) {
+ var current = prefs.getCharPref(name) || '';
+ if (this.str_contains(current, value)) {
+ continue;
+ } else if (current) {
+ value = current + ', ' + value;
+ }
+ }
prefs.setCharPref(name, value);
} else if (type ==='int') {
prefs.setIntPref(name, Number(value));
@@ -142,6 +154,16 @@ var kerberosauth = {
}
},
+ str_contains: function(str, value) {
+
+ if (!str) return false;
+ var vals = str.split(',');
+ for (var i=0, l=vals.length; i<l; i++) {
+ if (vals[i].trim() === value) return true;
+ }
+ return false;
+ },
+
prompt: function(conf, options) {
var strs = Cc["@mozilla.org/intl/stringbundle;1"].
getService(Ci.nsIStringBundleService).