summaryrefslogtreecommitdiffstats
path: root/install/ui/ipa.js
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2011-12-19 18:31:35 -0600
committerPetr Vobornik <pvoborni@redhat.com>2012-01-10 18:42:26 +0100
commit74e31cd9853539f860f68e813191083e46a1192b (patch)
tree0e4914c06c68bd839d4b20897b5273f7c4ded06d /install/ui/ipa.js
parent0e037f24ce59752713d8291eae30403cb864c758 (diff)
downloadfreeipa.git-74e31cd9853539f860f68e813191083e46a1192b.tar.gz
freeipa.git-74e31cd9853539f860f68e813191083e46a1192b.tar.xz
freeipa.git-74e31cd9853539f860f68e813191083e46a1192b.zip
Added policies into user details page.
The user details page has been modified to show the password policy and Kerberos ticket policy that apply to the user. The policies are currently displayed as read-only. Ticket #703
Diffstat (limited to 'install/ui/ipa.js')
-rw-r--r--install/ui/ipa.js168
1 files changed, 88 insertions, 80 deletions
diff --git a/install/ui/ipa.js b/install/ui/ipa.js
index 23a5e428..90d10291 100644
--- a/install/ui/ipa.js
+++ b/install/ui/ipa.js
@@ -561,96 +561,104 @@ IPA.batch_command = function (spec) {
that.execute = function() {
that.errors.clear();
- IPA.command({
+ var command = IPA.command({
name: that.name,
entity: that.entity,
method: that.method,
args: that.args,
options: that.options,
- retry: that.retry,
- on_success: function(data, text_status, xhr) {
+ retry: that.retry
+ });
- for (var i=0; i<that.commands.length; i++) {
- var command = that.commands[i];
- var result = data.result.results[i];
-
- var name = '';
- var message = '';
-
- if (!result) {
- name = IPA.get_message('errors.internal_error', 'Internal Error')+' '+xhr.status;
- message = result ? xhr.statusText : IPA.get_message('errors.internal_error', 'Internal Error');
-
- that.errors.add(command, name, message, text_status);
-
- if (command.on_error) command.on_error.call(
- this,
- xhr,
- text_status,
- {
- name: name,
- message: message
- }
- );
-
- } else if (result.error) {
- name = IPA.get_message('errors.ipa_error', 'IPA Error')+(result.error.code ? ' '+result.error.code : '');
- message = result.error.message || result.error;
-
- that.errors.add(command, name, message, text_status);
-
- if (command.on_error) command.on_error.call(
- this,
- xhr,
- text_status,
- {
- name: name,
- code: result.error.code,
- message: message,
- data: result
- }
- );
-
- } else {
- var failed = that.get_failed(command, result, text_status, xhr);
- that.errors.add_range(failed);
-
- if (command.on_success) command.on_success.call(this, result, text_status, xhr);
- }
- }
- //check for partial errors and show error dialog
- if(that.show_error && that.errors.errors.length > 0) {
- var ajax = this;
- var dialog = IPA.error_dialog({
- xhr: xhr,
- text_status: text_status,
- error_thrown: {
- name: IPA.get_message('dialogs.batch_error_title', 'Operations Error'),
- message: that.error_message
- },
- command: that,
- errors: that.errors.errors,
- visible_buttons: ['ok']
- });
+ command.on_success = that.batch_command_on_success;
+ command.on_error = that.batch_command_on_error;
- dialog.on_ok = function() {
- dialog.close();
- if (that.on_success) that.on_success.call(ajax, data, text_status, xhr);
- };
+ command.execute();
+ };
- dialog.open();
+ that.batch_command_on_success = function(data, text_status, xhr) {
- } else {
- if (that.on_success) that.on_success.call(this, data, text_status, xhr);
- }
- },
- on_error: function(xhr, text_status, error_thrown) {
- // TODO: undefined behavior
- if (that.on_error) {
- that.on_error.call(this, xhr, text_status, error_thrown);
- }
+ for (var i=0; i<that.commands.length; i++) {
+ var command = that.commands[i];
+ var result = data.result.results[i];
+
+ var name = '';
+ var message = '';
+
+ if (!result) {
+ name = IPA.get_message('errors.internal_error', 'Internal Error')+' '+xhr.status;
+ message = result ? xhr.statusText : IPA.get_message('errors.internal_error', 'Internal Error');
+
+ that.errors.add(command, name, message, text_status);
+
+ if (command.on_error) command.on_error.call(
+ this,
+ xhr,
+ text_status,
+ {
+ name: name,
+ message: message
+ }
+ );
+
+ } else if (result.error) {
+ name = IPA.get_message('errors.ipa_error', 'IPA Error')+(result.error.code ? ' '+result.error.code : '');
+ message = result.error.message || result.error;
+
+ that.errors.add(command, name, message, text_status);
+
+ if (command.on_error) command.on_error.call(
+ this,
+ xhr,
+ text_status,
+ {
+ name: name,
+ code: result.error.code,
+ message: message,
+ data: result
+ }
+ );
+
+ } else {
+ var failed = that.get_failed(command, result, text_status, xhr);
+ that.errors.add_range(failed);
+
+ if (command.on_success) command.on_success.call(this, result, text_status, xhr);
}
- }).execute();
+ }
+
+ //check for partial errors and show error dialog
+ if (that.show_error && that.errors.errors.length > 0) {
+ var ajax = this;
+ var dialog = IPA.error_dialog({
+ xhr: xhr,
+ text_status: text_status,
+ error_thrown: {
+ name: IPA.get_message('dialogs.batch_error_title', 'Operations Error'),
+ message: that.error_message
+ },
+ command: that,
+ errors: that.errors.errors,
+ visible_buttons: [ 'ok' ]
+ });
+
+ dialog.on_ok = function() {
+ dialog.close();
+ if (that.on_success) that.on_success.call(ajax, data, text_status, xhr);
+ };
+
+ dialog.open();
+
+ } else {
+ if (that.on_success) that.on_success.call(this, data, text_status, xhr);
+ }
+ };
+
+ that.batch_command_on_error = function(xhr, text_status, error_thrown) {
+ // TODO: undefined behavior
+ if (that.on_error) {
+ that.on_error.call(this, xhr, text_status, error_thrown);
+ }
};
return that;