multiple plugins pointing to admin can conflict - fix

v1.18.x
psychobunny 11 years ago
parent 41f98d29b7
commit 1d6135150f

@ -141,13 +141,16 @@ var user = require('./../user.js'),
for (var route in routes) {
if (routes.hasOwnProperty(route)) {
app[routes[route].method || 'get']('/admin' + routes[route].route, function(req, res) {
routes[route].options(req, res, function(options) {
Admin.build_header(res, function (err, header) {
res.send(header + options.content + templates['admin/footer']);
(function(route) {
console.log(routes[route]);
app[routes[route].method || 'get']('/admin' + routes[route].route, function(req, res) {
routes[route].options(req, res, function(options) {
Admin.build_header(res, function (err, header) {
res.send(header + options.content + templates['admin/footer']);
});
});
});
});
}(route));
}
}
});

@ -706,16 +706,18 @@ var express = require('express'),
var routes = custom_routes.routes;
for (var route in routes) {
if (routes.hasOwnProperty(route)) {
app[routes[route].method || 'get'](routes[route].route, function(req, res) {
routes[route].options(req, res, function(options) {
app.build_header({
req: options.req,
res: options.res
}, function (err, header) {
res.send(header + options.content + templates['footer']);
(function(route) {
app[routes[route].method || 'get'](routes[route].route, function(req, res) {
routes[route].options(req, res, function(options) {
app.build_header({
req: options.req,
res: options.res
}, function (err, header) {
res.send(header + options.content + templates['footer']);
});
});
});
});
}(route));
}
}
});
@ -726,4 +728,4 @@ var express = require('express'),
}(WebServer));
global.server = server;
global.server = server;
Loading…
Cancel
Save