diff --git a/services/web/app/src/infrastructure/Server.js b/services/web/app/src/infrastructure/Server.js index eb5e271c8d..324f71cc71 100644 --- a/services/web/app/src/infrastructure/Server.js +++ b/services/web/app/src/infrastructure/Server.js @@ -182,6 +182,11 @@ if (app.get('env') === 'production') { webRouter.use(function(req, res, next) { if (Settings.siteIsOpen) { next() + } else if ( + AuthenticationController.getSessionUser(req) && + AuthenticationController.getSessionUser(req).isAdmin + ) { + next() } else { res.status(503) res.render('general/closed', { title: 'maintenance' }) diff --git a/services/web/app/views/project/list.pug b/services/web/app/views/project/list.pug index 57a893f131..3ff4e764b1 100644 --- a/services/web/app/views/project/list.pug +++ b/services/web/app/views/project/list.pug @@ -23,6 +23,9 @@ block content - if(typeof(suppressSystemMessages) == "undefined") script. window.systemMessages = !{StringHelper.stringifyJsonForScript(systemMessages)}; + - if(settings.siteIsOpen == false && getSessionUser() && getSessionUser().isAdmin) + script. + window.systemMessages.push({content: "SITE IS CLOSED TO PUBLIC. OPEN ONLY FOR SITE ADMINS", _id:"siteclosed"}) .system-messages( ng-cloak