diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties index 2342722b1..39813deee 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties @@ -460,3 +460,8 @@ report.health.result.name=Name report.health.result.problem=Problem report.health.result.message=Message report.result.title=Result + +admin.creation.mandatory=You must create the admin user! + + + diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js index d48626a2e..97e0b4e51 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js @@ -644,6 +644,7 @@ function(jquery,ui,sammy,tmpl) { dataType: 'json', success: function(data) { var adminExists = data; + window.archivaModel.adminExists=adminExists; var createAdminLink=$("#create-admin-link"); if (adminExists == false) { createAdminLink.show(); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js index 886711189..6ae6465d9 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js @@ -123,6 +123,10 @@ require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) { mainContent.removeAttr("data-bind"); $("#body_content" ).find(".popover" ).hide(); clearUserMessages(); + if(window.archivaModel.adminExists==false){ + displayErrorMessage($.i18n.prop("admin.creation.mandatory")); + } + } /** diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js index dcaa3956f..a3f678e7e 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/user.js @@ -277,6 +277,7 @@ define("redback.user",["jquery","utils","i18n","jquery.validate","knockout","kno dataType: 'json', success: function(data) { var adminExists = data; + window.archivaModel.adminExists=adminExists; if (adminExists == false) { window.redbackModel.createUser=true;