mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 04:45:21 -05: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:
parent
98f031e9aa
commit
b94e1791e0
2 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue