Merge branch 'master' of ssh://numinibsd/git/base/enigma-bbs

This commit is contained in:
Bryan Ashby 2016-07-06 20:56:59 -06:00
commit a32f810c46
2 changed files with 28 additions and 14 deletions

View File

@ -97,6 +97,9 @@ function initializeDatabases(cb) {
} }
function createSystemTables() { function createSystemTables() {
dbs.system.run('PRAGMA foreign_keys = ON;');
dbs.system.run( dbs.system.run(
'CREATE TABLE IF NOT EXISTS system_property (' + 'CREATE TABLE IF NOT EXISTS system_property (' +
' prop_name VARCHAR PRIMARY KEY NOT NULL,' + ' prop_name VARCHAR PRIMARY KEY NOT NULL,' +
@ -120,6 +123,8 @@ function createSystemTables() {
} }
function createUserTables() { function createUserTables() {
dbs.user.run('PRAGMA foreign_keys = ON;');
dbs.user.run( dbs.user.run(
`CREATE TABLE IF NOT EXISTS user ( `CREATE TABLE IF NOT EXISTS user (
id INTEGER PRIMARY KEY, id INTEGER PRIMARY KEY,
@ -158,6 +163,9 @@ function createUserTables() {
} }
function createMessageBaseTables() { function createMessageBaseTables() {
dbs.message.run('PRAGMA foreign_keys = ON;');
dbs.message.run( dbs.message.run(
`CREATE TABLE IF NOT EXISTS message ( `CREATE TABLE IF NOT EXISTS message (
message_id INTEGER PRIMARY KEY, message_id INTEGER PRIMARY KEY,

View File

@ -1,17 +1,18 @@
/* jslint node: true */ /* jslint node: true */
'use strict'; 'use strict';
var Config = require('./config.js').config; // ENiGMA½
var Log = require('./logger.js').log; const Config = require('./config.js').config;
var getMessageAreaByTag = require('./message_area.js').getMessageAreaByTag; const Log = require('./logger.js').log;
var clientConnections = require('./client_connections.js'); const getMessageAreaByTag = require('./message_area.js').getMessageAreaByTag;
var sysProp = require('./system_property.js'); const clientConnections = require('./client_connections.js');
const sysProp = require('./system_property.js');
var packageJson = require('../package.json'); // deps
var assert = require('assert'); const packageJson = require('../package.json');
var os = require('os'); const os = require('os');
var _ = require('lodash'); const _ = require('lodash');
var moment = require('moment'); const moment = require('moment');
exports.getPredefinedMCIValue = getPredefinedMCIValue; exports.getPredefinedMCIValue = getPredefinedMCIValue;
@ -114,6 +115,11 @@ function getPredefinedMCIValue(client, code) {
TC : function totalCalls() { return sysProp.getSystemProperty('login_count').toString(); }, TC : function totalCalls() { return sysProp.getSystemProperty('login_count').toString(); },
//
// Special handling for XY
//
XY : function xyHack() { return; /* nothing */ },
}[code](); // :TODO: Just call toString() here and remove above - DRY }[code](); // :TODO: Just call toString() here and remove above - DRY
} catch(e) { } catch(e) {