mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fixed host keytab status after setting OTP.
The host details page has been modified to update the keytab status based on the data returned by the host-mod command for setting OTP. Ticket #1710
This commit is contained in:
parent
79f5c5b2ae
commit
9dd689ff9d
@ -215,6 +215,8 @@ IPA.details_list_section = function(spec) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
that.list_section_create = that.create;
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -29,20 +29,25 @@ IPA.entity_factories.host = function () {
|
|||||||
return IPA.entity_builder().
|
return IPA.entity_builder().
|
||||||
entity('host').
|
entity('host').
|
||||||
search_facet({
|
search_facet({
|
||||||
columns:['fqdn','description',{
|
columns: [
|
||||||
|
'fqdn',
|
||||||
|
'description',
|
||||||
|
{
|
||||||
name: 'krblastpwdchange',
|
name: 'krblastpwdchange',
|
||||||
label: IPA.messages.objects.host.enrolled,
|
label: IPA.messages.objects.host.enrolled,
|
||||||
format: IPA.utc_date_column_format
|
format: IPA.utc_date_column_format
|
||||||
}]
|
}
|
||||||
|
]
|
||||||
}).
|
}).
|
||||||
details_facet({sections:[
|
details_facet({
|
||||||
|
sections: [
|
||||||
{
|
{
|
||||||
name: 'details',
|
name: 'details',
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
factory: IPA.host_dnsrecord_entity_link_widget,
|
factory: IPA.host_dnsrecord_entity_link_widget,
|
||||||
name: 'fqdn',
|
name: 'fqdn',
|
||||||
other_entity:'dnsrecord'
|
other_entity: 'dnsrecord'
|
||||||
},
|
},
|
||||||
'krbprincipalname',
|
'krbprincipalname',
|
||||||
'description',
|
'description',
|
||||||
@ -53,30 +58,33 @@ IPA.entity_factories.host = function () {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:'enrollment',
|
factory: IPA.host_enrollment_section,
|
||||||
fields:[
|
name: 'enrollment',
|
||||||
|
fields: [
|
||||||
{
|
{
|
||||||
factory: IPA.host_keytab_widget,
|
factory: IPA.host_keytab_widget,
|
||||||
'name': 'has_keytab',
|
name: 'has_keytab',
|
||||||
label: IPA.messages.objects.host.keytab
|
label: IPA.messages.objects.host.keytab
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
factory: IPA.host_password_widget,
|
factory: IPA.host_password_widget,
|
||||||
'name': 'has_password',
|
name: 'has_password',
|
||||||
label: IPA.messages.objects.host.password
|
label: IPA.messages.objects.host.password
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name:'certificate',
|
name: 'certificate',
|
||||||
fields:[
|
fields: [
|
||||||
{
|
{
|
||||||
factory: IPA.host_certificate_status_widget,
|
factory: IPA.host_certificate_status_widget,
|
||||||
'name': 'certificate_status',
|
name: 'certificate_status',
|
||||||
label: IPA.messages.objects.host.status
|
label: IPA.messages.objects.host.status
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}]}).
|
}
|
||||||
|
]
|
||||||
|
}).
|
||||||
association_facet({
|
association_facet({
|
||||||
name: 'managedby_host',
|
name: 'managedby_host',
|
||||||
add_method: 'add_managedby',
|
add_method: 'add_managedby',
|
||||||
@ -414,6 +422,42 @@ IPA.force_host_add_checkbox_widget = function(spec) {
|
|||||||
return IPA.checkbox_widget(spec);
|
return IPA.checkbox_widget(spec);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IPA.host_enrollment_section = function(spec) {
|
||||||
|
|
||||||
|
spec = spec || {};
|
||||||
|
|
||||||
|
var that = IPA.details_list_section(spec);
|
||||||
|
|
||||||
|
that.create = function(container) {
|
||||||
|
that.list_section_create(container);
|
||||||
|
|
||||||
|
var keytab_field = that.get_field('has_keytab');
|
||||||
|
var password_field = that.get_field('has_password');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The set_password() in the password field is being customized to
|
||||||
|
* update the keytab field.
|
||||||
|
*
|
||||||
|
* The customization needs to be done here because the section
|
||||||
|
* doesn't create the fields. The IPA.entity_builder adds the fields
|
||||||
|
* after creating the section. This needs to be improved.
|
||||||
|
*/
|
||||||
|
var super_set_password = password_field.set_password;
|
||||||
|
password_field.set_password = function(password, on_success, on_error) {
|
||||||
|
super_set_password.call(
|
||||||
|
this,
|
||||||
|
password,
|
||||||
|
function(data, text_status, xhr) {
|
||||||
|
keytab_field.load(data.result.result);
|
||||||
|
if (on_success) on_success.call(this, data, text_status, xhr);
|
||||||
|
},
|
||||||
|
on_error);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
return that;
|
||||||
|
};
|
||||||
|
|
||||||
IPA.host_keytab_widget = function(spec) {
|
IPA.host_keytab_widget = function(spec) {
|
||||||
|
|
||||||
spec = spec || {};
|
spec = spec || {};
|
||||||
@ -621,7 +665,7 @@ IPA.host_password_widget = function(spec) {
|
|||||||
that.set_password(
|
that.set_password(
|
||||||
new_password,
|
new_password,
|
||||||
function(data, text_status, xhr) {
|
function(data, text_status, xhr) {
|
||||||
set_status('present');
|
that.load(data.result.result);
|
||||||
dialog.close();
|
dialog.close();
|
||||||
},
|
},
|
||||||
function(xhr, text_status, error_thrown) {
|
function(xhr, text_status, error_thrown) {
|
||||||
|
@ -46,6 +46,8 @@
|
|||||||
"fqdn": [
|
"fqdn": [
|
||||||
"test.example.com"
|
"test.example.com"
|
||||||
],
|
],
|
||||||
|
"has_keytab": false,
|
||||||
|
"has_password": true,
|
||||||
"ipauniqueid": [
|
"ipauniqueid": [
|
||||||
"ac28dca0-f3b5-11df-879f-00163e72f2d9"
|
"ac28dca0-f3b5-11df-879f-00163e72f2d9"
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user