mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 20:55:30 +02:00
* More work on ACS system conditional matching. Now functional within menus. Still more work to go on various ACS checks themselves. * Use ACS for new user path: If new user requires activation, they will see 'DONE' then get logged off
24 lines
No EOL
543 B
JavaScript
24 lines
No EOL
543 B
JavaScript
/* jslint node: true */
|
|
'use strict';
|
|
|
|
// ENiGMA½
|
|
var acsParser = require('./acs_parser.js');
|
|
|
|
var _ = require('lodash');
|
|
var assert = require('assert');
|
|
|
|
exports.getConditionalValue = getConditionalValue;
|
|
|
|
function getConditionalValue(client, condArray, memberName) {
|
|
assert(_.isObject(client));
|
|
assert(_.isArray(condArray));
|
|
assert(_.isString(memberName));
|
|
|
|
var matchCond = _.find(condArray, function cmp(cond) {
|
|
return acsParser.parse(cond.acs, { client : client } );
|
|
});
|
|
|
|
if(matchCond) {
|
|
return matchCond[memberName];
|
|
}
|
|
} |