From 2efd70671c44890ff17fc43cd49802d625d8534e Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 16 Jul 2019 07:13:12 +0000
Subject: [PATCH] As PSI-Jack pointed out, detecting fast-logons in login.js
 does not help with logins via SSH or RLogin (handled in answer.cpp). So
 revert login.js back to rev 1.17 since the fast-logons are now detected in
 the login name parsing in login.cpp's sbbs_t::parse_login() which is used in
 answer() and login() - called via bbs.login().

So... if you're writing a login matrix or custom login module where you want
to use a *different* method of detecting/enabling fast logon support, you'll
just need to set the SS_FASTLOGON flag in the JS bbs.sys_status property:
    bbs.sys_status |= SS_FASTLOGON;

This also means that 2 modopts.ini options (fast_logon and
fast_logon_requirments) are now used in logon.js, not login.js, so the section
where you add them is now [logon], not [login]. Got it? Good. :-)
---
 exec/login.js | 7 -------
 exec/logon.js | 3 ++-
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/exec/login.js b/exec/login.js
index 3487510a95..c5020e313a 100644
--- a/exec/login.js
+++ b/exec/login.js
@@ -61,15 +61,8 @@ for(var c=0; c < options.login_prompts; c++) {
 	   }
 	   continue;
 	}
-	var fast_logon = false;
-	if(str.charAt(0) === (options.fast_logon_char || '!')) {
-		str = str.substr(1);
-		fast_logon = true;
-	}
 	// Continue normal login (prompting for password)
 	if(bbs.login(str, "\1n\1c\1hPW:\b\b\bPassword: \1w")) {
-		if(fast_logon && options.fast_logon == true && user.compare_ars(options.fast_logon_requirements))
-			bbs.fast_logon = true; // logon.js checks this variable to perform a fast-logon
 		bbs.logon();
 		exit();
 	}
diff --git a/exec/logon.js b/exec/logon.js
index 34eb9554b3..e968c86d4f 100644
--- a/exec/logon.js
+++ b/exec/logon.js
@@ -113,7 +113,8 @@ if(user.security.exemptions&UFLAG_H)
 * Replaces the 2.1 Logon stuff
 ******************************/
 
-if(bbs.fast_logon !== true) {
+if(options.fast_logon !== true || !(bbs.sys_status&SS_FASTLOGON)
+	|| !user.compare_ars(options.fast_logon_requirements)) {
 
 	// Logon screens
 
-- 
GitLab