From b73fc6e550fed9a1b6d83a03fa16f43b361ec8aa Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Tue, 31 Jan 2012 13:41:28 -0600 Subject: 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 --- install/ui/widget.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'install/ui/widget.js') diff --git a/install/ui/widget.js b/install/ui/widget.js index 5ab28cb6..04c35bb6 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -1054,6 +1054,45 @@ IPA.boolean_status_formatter = function(spec) { return that; }; +/* Take an LDAP format date in UTC and format it */ +IPA.utc_date_formatter = function(spec) { + + spec = spec || {}; + + var that = IPA.formatter(spec); + + that.format = function(value) { + + if (!value) return ''; + + // verify length + if (value.length != 'YYYYmmddHHMMSSZ'.length) { + return value; + } + + /* We only handle GMT */ + if (value.charAt(value.length -1) !== 'Z') { + return value; + } + + var date = new Date(); + + date.setUTCFullYear( + value.substring(0, 4), // YYYY + value.substring(4, 6)-1, // mm (0-11) + value.substring(6, 8)); // dd (1-31) + + date.setUTCHours( + value.substring(8, 10), // HH (0-23) + value.substring(10, 12), // MM (0-59) + value.substring(12, 14)); // SS (0-59) + + return date.toString(); + }; + + return that; +}; + /* The entity name must be set in the spec either directly or via entity.name */ -- cgit