diff --git a/exec/postxtrn.js b/exec/postxtrn.js index 1634164392cf9e9c989ec4b37b6c62912bc5ff1f..6f602bfc9c5543efaf04731113e22de7b9c3e892 100644 --- a/exec/postxtrn.js +++ b/exec/postxtrn.js @@ -1,29 +1,25 @@ // postxtrn.js -// External Program Post Module +// External Program Post-execution Module // These actions execute after an external program is launched via bbs.exec_xtrn() "use strict"; -load("sbbsdefs.js"); - -/* text.dat entries */ -load("text.js"); - -var options, program; - -if((options=load({}, "modopts.js","xtrn_sec")) == null) - options = {}; // default values - -if(options.clear_screen === undefined) - options.clear_screen = true; - function exec_xtrn_post(program) { + var options; + + if ((options = load({}, "modopts.js","xtrn:" + program.code)) == null) { + if ((options = load({}, "modopts.js","xtrn_sec")) == null) + options = {}; // default values + } + + require("nodedefs.js", "NODE_LOGN"); if ((options.disable_post_on_logon_event) && (bbs.node_action == NODE_LOGN)) { exit(1); } + require("cga_defs.js", "LIGHTGRAY"); console.attributes = 0; console.attributes = LIGHTGRAY; @@ -34,8 +30,7 @@ function exec_xtrn_post(program) } } - /* main: */ { - exec_xtrn_post(xtrn_area.prog[argv[0].toLowerCase()] ); + exec_xtrn_post(xtrn_area.prog[argv[0].toLowerCase()]); } diff --git a/exec/prextrn.js b/exec/prextrn.js index 07d16322bd427279e90cf79bb563e1b278c1e0c1..07957ceef0d61cb884b13839f9c6b1d2b7646d22 100644 --- a/exec/prextrn.js +++ b/exec/prextrn.js @@ -1,34 +1,34 @@ // prextrn.js -// External Program Pre Module +// External Program Pre-execution Module // These actions execute before an external program is launched via bbs.exec_xtrn() "use strict"; -load("sbbsdefs.js"); - -/* text.dat entries */ -load("text.js"); - -var options, program; - -if((options=load({}, "modopts.js","xtrn_sec")) == null) - options = {}; // default values - - function exec_xtrn_pre(program) { - if ((options.disable_pre_on_logon_event) && (bbs.node_action == NODE_LOGN)) { - exit(1); - } - - if (options.restricted_user_msg === undefined) { - options.restricted_user_msg = bbs.text(R_ExternalPrograms); + var options; + + if ((options = load({}, "modopts.js","xtrn:" + program.code)) == null) { + if ((options = load({}, "modopts.js","xtrn_sec")) == null) + options = {}; // default values } - if (user.security.restrictions&UFLAG_X) { - write(options.restricted_user_msg); - exit(1); + require("nodedefs.js", "NODE_LOGN"); + if (bbs.node_action == NODE_LOGN) { + if (options.disable_pre_on_logon_event) { + exit(1); + } + } else { + if (options.restricted_user_msg === undefined) { + require("text.js", "R_ExternalPrograms"); + options.restricted_user_msg = bbs.text(R_ExternalPrograms); + } + require("userdefs.js", "UFLAG_X"); + if (user.security.restrictions&UFLAG_X) { + write(options.restricted_user_msg); + exit(1); + } } if (bbs.menu_exists("xtrn/" + program.code)) { @@ -37,6 +37,7 @@ function exec_xtrn_pre(program) console.line_counter=0; } + require("cga_defs.js", "LIGHTGRAY"); console.attributes = LIGHTGRAY; if (options.clear_screen_on_exec) {