diff options
author | Alexander Bokovoy <abokovoy@redhat.com> | 2011-07-07 18:58:18 +0300 |
---|---|---|
committer | Alexander Bokovoy <abokovoy@redhat.com> | 2011-07-12 13:36:12 +0300 |
commit | 40ce1cde62113e8091ed8fae6a2acdf03e7b9c9c (patch) | |
tree | 5ead9f82d1e5ce5f45ef664bfc354251c396bc9d /install/ui | |
parent | 3229eee074e6b419f64faa9bb701a60fe96da3a6 (diff) | |
download | freeipa-ticket-1259.tar.gz freeipa-ticket-1259.tar.xz freeipa-ticket-1259.zip |
Convert nsaccountlock to always work as bool towards Python codeticket-1259
https://fedorahosted.org/freeipa/ticket/1259
Python code will see nsaccountlock as bool. JavaScript code will also see it as bool.
This allows native boolean operations with the lock field. Passes both CLI and WebUI tests.
Diffstat (limited to 'install/ui')
-rw-r--r-- | install/ui/user.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/install/ui/user.js b/install/ui/user.js index 9fd14d69d..fb43916f1 100644 --- a/install/ui/user.js +++ b/install/ui/user.js @@ -200,9 +200,16 @@ IPA.user_status_widget = function(spec) { if (!that.record) return; var lock_field = 'nsaccountlock'; + var locked_field = that.record[lock_field]; + var locked = false; - var locked = that.record[lock_field] && - that.record[lock_field][0].toLowerCase() === 'true'; + if (typeof locked_field === 'array') locked_field = locked_field[0]; + + if (typeof locked_field === 'boolean') { + locked = locked_field; + } else { + locked = locked_field && locked_field.toLowerCase() === 'true'; + } var status; var action; |