summaryrefslogtreecommitdiffstats
path: root/install/ui/field.js
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-01-31 13:41:28 -0600
committerPetr Voborník <pvoborni@redhat.com>2012-02-01 15:51:50 +0100
commitb73fc6e550fed9a1b6d83a03fa16f43b361ec8aa (patch)
treeb6689c9c2d1993db34ec319a7bf579afbbfb62f7 /install/ui/field.js
parent77f0e9aba5282679754029220538b12480316ca8 (diff)
downloadfreeipa-b73fc6e550fed9a1b6d83a03fa16f43b361ec8aa.tar.gz
freeipa-b73fc6e550fed9a1b6d83a03fa16f43b361ec8aa.tar.xz
freeipa-b73fc6e550fed9a1b6d83a03fa16f43b361ec8aa.zip
Show password expiration date.
The user details page was modified to show the password expiration date next to the existing password field. Fixed problem resetting password in self-service mode. The JSON interface for the passwd command requires the username to be specified although the equivalent CLI command doesn't require it. Ticket #2064
Diffstat (limited to 'install/ui/field.js')
-rw-r--r--install/ui/field.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/install/ui/field.js b/install/ui/field.js
index c448c41c5..38d71b476 100644
--- a/install/ui/field.js
+++ b/install/ui/field.js
@@ -34,6 +34,7 @@ IPA.field = function(spec) {
that.name = spec.name;
that.label = spec.label;
that.tooltip = spec.tooltip;
+ that.formatter = spec.formatter;
that.widget = null;
that.widget_name = spec.widget;
@@ -194,7 +195,25 @@ IPA.field = function(spec) {
};
that.update = function() {
- if(that.widget && that.widget.update) that.widget.update(that.values);
+
+ if (!that.widget || !that.widget.update) return;
+
+ var formatted_values;
+
+ // The formatter is currently only used on read-only fields only
+ // because it cannot parse formatted values back to internal values.
+ if (that.formatter && that.read_only) {
+ formatted_values = [];
+ for (var i=0; that.values && i<that.values.length; i++) {
+ var value = that.values[i];
+ var formatted_value = that.formatter.format(value);
+ formatted_values.push(formatted_value);
+ }
+ } else {
+ formatted_values = that.values;
+ }
+
+ that.widget.update(formatted_values);
};
that.get_update_info = function() {