Skip to content
Snippets Groups Projects

default.js command shell: Fully path .js scripts being executed in case the...

Closed Eric Oulashin requested to merge default_js_fully_path_exec_scripts into master
1 file
+ 18
7
Compare changes
  • Side-by-side
  • Inline
+ 18
7
@@ -18,6 +18,17 @@ const help_key = '?';
// If user has unlimited time, display time-used rather than time-remaining
const time_code = user.security.exemptions & UFLAG_T ? "@TUSED@" : "@TLEFT@";
// Checks whether a file is in the mods dir and returns that full path if so;
// otherwise, returns the full path with the file in the exec dir
function checkFileDir(filename)
{
var modsFilePath = system.mods_dir + filename;
if (file_exists(modsFilePath))
return modsFilePath;
else
return system.exec_dir + filename;
}
const main_menu = {
file: "main",
eval: 'bbs.main_cmds++',
@@ -28,14 +39,14 @@ const main_menu = {
slash_num_input: shell.get_grp_num,
command: {
'A': { eval: 'bbs.auto_msg()' },
'/A': { exec: 'avatar_chooser.js'
'/A': { exec: checkFileDir('avatar_chooser.js')
,ars: 'ANSI and not GUEST'
,err: '\r\nSorry, only regular users with ANSI terminals can do that.\r\n' },
'B': { eval: 'bbs.scan_subs(SCAN_BACK)'
,msg: '\r\n\x01c\x01hBrowse/New Message Scan\r\n' },
'C': { eval: 'bbs.chat_sec()' },
'D': { eval: 'bbs.user_config(); exit()' },
'E': { exec: 'email_sec.js' },
'E': { exec: checkFileDir('email_sec.js') },
'F': { eval: 'bbs.scan_subs(SCAN_FIND)'
,msg: '\r\n\x01c\x01hFind Text in Messages\r\n' },
'/F': { eval: 'bbs.scan_subs(SCAN_FIND, /* all */true)' },
@@ -51,7 +62,7 @@ const main_menu = {
'O': { eval: 'shell.logoff(/* fast: */false)' },
'/O': { eval: 'shell.logoff(/* fast: */true)' },
'P': { eval: 'bbs.post_msg()' },
'/P': { exec: 'postpoll.js' },
'/P': { exec: checkFileDir('postpoll.js') },
'Q': { eval: 'bbs.qwk_sec()' },
'R': { eval: 'bbs.scan_msgs()' },
'S': { eval: 'bbs.scan_subs(SCAN_TOYOU)'
@@ -59,8 +70,8 @@ const main_menu = {
'/S': { eval: 'bbs.scan_subs(SCAN_TOYOU, /* all */true)' },
'U': { eval: 'shell.list_users()' },
'/U': { eval: 'bbs.list_users(UL_ALL)' },
'V': { exec: 'scanpolls.js' },
'/V': { exec: 'scanpolls.js', args: ['all'] },
'V': { exec: checkFileDir('scanpolls.js') },
'/V': { exec: checkFileDir('scanpolls.js'), args: ['all'] },
'W': { eval: 'bbs.whos_online()' },
'X': { eval: 'bbs.xtrn_sec()' },
'Z': { eval: 'bbs.scan_subs(SCAN_NEW | SCAN_CONT)'
@@ -68,7 +79,7 @@ const main_menu = {
'/Z': { eval: 'bbs.scan_subs(SCAN_NEW | SCAN_CONT, /* all */true)' },
'*': { eval: 'shell.show_subs(bbs.curgrp)' },
'/*': { eval: 'shell.show_grps()' },
'&': { exec: 'msgscancfg.js' },
'&': { exec: checkFileDir('msgscancfg.js') },
'!': { eval: 'bbs.menu("sysmain")'
,ars: 'SYSOP or EXEMPT Q or I or N' },
'#': { msg: '\r\n\x01c\x01hType the actual number, not the symbol.\r\n' },
@@ -145,7 +156,7 @@ const file_menu = {
,msg: '\r\n\x01c\x01hUpload File to Sysop\r\n' },
'*': { eval: 'shell.show_dirs(bbs.curlib)' },
'/*': { eval: 'shell.show_libs()' },
'&': { exec: 'filescancfg.js' },
'&': { exec: checkFileDir('filescancfg.js') },
'!': { eval: 'bbs.menu("sysxfer")' },
'#': { msg: '\r\n\x01c\x01hType the actual number, not the symbol.\r\n' },
'/#': { msg: '\r\n\x01c\x01hType the actual number, not the symbol.\r\n' },
Loading