mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
webui: stageuser plugin
Reviewed-By: David Kupka <dkupka@redhat.com> Reviewed-By: Thierry Bordaz <tbordaz@redhat.com>
This commit is contained in:
@@ -250,6 +250,7 @@
|
|||||||
"idviews",
|
"idviews",
|
||||||
"otptoken",
|
"otptoken",
|
||||||
"radiusproxy",
|
"radiusproxy",
|
||||||
|
"stageuser",
|
||||||
"user",
|
"user",
|
||||||
"plugins.load",
|
"plugins.load",
|
||||||
"plugins.login",
|
"plugins.login",
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ define([
|
|||||||
'./sudo',
|
'./sudo',
|
||||||
'./trust',
|
'./trust',
|
||||||
'./user',
|
'./user',
|
||||||
|
'./stageuser',
|
||||||
'dojo/domReady!'
|
'dojo/domReady!'
|
||||||
],function(app_container) {
|
],function(app_container) {
|
||||||
return app_container;
|
return app_container;
|
||||||
|
|||||||
@@ -36,7 +36,22 @@ var nav = {};
|
|||||||
name: 'identity',
|
name: 'identity',
|
||||||
label: '@i18n:tabs.identity',
|
label: '@i18n:tabs.identity',
|
||||||
children: [
|
children: [
|
||||||
{ entity: 'user' },
|
{
|
||||||
|
entity: 'user',
|
||||||
|
facet: 'search',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
entity: 'stageuser',
|
||||||
|
facet: 'search',
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
entity: 'user',
|
||||||
|
facet: 'search_preserved',
|
||||||
|
hidden: true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{ entity: 'group' },
|
{ entity: 'group' },
|
||||||
{ entity: 'host' },
|
{ entity: 'host' },
|
||||||
{ entity: 'hostgroup' },
|
{ entity: 'hostgroup' },
|
||||||
|
|||||||
351
install/ui/src/freeipa/stageuser.js
Normal file
351
install/ui/src/freeipa/stageuser.js
Normal file
@@ -0,0 +1,351 @@
|
|||||||
|
//
|
||||||
|
// Copyright (C) 2015 FreeIPA Contributors see COPYING for license
|
||||||
|
//
|
||||||
|
|
||||||
|
define([
|
||||||
|
'dojo/on',
|
||||||
|
'./ipa',
|
||||||
|
'./jquery',
|
||||||
|
'./menu',
|
||||||
|
'./phases',
|
||||||
|
'./reg',
|
||||||
|
'./rpc',
|
||||||
|
'./text',
|
||||||
|
'./details',
|
||||||
|
'./facet',
|
||||||
|
'./user',
|
||||||
|
'./search',
|
||||||
|
'./entity'],
|
||||||
|
function(
|
||||||
|
on, IPA, $, menu, phases, reg, rpc, text, mod_details, mod_facet, mod_user) {
|
||||||
|
/**
|
||||||
|
* Stage user module
|
||||||
|
* @class
|
||||||
|
* @singleton
|
||||||
|
*/
|
||||||
|
var stageuser = IPA.stageuser = {
|
||||||
|
|
||||||
|
search_facet_group: {
|
||||||
|
name: 'search',
|
||||||
|
label: '@i18n:objects.stageuser.user_categories',
|
||||||
|
facets: {
|
||||||
|
search_normal: 'user_search',
|
||||||
|
search: 'stageuser_search',
|
||||||
|
search_preserved: 'user_search_preserved'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var make_stageuser_spec = function() {
|
||||||
|
return {
|
||||||
|
name: 'stageuser',
|
||||||
|
facet_groups: ['settings'],
|
||||||
|
facets: [
|
||||||
|
{
|
||||||
|
$type: 'search',
|
||||||
|
disable_facet_tabs: false,
|
||||||
|
tabs_in_sidebar: true,
|
||||||
|
tab_label: '@i18n:objects.stageuser.label',
|
||||||
|
facet_groups: [stageuser.search_facet_group],
|
||||||
|
facet_group: 'search',
|
||||||
|
columns: [
|
||||||
|
'uid',
|
||||||
|
'givenname',
|
||||||
|
'sn',
|
||||||
|
'uidnumber',
|
||||||
|
'mail',
|
||||||
|
'telephonenumber',
|
||||||
|
'title'
|
||||||
|
],
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
$type: 'batch_activate'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
control_buttons: [
|
||||||
|
{
|
||||||
|
name: 'activate',
|
||||||
|
label: '@i18n:buttons.activate',
|
||||||
|
icon: 'fa-check'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$type: 'details',
|
||||||
|
disable_facet_tabs: true,
|
||||||
|
sections: [
|
||||||
|
{
|
||||||
|
name: 'identity',
|
||||||
|
label: '@i18n:details.identity',
|
||||||
|
fields: [
|
||||||
|
'title',
|
||||||
|
'givenname',
|
||||||
|
'sn',
|
||||||
|
'cn',
|
||||||
|
'displayname',
|
||||||
|
'initials',
|
||||||
|
'gecos',
|
||||||
|
{
|
||||||
|
name: 'userclass',
|
||||||
|
flags: ['w_if_no_aci']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'account',
|
||||||
|
label: '@i18n:objects.user.account',
|
||||||
|
fields: [
|
||||||
|
'uid',
|
||||||
|
{
|
||||||
|
$factory: mod_user.password_widget,
|
||||||
|
name: 'has_password',
|
||||||
|
metadata: '@mo-param:user:userpassword'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$type: 'datetime',
|
||||||
|
name: 'krbpasswordexpiration',
|
||||||
|
label: '@i18n:objects.user.krbpasswordexpiration',
|
||||||
|
read_only: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'uidnumber',
|
||||||
|
minvalue: -1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'gidnumber',
|
||||||
|
minvalue: -1
|
||||||
|
},
|
||||||
|
'krbprincipalname',
|
||||||
|
{
|
||||||
|
$type: 'datetime',
|
||||||
|
name: 'krbprincipalexpiration'
|
||||||
|
},
|
||||||
|
'loginshell',
|
||||||
|
'homedirectory',
|
||||||
|
{
|
||||||
|
$type: 'sshkeys',
|
||||||
|
name: 'ipasshpubkey',
|
||||||
|
label: '@i18n:objects.sshkeystore.keys'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$type: 'checkboxes',
|
||||||
|
name: 'ipauserauthtype',
|
||||||
|
flags: ['w_if_no_aci'],
|
||||||
|
options: [
|
||||||
|
{ label: '@i18n:authtype.type_password', value: 'password' },
|
||||||
|
{ label: '@i18n:authtype.type_radius', value: 'radius' },
|
||||||
|
{ label: '@i18n:authtype.type_otp', value: 'otp' }
|
||||||
|
],
|
||||||
|
tooltip: '@i18n:authtype.user_tooltip'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$type: 'entity_select',
|
||||||
|
name: 'ipatokenradiusconfiglink',
|
||||||
|
flags: ['w_if_no_aci'],
|
||||||
|
other_entity: 'radiusproxy',
|
||||||
|
other_field: 'cn'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ipatokenradiususername',
|
||||||
|
flags: ['w_if_no_aci']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'contact',
|
||||||
|
label: '@i18n:objects.user.contact',
|
||||||
|
fields: [
|
||||||
|
{ $type: 'multivalued', name: 'mail' },
|
||||||
|
{ $type: 'multivalued', name: 'telephonenumber' },
|
||||||
|
{ $type: 'multivalued', name: 'pager' },
|
||||||
|
{ $type: 'multivalued', name: 'mobile' },
|
||||||
|
{ $type: 'multivalued', name: 'facsimiletelephonenumber' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'mailing',
|
||||||
|
label: '@i18n:objects.user.mailing',
|
||||||
|
fields: ['street', 'l', 'st', 'postalcode']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'employee',
|
||||||
|
label: '@i18n:objects.user.employee',
|
||||||
|
fields: [
|
||||||
|
'ou',
|
||||||
|
{
|
||||||
|
$type: 'entity_select',
|
||||||
|
name: 'manager',
|
||||||
|
other_entity: 'user',
|
||||||
|
other_field: 'uid'
|
||||||
|
},
|
||||||
|
{ $type: 'multivalued', name: 'departmentnumber' },
|
||||||
|
'employeenumber',
|
||||||
|
'employeetype',
|
||||||
|
'preferredlanguage'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'misc',
|
||||||
|
label: '@i18n:objects.user.misc',
|
||||||
|
fields: [
|
||||||
|
{ $type: 'multivalued', name: 'carlicense' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
actions: [
|
||||||
|
'delete'
|
||||||
|
],
|
||||||
|
header_actions: ['delete'],
|
||||||
|
state: {
|
||||||
|
evaluators: [
|
||||||
|
{
|
||||||
|
$factory: IPA.enable_state_evaluator,
|
||||||
|
field: 'nsaccountlock',
|
||||||
|
adapter: { $type: 'batch', result_index: 0 },
|
||||||
|
invert_value: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
$factory: IPA.acl_state_evaluator,
|
||||||
|
name: 'reset_password_acl_evaluator',
|
||||||
|
adapter: { $type: 'batch', result_index: 0 },
|
||||||
|
attribute: 'userpassword'
|
||||||
|
},
|
||||||
|
IPA.user.self_service_other_user_evaluator
|
||||||
|
],
|
||||||
|
summary_conditions: [
|
||||||
|
IPA.enabled_summary_cond,
|
||||||
|
IPA.disabled_summary_cond
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
adder_dialog: {
|
||||||
|
sections: [
|
||||||
|
{
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'uid',
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
'givenname',
|
||||||
|
'sn',
|
||||||
|
'userclass'
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'userpassword',
|
||||||
|
label: '@i18n:password.new_password',
|
||||||
|
$type: 'password'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'userpassword2',
|
||||||
|
label: '@i18n:password.verify_password',
|
||||||
|
$type: 'password',
|
||||||
|
flags: ['no_command'],
|
||||||
|
validators: [{
|
||||||
|
$type: 'same_password',
|
||||||
|
other_field: 'userpassword'
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};};
|
||||||
|
|
||||||
|
stageuser.search_preserved_facet_spec = {
|
||||||
|
$type: 'search',
|
||||||
|
$pre_ops: [
|
||||||
|
{ $del: [[ 'control_buttons', [{ name: 'add'}, { name: 'delete'}] ]] }
|
||||||
|
],
|
||||||
|
disable_facet_tabs: false,
|
||||||
|
tabs_in_sidebar: true,
|
||||||
|
entity: 'user',
|
||||||
|
managed_entity: 'user',
|
||||||
|
name: 'search_preserved',
|
||||||
|
label: '@i18n:objects.stageuser.preserved_label',
|
||||||
|
tab_label: '@i18n:objects.stageuser.preserved_label',
|
||||||
|
facet_groups: [stageuser.search_facet_group],
|
||||||
|
facet_group: 'search',
|
||||||
|
command_options: {
|
||||||
|
'preserved': true
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
'uid',
|
||||||
|
'givenname',
|
||||||
|
'sn',
|
||||||
|
'uidnumber',
|
||||||
|
'mail',
|
||||||
|
'telephonenumber',
|
||||||
|
'title'
|
||||||
|
],
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
$type: 'batch_undel'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
control_buttons: [
|
||||||
|
{
|
||||||
|
name: 'undel',
|
||||||
|
label: '@i18n:buttons.restore',
|
||||||
|
icon: 'fa-heart'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
stageuser.batch_activate_action = function(spec) {
|
||||||
|
|
||||||
|
spec = spec || {};
|
||||||
|
|
||||||
|
spec.name = spec.name || 'activate';
|
||||||
|
spec.method = spec.method || 'activate';
|
||||||
|
spec.needs_confirm = spec.needs_confirm === undefined ? true : spec.needs_confirm;
|
||||||
|
spec.enabled = spec.enabled === undefined ? false : spec.enabled;
|
||||||
|
spec.enable_cond = spec.enable_cond || ['item-selected'];
|
||||||
|
spec.success_msg = spec.success_msg || '@i18n:objects.stageuser.activate_success';
|
||||||
|
spec.confirm_msg = spec.confirm_msg || '@i18n:objects.stageuser.activate_confirm';
|
||||||
|
|
||||||
|
return IPA.batch_items_action(spec);
|
||||||
|
};
|
||||||
|
|
||||||
|
stageuser.batch_undel_action = function(spec) {
|
||||||
|
|
||||||
|
spec = spec || {};
|
||||||
|
|
||||||
|
spec.name = spec.name || 'undel';
|
||||||
|
spec.method = spec.method || 'undel';
|
||||||
|
spec.needs_confirm = spec.needs_confirm === undefined ? true : spec.needs_confirm;
|
||||||
|
spec.enabled = spec.enabled === undefined ? false : spec.enabled;
|
||||||
|
spec.enable_cond = spec.enable_cond || ['item-selected'];
|
||||||
|
spec.success_msg = spec.success_msg || '@i18n:objects.stageuser.undel_success';
|
||||||
|
spec.confirm_msg = spec.confirm_msg || '@i18n:objects.stageuser.undel_confirm';
|
||||||
|
|
||||||
|
return IPA.batch_items_action(spec);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stage user entity specification object
|
||||||
|
* @member stageuser
|
||||||
|
*/
|
||||||
|
stageuser.stageuser_spec = make_stageuser_spec();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register entity
|
||||||
|
* @member stageuser
|
||||||
|
*/
|
||||||
|
stageuser.register = function() {
|
||||||
|
var a = reg.action;
|
||||||
|
var e = reg.entity;
|
||||||
|
var f = reg.facet;
|
||||||
|
a.register('batch_activate', stageuser.batch_activate_action);
|
||||||
|
a.register('batch_undel', stageuser.batch_undel_action);
|
||||||
|
e.register({type: 'stageuser', spec: stageuser.stageuser_spec});
|
||||||
|
f.register_from_spec('user_search_preserved', stageuser.search_preserved_facet_spec);
|
||||||
|
};
|
||||||
|
|
||||||
|
phases.on('registration', stageuser.register);
|
||||||
|
|
||||||
|
return stageuser;
|
||||||
|
});
|
||||||
@@ -43,7 +43,17 @@ define([
|
|||||||
* @alternateClassName IPA.user
|
* @alternateClassName IPA.user
|
||||||
* @singleton
|
* @singleton
|
||||||
*/
|
*/
|
||||||
var exp = IPA.user = {};
|
var exp = IPA.user = {
|
||||||
|
search_facet_group: {
|
||||||
|
name: 'search',
|
||||||
|
label: '@i18n:objects.stageuser.user_categories',
|
||||||
|
facets: {
|
||||||
|
search_normal: 'user_search',
|
||||||
|
search: 'stageuser_search',
|
||||||
|
search_preserved: 'user_search_preserved'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
var make_spec = function() {
|
var make_spec = function() {
|
||||||
return {
|
return {
|
||||||
@@ -51,6 +61,11 @@ return {
|
|||||||
facets: [
|
facets: [
|
||||||
{
|
{
|
||||||
$type: 'search',
|
$type: 'search',
|
||||||
|
label: '@i18n:objects.user.activeuser_label',
|
||||||
|
tab_label: '@i18n:objects.user.activeuser_label',
|
||||||
|
disable_facet_tabs: false,
|
||||||
|
tabs_in_sidebar: true,
|
||||||
|
facet_groups: [exp.search_facet_group],
|
||||||
row_disabled_attribute: 'nsaccountlock',
|
row_disabled_attribute: 'nsaccountlock',
|
||||||
columns: [
|
columns: [
|
||||||
'uid',
|
'uid',
|
||||||
|
|||||||
@@ -508,6 +508,15 @@
|
|||||||
"status_new_ns": "New: key not set",
|
"status_new_ns": "New: key not set",
|
||||||
"status_new_s": "New: key set"
|
"status_new_s": "New: key set"
|
||||||
},
|
},
|
||||||
|
"stageuser": {
|
||||||
|
"activate_confirm": "Are you sure you want to activate selected users?",
|
||||||
|
"activate_success": "${count} user(s) activated",
|
||||||
|
"label": "Stage users",
|
||||||
|
"preserved_label": "Preserved users",
|
||||||
|
"undel_confirm": "Are you sure you want to restore selected users?",
|
||||||
|
"undel_success": "${count} user(s) restored",
|
||||||
|
"user_categories": "User categories",
|
||||||
|
},
|
||||||
"sudocmd": {
|
"sudocmd": {
|
||||||
"groups": "Groups"
|
"groups": "Groups"
|
||||||
},
|
},
|
||||||
@@ -556,6 +565,7 @@
|
|||||||
"user": {
|
"user": {
|
||||||
"account": "Account Settings",
|
"account": "Account Settings",
|
||||||
"account_status": "Account Status",
|
"account_status": "Account Status",
|
||||||
|
"activeuser_label": "Active users",
|
||||||
"contact": "Contact Settings",
|
"contact": "Contact Settings",
|
||||||
"employee": "Employee Information",
|
"employee": "Employee Information",
|
||||||
"error_changing_status": "Error changing account status",
|
"error_changing_status": "Error changing account status",
|
||||||
|
|||||||
@@ -200,6 +200,7 @@ class i18n_messages(Command):
|
|||||||
},
|
},
|
||||||
"buttons": {
|
"buttons": {
|
||||||
"about": _("About"),
|
"about": _("About"),
|
||||||
|
"activate": _("Activate"),
|
||||||
"add": _("Add"),
|
"add": _("Add"),
|
||||||
"add_and_add_another": _("Add and Add Another"),
|
"add_and_add_another": _("Add and Add Another"),
|
||||||
"add_and_close": _("Add and Close"),
|
"add_and_close": _("Add and Close"),
|
||||||
@@ -653,6 +654,15 @@ class i18n_messages(Command):
|
|||||||
"status_new_ns": _("New: key not set"),
|
"status_new_ns": _("New: key not set"),
|
||||||
"status_new_s": _("New: key set"),
|
"status_new_s": _("New: key set"),
|
||||||
},
|
},
|
||||||
|
"stageuser": {
|
||||||
|
"activate_confirm": _("Are you sure you want to activate selected users?"),
|
||||||
|
"activate_success": _("${count} user(s) activated"),
|
||||||
|
"label": _("Stage users"),
|
||||||
|
"preserved_label": _("Preserved users"),
|
||||||
|
"undel_confirm": _("Are you sure you want to restore selected users?"),
|
||||||
|
"undel_success": _("${count} user(s) restored"),
|
||||||
|
"user_categories": _("User categories"),
|
||||||
|
},
|
||||||
"sudocmd": {
|
"sudocmd": {
|
||||||
"groups": _("Groups"),
|
"groups": _("Groups"),
|
||||||
},
|
},
|
||||||
@@ -701,6 +711,7 @@ class i18n_messages(Command):
|
|||||||
"user": {
|
"user": {
|
||||||
"account": _("Account Settings"),
|
"account": _("Account Settings"),
|
||||||
"account_status": _("Account Status"),
|
"account_status": _("Account Status"),
|
||||||
|
"activeuser_label": _("Active users"),
|
||||||
"contact": _("Contact Settings"),
|
"contact": _("Contact Settings"),
|
||||||
"employee": _("Employee Information"),
|
"employee": _("Employee Information"),
|
||||||
"error_changing_status": _("Error changing account status"),
|
"error_changing_status": _("Error changing account status"),
|
||||||
|
|||||||
Reference in New Issue
Block a user