Files
infoscreen3/modules/db.js
T
Reaby dabd104b3a Notice: breaking changes for configs so reconfigure needed, run npm install again as well!
Added proper authentication
Started to add permissions for ui
Added unload webpage from the layer when it hides
Added autosense for language based on browser preferred lang
2019-05-14 19:39:07 +03:00

28 lines
738 B
JavaScript

var records = require("../config.js").admins;
module.exports = {
findById: function(id, cb) {
process.nextTick(function () {
var idx = id - 1;
if (records[idx]) {
cb(null, records[idx]);
} else {
cb(new Error('User ' + id + ' does not exist'));
}
});
},
findByUsername: function(username, cb) {
process.nextTick(function () {
for (var i = 0, len = records.length; i < len; i++) {
var record = records[i];
if (record.username === username) {
return cb(null, record);
}
}
return cb(null, null);
});
}
};