Skip to content

Commit 6ad695c

Browse files
Merge pull request #476 from ExtremeFiretop/Fix-Web-Access-Restrictions
Fix Web-Access Restrictions, Changelog Verification, WebUI Selections, and Firmware Run Estimates
2 parents cece920 + d6075e1 commit 6ad695c

File tree

3 files changed

+148
-147
lines changed

3 files changed

+148
-147
lines changed

MerlinAU.asp

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,9 +1062,9 @@ function GetExternalCheckResults()
10621062
});
10631063
}
10641064
1065-
/**----------------------------------------**/
1066-
/** Modified by Martinski W. [2025-Mar-07] **/
1067-
/**----------------------------------------**/
1065+
/**------------------------------------------**/
1066+
/** Modified by ExtremeFiretop [2025-May-22] **/
1067+
/**------------------------------------------**/
10681068
// To support 'routerPassword' element //
10691069
const loginPassword =
10701070
{
@@ -1119,20 +1119,34 @@ const loginPassword =
11191119
}
11201120
this.pswdStr = pswdStr;
11211121
this.pswdLen = pswdStr.length;
1122-
if (this.pswdInvalid || this.pswdVerified || this.pswdUnverified ||
1123-
this.pswdLen < this.minLen || this.pswdLen > this.maxLen ||
1124-
this.pswdStr.match (`${this.allBlankCharsRegExp}`) !== null)
1122+
if ( this.pswdInvalid ||
1123+
this.pswdLen < this.minLen || this.pswdLen > this.maxLen ||
1124+
this.pswdStr.match(this.allBlankCharsRegExp) !== null )
11251125
{ return false; }
11261126
else
11271127
{ return true; }
11281128
}
11291129
};
11301130
1131-
/**----------------------------------------**/
1132-
/** Modified by Martinski W. [2025-Mar-07] **/
1133-
/**----------------------------------------**/
1131+
/**------------------------------------------**/
1132+
/** Modified by ExtremeFiretop [2025-May-22] **/
1133+
/**------------------------------------------**/
11341134
function ValidatePasswordString (formField, eventID)
11351135
{
1136+
// clear old server invalid flag as soon as they type
1137+
if (eventID === 'onKEYUP') { loginPassword.pswdInvalid = false; }
1138+
1139+
// if the server has already said “invalid,” keep it red
1140+
if (loginPassword.pswdInvalid)
1141+
{
1142+
formField.focus();
1143+
$(formField).addClass('Invalid');
1144+
$(formField).off('mouseover');
1145+
$(formField).on('mouseover',function(){return overlib(loginPassword.ErrorHint(),0,0);});
1146+
$(formField)[0].onmouseout = nd;
1147+
return false;
1148+
}
1149+
11361150
if (loginPassword.ValidateString(formField, eventID))
11371151
{
11381152
$(formField).removeClass('Invalid');
@@ -1141,18 +1155,12 @@ function ValidatePasswordString (formField, eventID)
11411155
}
11421156
else
11431157
{
1144-
let retStatus;
1145-
if (loginPassword.pswdVerified || loginPassword.pswdUnverified)
1146-
{ retStatus = true; }
1147-
else
1148-
{
1149-
retStatus = false;
1150-
$(formField).addClass('Invalid');
1151-
}
1158+
$(formField).addClass('Invalid');
11521159
formField.focus();
1160+
$(formField).off('mouseover');
11531161
$(formField).on('mouseover',function(){return overlib(loginPassword.ErrorHint(),0,0);});
11541162
$(formField)[0].onmouseout = nd;
1155-
return retStatus;
1163+
return false;
11561164
}
11571165
}
11581166
@@ -1461,9 +1469,9 @@ function ShowHintMsg (formField)
14611469
}
14621470
}
14631471
1464-
/**-------------------------------------**/
1465-
/** Added by Martinski W. [2025-Mar-07] **/
1466-
/**-------------------------------------**/
1472+
/**------------------------------------------**/
1473+
/** Modified by ExtremeFiretop [2025-May-22] **/
1474+
/**------------------------------------------**/
14671475
function GetLoginPswdCheckStatus()
14681476
{
14691477
$.ajax({
@@ -1506,11 +1514,12 @@ function GetLoginPswdCheckStatus()
15061514
loginPassword.pswdUnverified = true;
15071515
break;
15081516
case 5: //Failure//
1517+
// mark invalid and only steal focus on real failure
1518+
loginPassword.pswdInvalid = true;
15091519
passwordFailed = true;
15101520
pswdStatusText = 'Status:\n' + loginPswdCheckMsgStr;
15111521
pswdStatusHint0 = loginPswdInvalidHint;
15121522
pswdStatusHint1 = loginPswdInvalidHint;
1513-
loginPassword.pswdInvalid = true;
15141523
break;
15151524
case 6: //Unknown//
15161525
pswdStatusText = 'Status:\n' + loginPswdCheckMsgStr;
@@ -1526,15 +1535,14 @@ function GetLoginPswdCheckStatus()
15261535
loginPswdHint = loginPswdHint.replace (/PswdSTATUS/, pswdStatusHint1);
15271536
15281537
pswdField = document.getElementById('routerPassword');
1529-
if (passwordFailed || pswdVerified || pswdUnverified)
1538+
1539+
// only refocus when passwordFailed is true
1540+
if (passwordFailed)
15301541
{
1531-
if (passwordFailed)
1532-
{
1533-
alert(`**ERROR**\n${loginPswdInvalidMsge}`);
1534-
$(pswdField).addClass('Invalid');
1535-
}
1542+
alert(`**ERROR**\n${loginPswdInvalidMsge}`);
1543+
$(pswdField).addClass('Invalid');
15361544
pswdField.focus();
1537-
$(pswdField).on('mouseover',function(){return overlib(pswdStatusHint0,0,0);});
1545+
$(pswdField).on('mouseover',function(){return overlib(loginPassword.ErrorHint(),0,0);});
15381546
$(pswdField)[0].onmouseout = nd;
15391547
}
15401548
else

0 commit comments

Comments
 (0)