diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2012-06-26 16:19:58 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2012-06-29 11:55:53 +0200 |
commit | 5b7084aeb587cd06dcfae8ab6fa3b175e6704138 (patch) | |
tree | 1d5cda11ef2d773a947d4e2cf815c9513f371807 /install/ui/widget.js | |
parent | a6ff85f425d5c38dd89fcd8999e0d62eadb969a1 (diff) | |
download | freeipa.git-5b7084aeb587cd06dcfae8ab6fa3b175e6704138.tar.gz freeipa.git-5b7084aeb587cd06dcfae8ab6fa3b175e6704138.tar.xz freeipa.git-5b7084aeb587cd06dcfae8ab6fa3b175e6704138.zip |
Web UI password is going to expire in n days notification
This patch adds pending password expiration notification support to Web UI. When user's password is going to expire in less or equal than configure days a bold red text 'Your password expires in N days.' and a link 'Reset your password' are shown in Web UI's header (on the left next to 'Logged in as...').
Clicking on 'Reset your password link' opens IPA.user_password_dialog. Successful reset of own password will reload user's information (whoami) and update header (it will most likely hide the warning and link).
https://fedorahosted.org/freeipa/ticket/2625
Diffstat (limited to 'install/ui/widget.js')
-rw-r--r-- | install/ui/widget.js | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/install/ui/widget.js b/install/ui/widget.js index 50389755..a55cc347 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -1125,29 +1125,8 @@ IPA.utc_date_formatter = function(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) - + var date = IPA.parse_utc_date(value); + if (!date) return value; return date.toString(); }; |