aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Stockhammer <martin_s@apache.org>2016-10-26 23:29:11 +0200
committerMartin Stockhammer <martin_s@apache.org>2016-10-26 23:29:11 +0200
commitf327eb9b2493e8250e87847d0b167827bcad16df (patch)
treea93dc64209f0330beca68e6aa7f887129445c1c5
parent6dcd84d2dbf6c8335bcdb3e5c93e3d55498ef0cd (diff)
downloadarchiva-f327eb9b2493e8250e87847d0b167827bcad16df.tar.gz
archiva-f327eb9b2493e8250e87847d0b167827bcad16df.zip
Add admin user check after system configuration change
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/generaladmin/main.js12
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js5
2 files changed, 13 insertions, 4 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/generaladmin/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/generaladmin/main.js
index 8d3269ee1..95ed9f3da 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/generaladmin/main.js
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/admin/features/generaladmin/main.js
@@ -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) {
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js
index cd3f09250..1d7dc714d 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/main.js
@@ -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');