Action panel for user

This patch adds action panel to user account section. The panel contain an action for reseting user password.

https://fedorahosted.org/freeipa/ticket/2248
This commit is contained in:
Petr Vobornik 2012-05-22 18:59:55 +02:00
parent ea5ae4b1cf
commit 888797ffac

View File

@ -103,6 +103,12 @@ IPA.user.entity = function(spec) {
},
{
name: 'account',
action_panel: {
factory: IPA.action_panel,
name: 'account_actions',
label: 'Actions', //TODO: translate
actions: ['reset_password']
},
fields: [
'uid',
{
@ -224,7 +230,8 @@ IPA.user.entity = function(spec) {
IPA.select_action,
IPA.enable_action,
IPA.disable_action,
IPA.delete_action
IPA.delete_action,
IPA.user.reset_password_action
],
header_actions: ['select_action', 'enable', 'disable', 'delete'],
state: {
@ -602,4 +609,25 @@ IPA.user_password_dialog = function(spec) {
return that;
};
IPA.user.reset_password_action = function(spec) {
spec = spec || {};
spec.name = spec.name || 'reset_password';
spec.label = spec.label || IPA.messages.password.reset_password;
//TODO: add enable condition based on ACL
var that = IPA.action(spec);
that.execute_action = function(facet) {
var dialog = IPA.user_password_dialog({
entity: facet.entity
});
dialog.open();
};
return that;
};
IPA.register('user', IPA.user.entity);