Add admin user check after system configuration change

This commit is contained in:
Martin Stockhammer 2016-10-26 23:29:11 +02:00
parent 6dcd84d2db
commit f327eb9b24
2 changed files with 13 additions and 4 deletions

View File

@ -1358,7 +1358,15 @@ define("archiva/admin/features/generaladmin/main",["jquery","jquery.ui","i18n","
self.redbackRuntimeConfiguration().rbacManagerImpls.push(beanId);
}
var adminAvailableResponseFn = function(adminExists) {
$.log("admin exists "+adminExists);
if (adminExists) {
window.sammyArchivaApplication.runRoute("get","#redbackruntimeconfig");
} else {
logout();
displayWelcome();
}
}
$.log("rememberme enabled:"+self.redbackRuntimeConfiguration().findPropertyValue("security.rememberme.enabled"));
$.ajax("restServices/archivaServices/redbackRuntimeConfigurationService/redbackRuntimeConfiguration",
{
@ -1368,7 +1376,7 @@ define("archiva/admin/features/generaladmin/main",["jquery","jquery.ui","i18n","
dataType: 'json',
success: function(data) {
var message=$.i18n.prop('redback-runtime-configuration.updated');
window.sammyArchivaApplication.runRoute("get","#redbackruntimeconfig");
checkCreateAdminLink(adminAvailableResponseFn);
displaySuccessMessage(message);
},
error: function(data) {

View File

@ -825,14 +825,15 @@ function(jquery,ui,sammy,tmpl,i18n,jqueryCookie,bootstrap,archivaSearch,jqueryVa
} else {
createAdminLink.hide();
}
if(callbackFn){
callbackFn()
if(callbackFn) {
callbackFn(adminExists)
}
$.log("adminExists:"+adminExists);
}
});
};
// handle url with registration link
checkUrlParams=function(){
var validateMeId = $.urlParam('validateMe');