mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-13 21:53:43 +01:00
Merge pull request #2617 from overleaf/ho-open-site-for-admins
allow site to be accessible to admins when closed GitOrigin-RevId: 71bdf329ce2a4e41533b2a65f45190277ea72dbb
This commit is contained in:
@@ -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' })
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user