Don't show trusts pages when trust is not configured

When trust is not configured trust-config page is raising an error. Trusts search page won't find anything either -> no use for the pages -> hiding.

https://fedorahosted.org/freeipa/ticket/3333
This commit is contained in:
Petr Vobornik 2013-03-12 17:00:32 +01:00
parent 7e088a8378
commit 617114aac4
3 changed files with 49 additions and 2 deletions

View File

@ -140,7 +140,17 @@ var IPA = function() {
} }
})); }));
batch.add_command(IPA.command({
entity: 'trustconfig',
method: 'show',
retry: false,
on_success: function(data, text_status, xhr) {
that.trust_enabled = true;
},
on_error: function(xhr, text_status, error_thrown) {
that.trust_enabled = false;
}
}));
batch.execute(); batch.execute();
}; };

View File

@ -28,6 +28,13 @@ IPA.trust.entity = function(spec) {
var that = IPA.entity(spec); var that = IPA.entity(spec);
that.init = function() { that.init = function() {
if (!IPA.trust_enabled) {
throw {
expected: true
};
}
that.entity_init(); that.entity_init();
that.builder.search_facet({ that.builder.search_facet({
@ -198,6 +205,13 @@ IPA.trust.config_entity = function(spec) {
var that = IPA.entity(spec); var that = IPA.entity(spec);
that.init = function() { that.init = function() {
if (!IPA.trust_enabled) {
throw {
expected: true
};
}
that.entity_init(); that.entity_init();
that.builder.details_facet({ that.builder.details_facet({

View File

@ -2,7 +2,7 @@
"error": null, "error": null,
"id": null, "id": null,
"result": { "result": {
"count": 4, "count": 5,
"results": [ "results": [
{ {
"error": null, "error": null,
@ -786,6 +786,29 @@
"result": true, "result": true,
"summary": null, "summary": null,
"value": "" "value": ""
},
{
"error": null,
"result": {
"cn": [
"test.example.com"
],
"dn": "cn=test.example.com,cn=etc,dc=test,dc=example,dc=com",
"ipantdomainguid": [
"ae391b8e-a104-476f-a7ee-146239a31dde"
],
"ipantfallbackprimarygroup": [
"Default SMB Group"
],
"ipantflatname": [
"EXAMPLE"
],
"ipantsecurityidentifier": [
"S-1-5-21-1849636185-3637193423-921922997"
]
},
"summary": null,
"value": "ad"
} }
] ]
} }