Skip to content
Snippets Groups Projects
Commit 82b3374f authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix long-standing issue with external program name display

Especially for Guest (G-Exempt) accounts which support multiple
concurrent logons - the 'curxtrn' value stored in the user's record
may not match the external program that was actually last executed
on the node in question, so use the .aux property value (from
node.dab) as is done in the C++ code (e.g. printnodedat()). This insures
that the node_status() output here matches the C/C++ code output
(e.g. when logging on the terminal server).

Still support the 'code-based' external program name look-up since
that usage is relied upon by other modules, but when a number is
passed, use the number to find the right external progarm name
(and we need to subtract one, since aux is a 1-based number).

I've looked at this problem a couple of times before and not sure why
I didn't see the solution. <shrug>
parent a7468eaa
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -9,9 +9,15 @@ require("sbbsdefs.js", 'USER_DELETED'); ...@@ -9,9 +9,15 @@ require("sbbsdefs.js", 'USER_DELETED');
"use strict"; "use strict";
// Returns a string, hopefully the full name of the External Program referenced by 'code' // Returns a string, hopefully the full name of the External Program referenced by 'code'
// or referenced by 1-based number (as stored in node.dab 'aux' field)
function xtrn_name(code) function xtrn_name(code)
{ {
if(typeof code == 'number') {
for(var i in xtrn_area.prog)
if(xtrn_area.prog[i].number == code - 1)
return xtrn_area.prog[i].name;
}
if(xtrn_area.prog[code] != undefined && xtrn_area.prog[code].name != undefined) if(xtrn_area.prog[code] != undefined && xtrn_area.prog[code].name != undefined)
return xtrn_area.prog[code].name; return xtrn_area.prog[code].name;
return code; return code;
...@@ -187,9 +193,9 @@ function node_status(node, is_sysop, options, num) ...@@ -187,9 +193,9 @@ function node_status(node, is_sysop, options, num)
break; break;
case NODE_XTRN: case NODE_XTRN:
if(node.aux) if(node.aux)
output += "running " + xtrn_name(user.curxtrn); output += "running " + xtrn_name(node.aux);
else else
output += format(NodeAction[node.action], node.aux); output += NodeAction[node.action];
break; break;
default: default:
output += format(NodeAction[node.action], node.aux); output += format(NodeAction[node.action], node.aux);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment