From 40ad6e486469d9e104fe9947301c2410917b8a4b Mon Sep 17 00:00:00 2001 From: rswindell <> Date: Wed, 14 Aug 2019 07:01:22 +0000 Subject: [PATCH] Removed the HTMLterm stuff, cutting the size of this file in half (Sorry Deuce). If/when HTMLterm is resurrected, this logic should probably go into a subordinate module that's invoked when appropriate. --- exec/logon.js | 124 +++++++++----------------------------------------- 1 file changed, 22 insertions(+), 102 deletions(-) diff --git a/exec/logon.js b/exec/logon.js index e968c86d4f..1e04e707ad 100644 --- a/exec/logon.js +++ b/exec/logon.js @@ -159,111 +159,31 @@ if(user.security.level==99 /* Sysop logging on */ console.crlf(); } -/* - * Disable HTML mode if not using an HTML shell - * If you don't do this, you'll get HTML menus that flash on - * screen then disappear when the ANSI prompt is displayed - * - * It's still in the autoterm variable, so you CAN switch - */ -if(user.settings&USER_HTML) { - if(user.command_shell.search(/html/i)==-1) - user.settings&=~USER_HTML; +// Last few callers +console.aborted=false; +console.clear(LIGHTGRAY); +logonlst=system.data_dir + "logon.lst" +if(file_size(logonlst)<1) + printf("\1n\1g\1hYou are the first caller of the day!\r\n"); +else { + printf("\1n\1g\1hLast few callers:\1n\r\n"); + console.printtail(logonlst, options.last_few_callers, P_NOATCODES|P_TRUNCATE|P_NOABORT); } +console.crlf(); -if(user.settings&USER_HTML) { - load("asc2htmlterm.js"); - var buf="\2\2<html><head><title>Welcome status screen</title></head><body bgcolor=\"black\" text=\"#a8a8a8\">"; - - // Last few callers - logonlst=system.data_dir + "logon.lst" - if(file_size(logonlst)<1) - buf += asc2htmlterm("\1n\1g\1hYou are the first caller of the day!\r\n",false,true).replace(/(?: )*<br>/g,'<br>'); - else { - f=new File(logonlst); - if(f.open("rb",true,f.length)) { - var lastbuf=f.read(f.length); - f.close(); - lastbuf = lastbuf.replace(/^.*((?:[\x00\x09\x0b-\xff]*[\n]){1,4})$/,'$1'); - buf += asc2htmlterm("\1n\1g\1hLast few callers:\1n\r\n",false,true).replace(/(?: )*<br>/g,'<br>'); - buf += asc2htmlterm(lastbuf, false, true).replace(/(?: )*<br>/g,'<br>'); - } - } - buf += ' <br>'; - - // Auto-message - auto_msg=system.data_dir + "msgs/auto.msg" - if(file_size(auto_msg)>0) { - f=new File(auto_msg); - if(f.open("rb",true,f.length)) { - buf += asc2htmlterm(f.read(f.length), false, true, P_NOATCODES).replace(/(?: )*<br>/g,'<br>'); - f.close(); - } - - buf += ' <br>'; - } - - if(!(system.settings&SYS_NOSYSINFO)) { - buf += asc2htmlterm(format(bbs.text(SiSysName),system.name) - + format(bbs.text(LiUserNumberName),user.number,user.alias) - + format(bbs.text(LiLogonsToday),user.stats.logonstoday - ,user.limits.logons_per_day) - + format(bbs.text(LiTimeonToday),user.stats.timeon_today - ,user.limits.time_per_day+user.security.minutes) - + format(bbs.text(LiMailWaiting),user.mail_waiting) - , false, true).replace(/(?: )*<br>/g,'<br>'); - /* - * Notes: - * 1) We cannot access cfg.sys_char_ar - * 2) logon.cpp and chat.cpp differ... chat.cpp adds useron.exempt&FLAG('C') - */ - /* - strcpy(str,bbs.text[LiSysopIs]); - if(bbs.startup_options&BBS_OPT_SYSOP_AVAILABLE - || (cfg.sys_chat_ar[0] && chk_ar(cfg.sys_chat_ar,&useron))) - strcat(str,bbs.text[LiSysopAvailable]); - else - strcat(str,bbs.text[LiSysopNotAvailable]); - format("%s\r\n\r\n",str); - */ - } - - buf += "<br><a href=\" \">Click here to continue...</a></body>\n\2"; - /* Disable autopause */ - var os = bbs.sys_status; - bbs.sys_status |= SS_PAUSEOFF; - bbs.sys_status &= ~SS_PAUSEON; - console.write(buf); - bbs.sys_status=os; - console.getkey(); +// Auto-message +auto_msg=system.data_dir + "msgs/auto.msg" +if(file_size(auto_msg)>0) { + console.printfile(auto_msg,P_NOATCODES|P_WORDWRAP); } -else { - // Last few callers - console.aborted=false; - console.clear(LIGHTGRAY); - logonlst=system.data_dir + "logon.lst" - if(file_size(logonlst)<1) - printf("\1n\1g\1hYou are the first caller of the day!\r\n"); - else { - printf("\1n\1g\1hLast few callers:\1n\r\n"); - console.printtail(logonlst, options.last_few_callers, P_NOATCODES|P_TRUNCATE|P_NOABORT); - } - console.crlf(); - - // Auto-message - auto_msg=system.data_dir + "msgs/auto.msg" - if(file_size(auto_msg)>0) { - console.printfile(auto_msg,P_NOATCODES|P_WORDWRAP); - } - console.crlf(); - - if(options.show_avatar && console.term_supports(USER_ANSI)) { - if(options.draw_avatar_above || options.draw_avatar_right) - bbs.mods.avatar_lib.draw(user.number, /* name: */null, /* netaddr: */null, options.draw_avatar_above, options.draw_avatar_right); - else - bbs.mods.avatar_lib.show(user.number); - console.attributes = 7; // Clear the background attribute - } +console.crlf(); + +if(options.show_avatar && console.term_supports(USER_ANSI)) { + if(options.draw_avatar_above || options.draw_avatar_right) + bbs.mods.avatar_lib.draw(user.number, /* name: */null, /* netaddr: */null, options.draw_avatar_above, options.draw_avatar_right); + else + bbs.mods.avatar_lib.show(user.number); + console.attributes = 7; // Clear the background attribute } // Set rlogin_xtrn_menu=true in [logon] section of ctrl/modopts.ini -- GitLab