summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-04-26 13:24:26 +0200
committerPetr Vobornik <pvoborni@redhat.com>2013-05-06 16:22:30 +0200
commit504fa6c786e661a77452132c77a06bfbf6796c5d (patch)
tree6c274f7e7e2dada8a6b886e6ce9136fa753a91bf
parent0674d67acc2b3a8a3a992937d1ca463d695b5d31 (diff)
downloadfreeipa-504fa6c786e661a77452132c77a06bfbf6796c5d.tar.gz
freeipa-504fa6c786e661a77452132c77a06bfbf6796c5d.tar.xz
freeipa-504fa6c786e661a77452132c77a06bfbf6796c5d.zip
Do not offer already added members in association dialogs when different casing
https://fedorahosted.org/freeipa/ticket/3235
-rw-r--r--install/ui/src/freeipa/association.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/install/ui/src/freeipa/association.js b/install/ui/src/freeipa/association.js
index a689de43c..d33ec8742 100644
--- a/install/ui/src/freeipa/association.js
+++ b/install/ui/src/freeipa/association.js
@@ -234,7 +234,8 @@ IPA.association_adder_dialog = function(spec) {
var pkey_attr = that.other_entity.metadata.primary_key;
- var selected = that.get_selected_values();
+ var selected = that.normalize_values(that.get_selected_values());
+ var exclude = that.normalize_values(that.exclude);
var results = data.result;
var same_entity = that.entity === that.other_entity;
@@ -243,7 +244,8 @@ IPA.association_adder_dialog = function(spec) {
var pkey = result[pkey_attr][0];
if (same_entity && pkey === that.pkey) continue;
- if (that.exclude.indexOf(pkey) >= 0) continue;
+ pkey = that.normalize_values([pkey])[0];
+ if (exclude.indexOf(pkey) >= 0) continue;
if (selected.indexOf(pkey) >= 0) continue;
that.add_available_value(result);
@@ -285,6 +287,14 @@ IPA.association_adder_dialog = function(spec) {
}).execute();
};
+ that.normalize_values = function(values) {
+ var norm = [];
+ for (var i=0; i<values.length;i++) {
+ norm.push(values[i].toLowerCase());
+ }
+ return norm;
+ };
+
init();
return that;