mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
* Some more JSON -> HJSON cleanup
* 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
This commit is contained in:
parent
03f9ad4789
commit
688e46bc47
9 changed files with 93 additions and 68 deletions
|
@ -46,24 +46,10 @@ MenuStack.prototype.next = function(cb) {
|
|||
assert(currentModuleInfo, 'Empty menu stack!');
|
||||
|
||||
var menuConfig = currentModuleInfo.instance.menuConfig;
|
||||
|
||||
/*
|
||||
:TODO: next should allow for conditionals based on ACS
|
||||
|
||||
next: [
|
||||
{ acs: "GM[sysops]|U1", next: theNextMenu },
|
||||
...
|
||||
]
|
||||
|
||||
acsUtil.getAcsConditionMatch(cond, memberName) -> value | undefined
|
||||
(memberName = "next")
|
||||
*/
|
||||
|
||||
var next;
|
||||
|
||||
if(_.isArray(menuConfig.next)) {
|
||||
next = acsUtil.getConditionalValue(this.client, menuConfig.next, 'next');
|
||||
console.log('conditional next: ' + next);
|
||||
if(!next) {
|
||||
cb(new Error('No matching condition for \'next\'!'));
|
||||
return;
|
||||
|
@ -75,12 +61,12 @@ MenuStack.prototype.next = function(cb) {
|
|||
return;
|
||||
}
|
||||
|
||||
if(menuConfig.next === currentModuleInfo.name) {
|
||||
if(next === currentModuleInfo.name) {
|
||||
cb(new Error('Menu config \'next\' specifies current menu!'));
|
||||
return;
|
||||
}
|
||||
|
||||
this.goto(menuConfig.next, { }, cb);
|
||||
this.goto(next, { }, cb);
|
||||
};
|
||||
|
||||
MenuStack.prototype.prev = function(cb) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue