mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Added support for browsers that don't support cookies.
This commit is contained in:
parent
fbf20e1674
commit
25fc193a8b
10 changed files with 163 additions and 94 deletions
File diff suppressed because one or more lines are too long
|
@ -1188,7 +1188,7 @@
|
|||
|
||||
function account_showDeleteAccount() {
|
||||
if (xxdialogMode) return;
|
||||
var x = "<form action='" + domainUrl + "deleteaccount' method=post><table style=margin-left:10px><tr>";
|
||||
var x = "<form method=post><table style=margin-left:10px><input type=hidden name=action value=deleteaccount /><input type=hidden name=authcookie value=" + authCookie + " /><tr>";
|
||||
x += "<td align=right>Password:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>";
|
||||
x += "</tr><tr><td align=right>Password:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>";
|
||||
x += '</tr></table><div style=padding:10px;margin-bottom:4px>';
|
||||
|
@ -1200,20 +1200,33 @@
|
|||
Q('apassword1').focus();
|
||||
}
|
||||
|
||||
|
||||
function account_showChangePassword() {
|
||||
if (xxdialogMode) return;
|
||||
var x = "<form action='" + domainUrl + "changepassword' method=post><table style=margin-left:10px>";
|
||||
x += "<tr><td align=right>Old Password:</td><td><input id=apassword0 type=password name=apassword0 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /> <b><span id=dxPassWarn></span></b></td></tr>";
|
||||
x += "<tr><td align=right>New Password:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /> <b><span id=dxPassWarn></span></b></td></tr>";
|
||||
x += "<tr><td align=right>New Password:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /></td></tr>";
|
||||
if (features & 0x00010000) { x += "<tr><td align=right>Hint:</td><td><input id=apasswordhint name=apasswordhint maxlength=250 type=text autocomplete=off /></td></tr>"; }
|
||||
x += '</table><div style=padding:10px;margin-bottom:4px>';
|
||||
x += '<input id=account_dlgCancelButton type=button value=Cancel style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)>';
|
||||
x += '<input id=account_dlgOkButton type=submit value=OK style="float:right;width:80px" onclick=dialogclose(1)>';
|
||||
x += '</div><br /></form>';
|
||||
setDialogMode(2, "Change Password", 0, null, x);
|
||||
account_validateNewPassword();
|
||||
if (xxdialogMode) return false;
|
||||
var x = "<table style=margin-left:10px>";
|
||||
x += "<tr><td align=right>Old password:</td><td><input id=apassword0 type=password name=apassword0 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /> <b></b></td></tr>";
|
||||
x += "<tr><td align=right>New password:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /> <b><span id=dxPassWarn></span></b></td></tr>";
|
||||
x += "<tr><td align=right>New password:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /></td></tr>";
|
||||
if (features & 0x00010000) { x += "<tr><td align=right>Password hint:</td><td><input id=apasswordhint name=apasswordhint maxlength=250 type=text autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /></td></tr>"; }
|
||||
x += '</table>'
|
||||
if (passRequirements) {
|
||||
var r = [], rc = 0;
|
||||
for (var i in passRequirements) { if ((i != 'reset') && (i != 'hint')) { r.push(i + ':' + passRequirements[i]); rc++; } }
|
||||
if (rc > 0) { x += '<br /><span style=font-size:x-small>Requirements: ' + r.join(', ') + '.</span>'; }
|
||||
}
|
||||
x += '<br />';
|
||||
setDialogMode(2, "Change Password", 3, account_showChangePasswordEx, x);
|
||||
Q('apassword0').focus();
|
||||
account_validateNewPassword();
|
||||
return false;
|
||||
}
|
||||
|
||||
function account_showChangePasswordEx() {
|
||||
if (Q('apassword1').value == Q('apassword2').value) {
|
||||
var r = { action: 'changepassword', oldpass: Q('apassword0').value, newpass: Q('apassword1').value };
|
||||
if (features & 0x00010000) { r.hint = Q('apasswordhint').value; }
|
||||
meshserver.send(r);
|
||||
}
|
||||
}
|
||||
|
||||
function account_createMesh() {
|
||||
|
@ -1256,15 +1269,16 @@
|
|||
if (passRequirements == null || passRequirements == '') {
|
||||
// No password requirements, display password strength
|
||||
var passStrength = checkPasswordStrength(Q('apassword1').value);
|
||||
if (passStrength >= 80) { r = '<span style=color:green>●<span>'; } else if (passStrength >= 60) { r = '<span style=color:blue>●<span>'; } else { r = '<span style=color:red>●<span>'; }
|
||||
if (passStrength >= 80) { r = '<span style=color:green>Strong<span>'; } else if (passStrength >= 60) { r = '<span style=color:blue>●<span>'; } else { r = '<span style=color:red>●<span>'; }
|
||||
} else {
|
||||
// Password requirements provided, use that
|
||||
var passReq = checkPasswordRequirements(Q('apassword1').value, passRequirements);
|
||||
if (passReq == false) { ok = false; r = '<span style=color:red>●<span>' }
|
||||
if (passReq == false) { ok = false; r = '<span style=color:red>Policy<span>' }
|
||||
}
|
||||
}
|
||||
QH('dxPassWarn', r);
|
||||
QE('account_dlgOkButton', ok);
|
||||
//QE('account_dlgOkButton', ok);
|
||||
QE('idx_dlgOkButton', ok);
|
||||
}
|
||||
|
||||
// Return a password strength score
|
||||
|
|
|
@ -6469,7 +6469,7 @@
|
|||
function account_showDeleteAccount() {
|
||||
if (xxdialogMode) return false;
|
||||
var x = "To delete this account, type in the account password in both boxes below and hit ok.<br /><br />";
|
||||
x += "<form action='" + domainUrl + "deleteaccount' method=post><table style=margin-left:80px><tr>";
|
||||
x += "<form method=post><input type=hidden name=action value=deleteaccount /><input type=hidden name=authcookie value=" + authCookie + " /><table style=margin-left:80px><tr>";
|
||||
x += "<td align=right>Password:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>";
|
||||
x += "</tr><tr><td align=right>Password:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>";
|
||||
x += '</tr></table><br /><div style=padding:10px;margin-bottom:4px>';
|
||||
|
@ -6486,7 +6486,7 @@
|
|||
if (xxdialogMode) return false;
|
||||
var x = "Change your account password by entering the old password and new password twice in the boxes below.";
|
||||
if (features & 0x00010000) { " Password hint can be used but is not recommanded."; }
|
||||
x += "<br /><br />";;
|
||||
x += "<br /><br />";
|
||||
//x += "<form action='" + domainUrl + "changepassword' method=post>";
|
||||
x += "<table style=margin-left:60px>";
|
||||
x += "<tr><td align=right>Old password:</td><td><input id=apassword0 type=password name=apassword0 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /> <b></b></td></tr>";
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -44,7 +44,8 @@
|
|||
<tr>
|
||||
<td align=center>
|
||||
<div id=loginpanel style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;clear:both;display:none">
|
||||
<form action="login" method=post>
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=login />
|
||||
<div id=message1>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
@ -77,7 +78,8 @@
|
|||
</div>
|
||||
<div id=createpanel style="display:none">
|
||||
<div style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;clear:both;position:relative">
|
||||
<form action=createaccount method=post>
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=createaccount />
|
||||
<div id=message2>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
@ -123,7 +125,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div id=resetpanel style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;display:none;clear:both">
|
||||
<form action=resetaccount method=post>
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=resetaccount />
|
||||
<div id=message3>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
@ -147,7 +150,9 @@
|
|||
</form>
|
||||
</div>
|
||||
<div id=tokenpanel style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;display:none;clear:both">
|
||||
<form action=tokenlogin method=post autocomplete=off>
|
||||
<form method=post autocomplete=off>
|
||||
<input type=hidden name=action value=tokenlogin />
|
||||
<input type=hidden name=hwstate value="{{{hwstate}}}" />
|
||||
<div id=message4>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
@ -171,7 +176,8 @@
|
|||
</div>
|
||||
|
||||
<div id=resettokenpanel style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;display:none;clear:both">
|
||||
<form action=resetaccount method=post autocomplete=off>
|
||||
<form method=post autocomplete=off>
|
||||
<input type=hidden name=action value=resetaccount />
|
||||
<div id=message5>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
@ -195,7 +201,8 @@
|
|||
</div>
|
||||
|
||||
<div id=resetpasswordpanel style="position:relative;background-color:#979797;border-radius:16px;width:300px;padding:16px;text-align:center;display:none">
|
||||
<form action=resetpassword method=post>
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=resetpassword />
|
||||
<div id=message6>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
|
|
@ -41,7 +41,8 @@
|
|||
</td>
|
||||
<td id="logincell">
|
||||
<div id=loginpanel style="display:none">
|
||||
<form action="login" method=post>
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=login />
|
||||
<div id=message1>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
@ -73,7 +74,8 @@
|
|||
</form>
|
||||
</div>
|
||||
<div id=createpanel style="display:none;position:relative">
|
||||
<form action=createaccount method=post>
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=createaccount />
|
||||
<div id=message2>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
@ -118,7 +120,8 @@
|
|||
</form>
|
||||
</div>
|
||||
<div id=resetpanel style="display:none">
|
||||
<form action=resetaccount method=post>
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=resetaccount />
|
||||
<div id=message3>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
@ -142,7 +145,9 @@
|
|||
</form>
|
||||
</div>
|
||||
<div id=tokenpanel style="display:none">
|
||||
<form action=tokenlogin method=post autocomplete=off>
|
||||
<form method=post autocomplete=off>
|
||||
<input type=hidden name=action value=tokenlogin />
|
||||
<input type=hidden name=hwstate value="{{{hwstate}}}" />
|
||||
<div id=message4>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
@ -165,7 +170,8 @@
|
|||
</form>
|
||||
</div>
|
||||
<div id=resettokenpanel style="display:none">
|
||||
<form action=resetaccount method=post>
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=resetaccount />
|
||||
<div id=message5>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
@ -188,7 +194,8 @@
|
|||
</form>
|
||||
</div>
|
||||
<div id=resetpasswordpanel style="display:none;position:relative">
|
||||
<form action=resetpassword method=post>
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=resetpassword />
|
||||
<div id=message6>
|
||||
{{{message}}}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue