summaryrefslogtreecommitdiffstats
path: root/install/ui/certificate.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-04-12 02:13:30 -0500
committerAdam Young <ayoung@redhat.com>2011-04-13 23:27:50 -0400
commit805b94f22d42eddee42ed8772aca89036edb8399 (patch)
tree12c6d80ce465b0541cfb15332177f36fba79bc0b /install/ui/certificate.js
parent9cac1d88fcffcce65018869827eadcfc0ff157f1 (diff)
downloadfreeipa-805b94f22d42eddee42ed8772aca89036edb8399.tar.gz
freeipa-805b94f22d42eddee42ed8772aca89036edb8399.tar.xz
freeipa-805b94f22d42eddee42ed8772aca89036edb8399.zip
Merged IPA.cmd() into IPA.command().
The IPA.cmd() has been merged into IPA.command(). All invocations and test cases have been converted. Ticket #988
Diffstat (limited to 'install/ui/certificate.js')
-rwxr-xr-xinstall/ui/certificate.js86
1 files changed, 50 insertions, 36 deletions
diff --git a/install/ui/certificate.js b/install/ui/certificate.js
index fea7448cd..c52163629 100755
--- a/install/ui/certificate.js
+++ b/install/ui/certificate.js
@@ -511,11 +511,14 @@ IPA.cert.status_widget = function(spec) {
that.get_button = IPA.button({
label: IPA.messages.buttons.get,
'click': function() {
- IPA.cmd(that.entity_name+'_show', [that.pkey], {},
- function(data, text_status, xhr) {
+ IPA.command({
+ entity: that.entity_name,
+ method: 'show',
+ args: [that.pkey],
+ on_success: function(data, text_status, xhr) {
get_certificate(data.result.result);
}
- );
+ }).execute();
}
});
button.replaceWith(that.get_button);
@@ -524,11 +527,14 @@ IPA.cert.status_widget = function(spec) {
that.revoke_button = IPA.button({
label: IPA.messages.buttons.revoke,
'click': function() {
- IPA.cmd(that.entity_name+'_show', [that.pkey], {},
- function(data, text_status, xhr) {
+ IPA.command({
+ entity: that.entity_name,
+ method: 'show',
+ args: [that.pkey],
+ on_success: function(data, text_status, xhr) {
revoke_certificate(data.result.result);
}
- );
+ }).execute();
}
});
button.replaceWith(that.revoke_button);
@@ -537,11 +543,14 @@ IPA.cert.status_widget = function(spec) {
that.view_button = IPA.button({
label: IPA.messages.buttons.view,
'click': function() {
- IPA.cmd(that.entity_name+'_show', [that.pkey], {},
- function(data, text_status, xhr) {
+ IPA.command({
+ entity: that.entity_name,
+ method: 'show',
+ args: [that.pkey],
+ on_success: function(data, text_status, xhr) {
view_certificate(data.result.result);
}
- );
+ }).execute();
}
});
button.replaceWith(that.view_button);
@@ -552,11 +561,14 @@ IPA.cert.status_widget = function(spec) {
that.restore_button = IPA.button({
label: IPA.messages.buttons.restore,
'click': function() {
- IPA.cmd(that.entity_name+'_show', [that.pkey], {},
- function(data, text_status, xhr) {
+ IPA.command({
+ entity: that.entity_name,
+ method: 'show',
+ args: [that.pkey],
+ on_success: function(data, text_status, xhr) {
restore_certificate(data.result.result);
}
- );
+ }).execute();
}
});
button.replaceWith(that.restore_button);
@@ -605,11 +617,11 @@ IPA.cert.status_widget = function(spec) {
return;
}
- IPA.cmd(
- 'cert_show',
- [serial_number],
- { },
- function(data, text_status, xhr) {
+ IPA.command({
+ entity: 'cert',
+ method: 'show',
+ args: [serial_number],
+ on_success: function(data, text_status, xhr) {
var revocation_reason = data.result.result.revocation_reason;
if (revocation_reason == undefined) {
set_status(IPA.cert.CERTIFICATE_STATUS_VALID);
@@ -617,7 +629,7 @@ IPA.cert.status_widget = function(spec) {
set_status(IPA.cert.CERTIFICATE_STATUS_REVOKED, revocation_reason);
}
}
- );
+ }).execute();
}
function view_certificate(result) {
@@ -686,16 +698,17 @@ IPA.cert.status_widget = function(spec) {
'request': function(values) {
var request = values['request'];
- IPA.cmd(
- 'cert_request',
- [request],
- {
+ IPA.command({
+ entity: 'cert',
+ method: 'request',
+ args: [request],
+ options: {
'principal': entity_principal
},
- function(data, text_status, xhr) {
+ on_success: function(data, text_status, xhr) {
check_status(data.result.result.serial_number);
}
- );
+ }).execute();
}
});
@@ -723,16 +736,17 @@ IPA.cert.status_widget = function(spec) {
'revoke': function(values) {
var reason = values['reason'];
- IPA.cmd(
- 'cert_revoke',
- [serial_number],
- {
+ IPA.command({
+ entity: 'cert',
+ method: 'revoke',
+ args: [serial_number],
+ options: {
'revocation_reason': reason
},
- function(data, text_status, xhr) {
+ on_success: function(data, text_status, xhr) {
check_status(serial_number);
}
- );
+ }).execute();
}
});
@@ -758,14 +772,14 @@ IPA.cert.status_widget = function(spec) {
var dialog = IPA.cert.restore_dialog({
'title': title,
'restore': function(values) {
- IPA.cmd(
- 'cert_remove_hold',
- [serial_number],
- { },
- function(data, text_status, xhr) {
+ IPA.command({
+ entity: 'cert',
+ method: 'remove_hold',
+ args: [serial_number],
+ on_success: function(data, text_status, xhr) {
check_status(serial_number);
}
- );
+ }).execute();
}
});