teampad feature

This commit is contained in:
Robert Helmer 2013-01-23 12:04:06 -08:00
parent 0f2d542bbe
commit 9212a39cff
14 changed files with 871 additions and 4 deletions

View file

@ -49,6 +49,27 @@ exports.checkAccess = function (padID, sessionCookie, token, password, callback)
callback(null, {accessStatus: "deny"});
return;
}
}
else if(padManager.isTeamPad(padID))
{
authorManager.getAuthor4Token(token, function(err, author)
{
if(ERR(err, callback)) return;
// TODO check session
console.log('sessionCookie: ' + sessionCookie);
sessionManager.getSessionInfo(sessionCookie, function(err, result) {
if (err) {
statusObject = {accessStatus: "denyTeamPad", authorID: author};
callback(null, statusObject);
} else {
// TODO figure out how to force authorID to match account name...
statusObject = {accessStatus: "grant", authorID: author};
callback(null, statusObject);
}
});
});
}
// a session is not required, so we'll check if it's a public pad
else