v1.18.x
Julian Lam 10 years ago
parent 9cd352c49a
commit fe7726d249

@ -198,6 +198,8 @@ middleware.checkAccountPermissions = function(req, res, next) {
middleware.buildHeader = function(req, res, next) {
res.locals.renderHeader = true;
middleware.applyCSRF(req, res, function() {
async.parallel({
config: function(next) {
controllers.api.getConfig(req, res, next);
@ -217,6 +219,7 @@ middleware.buildHeader = function(req, res, next) {
next();
});
});
});
};
middleware.renderHeader = function(req, res, callback) {
@ -468,14 +471,12 @@ middleware.maintenanceMode = function(req, res, next) {
res.status(503);
if (!isApiRoute.test(req.url)) {
middleware.applyCSRF(req, res, function() {
middleware.buildHeader(req, res, function() {
res.render('maintenance', {
site_title: meta.config.title || 'NodeBB',
message: meta.config.maintenanceModeMessage
});
});
});
} else {
translator.translate('[[pages:maintenance.text, ' + meta.config.title + ']]', meta.config.defaultLang || 'en_GB', function(translated) {
res.json({

@ -98,7 +98,7 @@ function groupRoutes(app, middleware, controllers) {
function setupPageRoute(router, name, middleware, middlewares, controller) {
middlewares = middlewares.concat([middleware.incrementPageViews, middleware.updateLastOnlineTime]);
router.get(name, middleware.applyCSRF, middleware.buildHeader, middlewares, controller);
router.get(name, middleware.buildHeader, middlewares, controller);
router.get('/api' + name, middlewares, controller);
}

@ -22,19 +22,7 @@
<script type="text/javascript" src="{relative_path}/vendor/chart.js/chart.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/hammer/hammer.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/socket.io/socket.io.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/nodebb.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/colorpicker/colorpicker.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/src/admin/admin.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/ace/ace.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/nanoscroller/nanoscroller.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/jquery/event/jquery.event.drag.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/jquery/event/jquery.event.drop.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/semver/semver.browser.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/jquery/serializeObject/jquery.ba-serializeobject.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/jquery/deserialize/jquery.deserialize.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/mousetrap/mousetrap.js?{cache-buster}"></script>
<script>
require.config({
baseUrl: "{relative_path}/src/modules",
@ -49,6 +37,16 @@
app.inAdmin = true;
</script>
<script type="text/javascript" src="{relative_path}/vendor/colorpicker/colorpicker.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/src/admin/admin.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/ace/ace.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/nanoscroller/nanoscroller.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/jquery/event/jquery.event.drag.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/jquery/event/jquery.event.drop.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/semver/semver.browser.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/jquery/serializeObject/jquery.ba-serializeobject.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/jquery/deserialize/jquery.deserialize.min.js?{cache-buster}"></script>
<script type="text/javascript" src="{relative_path}/vendor/mousetrap/mousetrap.js?{cache-buster}"></script>
<!-- BEGIN scripts -->
<script type="text/javascript" src="{scripts.src}"></script>

Loading…
Cancel
Save