Do a bit of intermediate database work

This commit is contained in:
calzoneman 2013-12-12 16:28:30 -06:00
parent b889f7b4c8
commit cfd1b0618d
4 changed files with 596 additions and 637 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,12 @@
//var db = require("../database");
var $util = require("../utilities");
var bcrypt = require("bcrypt");
var db = require("../database");
var registrationLock = {};
var blackHole = function () { };
module.exports = function (db) {
return {
module.exports = {
/**
* Initialize the accounts table
*/
@ -494,5 +494,4 @@ module.exports = function (db) {
callback(new Error("recoverPassword is not implemented"), null);
},
};
};

View File

@ -67,13 +67,26 @@ var Server = function (cfg) {
// database init ------------------------------------------------------
var Database = require("./database");
self.db = new Database(self.cfg);
self.db = Database;
self.db.init(self.cfg);
// webserver init -----------------------------------------------------
self.httplog = new Logger.Logger(path.join(__dirname,
"../httpaccess.log"));
self.express = express();
require("./web/webserver").init(self.express);
self.express.get("/old/:channel(*)", function (req, res, next) {
var c = req.params.channel;
if (!$util.isValidChannelName(c)) {
res.redirect("/" + c);
return;
}
self.logHTTP(req);
res.sendfile("channel.html", {
root: path.join(__dirname, "../www")
});
});
/*
self.express.use(express.urlencoded());
self.express.use(express.json());

View File

@ -478,7 +478,7 @@ $(window).resize(function() {
/* load channel */
var loc = document.location+"";
var m = loc.match(/\/r\/([a-zA-Z0-9-_]+)$/);
var m = loc.match(/\/old\/([a-zA-Z0-9-_]+)$/);
if(m) {
CHANNEL.name = m[1];
}