|
@ -27,22 +27,18 @@ module.exports= |
|
|
*/ |
|
|
*/ |
|
|
main: function(request, clientAddress, templateContext, filename) |
|
|
main: function(request, clientAddress, templateContext, filename) |
|
|
{ |
|
|
{ |
|
|
console.log("admin main called"); |
|
|
|
|
|
return new Promise(function(resolve, reject) |
|
|
return new Promise(function(resolve, reject) |
|
|
{ |
|
|
{ |
|
|
//if logged in
|
|
|
//if logged in
|
|
|
if(request.session && request.session.user) |
|
|
if(request.session && request.session.user) |
|
|
{ |
|
|
{ |
|
|
console.log(filename); |
|
|
|
|
|
templateContext.loggedIn = true; |
|
|
templateContext.loggedIn = true; |
|
|
utils.getPostData(request).then(function (postData) |
|
|
utils.getPostData(request).then(function (postData) |
|
|
{ |
|
|
{ |
|
|
console.log("temp 1"); |
|
|
|
|
|
var page = "./adminHome.js"; |
|
|
var page = "./adminHome.js"; |
|
|
if(filename.includes('/downloads')) |
|
|
if(filename.includes('/downloads')) |
|
|
{ |
|
|
{ |
|
|
page = "./adminDownloads.js"; |
|
|
page = "./adminDownloads.js"; |
|
|
console.log("downloads time") |
|
|
|
|
|
} |
|
|
} |
|
|
else if(filename.includes("/posts")) |
|
|
else if(filename.includes("/posts")) |
|
|
{ |
|
|
{ |
|
|