mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Fixed internalization of server messages on the login screen.
This commit is contained in:
parent
368e237ee6
commit
5490262f77
9 changed files with 117 additions and 120 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -46,9 +46,7 @@
|
|||
<div id=loginpanel style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;clear:both;display:none">
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=login />
|
||||
<div id=message1>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message1></div>
|
||||
<div>
|
||||
<b>Log In</b>
|
||||
</div>
|
||||
|
@ -80,9 +78,7 @@
|
|||
<div style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;clear:both;position:relative">
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=createaccount />
|
||||
<div id=message2>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message2></div>
|
||||
<div>
|
||||
<b>Account Creation</b>
|
||||
</div>
|
||||
|
@ -127,9 +123,7 @@
|
|||
<div id=resetpanel style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;display:none;clear:both">
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=resetaccount />
|
||||
<div id=message3>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message3></div>
|
||||
<div>
|
||||
<b>Account Reset</b>
|
||||
</div>
|
||||
|
@ -153,9 +147,7 @@
|
|||
<form method=post autocomplete=off>
|
||||
<input type=hidden name=action value=tokenlogin />
|
||||
<input type=hidden name=hwstate value="{{{hwstate}}}" />
|
||||
<div id=message4>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message4></div>
|
||||
<table>
|
||||
<tr>
|
||||
<td align=right width=100>Login token:</td>
|
||||
|
@ -178,9 +170,7 @@
|
|||
<div id=resettokenpanel style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;display:none;clear:both">
|
||||
<form method=post autocomplete=off>
|
||||
<input type=hidden name=action value=resetaccount />
|
||||
<div id=message5>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message5></div>
|
||||
<table>
|
||||
<tr>
|
||||
<td align=right width=100>Login token:</td>
|
||||
|
@ -203,9 +193,7 @@
|
|||
<div id=resetpasswordpanel style="position:relative;background-color:#979797;border-radius:16px;width:300px;padding:16px;text-align:center;display:none">
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=resetpassword />
|
||||
<div id=message6>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message6></div>
|
||||
<div id="rpasswordPolicyCallout" style="left:-10px;width:100px;display:none;position:absolute;background-color:#FFC;border-radius:5px;padding:5px;box-shadow:0px 0px 15px #666;font-size:10px"></div>
|
||||
<table>
|
||||
<tr>
|
||||
|
@ -279,6 +267,20 @@
|
|||
var hardwareKeyChallenge = decodeURIComponent('{{{hkey}}}');
|
||||
var currentpanel = 0;
|
||||
|
||||
// Display the right server message
|
||||
var messageid = parseInt('{{{messageid}}}');
|
||||
var okmessages = ['', "Hold on, reset mail sent."];
|
||||
var failmessages = ["Unable to create account.", "Account limit reached.", "Existing account with this email address.", "Invalid account creation token.", "Username already exists.", "Password rejected, use a different one.", "Invalid email.", "Account not found.", "Invalid token, try again.", "Unable to sent email.", "Account locked.", "Access denied.", "Login failed, check username and password.", "Password change requested."];
|
||||
if (messageid > 0) {
|
||||
var msg = '';
|
||||
if ((messageid < 100) && (messageid < okmessages.length)) { msg = okmessages[messageid]; }
|
||||
else if ((messageid >= 100) && ((messageid - 100) < failmessages.length)) { msg = failmessages[messageid - 100]; }
|
||||
if (msg != '') {
|
||||
if (messageid >= 100) { msg = ('<span class="msg error"><b style=color:#8C001A>' + msg + '<b></span><br /><br />'); } else { msg = ('<span class="msg success"><b>' + msg + '</b></span><br /><br />'); }
|
||||
for (var i = 1; i < 7; i++) { QH('message' + i, msg); }
|
||||
}
|
||||
}
|
||||
|
||||
// If URL arguments are provided, add them to form posts
|
||||
if (window.location.href.indexOf('?') > 0) {
|
||||
var urlargs = window.location.href.substring(window.location.href.indexOf('?'));
|
||||
|
|
|
@ -43,9 +43,7 @@
|
|||
<div id=loginpanel style="display:none">
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=login />
|
||||
<div id=message1>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message1></div>
|
||||
<div>
|
||||
<b>Log In</b>
|
||||
</div>
|
||||
|
@ -76,9 +74,7 @@
|
|||
<div id=createpanel style="display:none;position:relative">
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=createaccount />
|
||||
<div id=message2>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message2></div>
|
||||
<div>
|
||||
<b>Account Creation</b>
|
||||
</div>
|
||||
|
@ -122,9 +118,7 @@
|
|||
<div id=resetpanel style="display:none">
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=resetaccount />
|
||||
<div id=message3>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message3></div>
|
||||
<div>
|
||||
<b>Account Reset</b>
|
||||
</div>
|
||||
|
@ -148,9 +142,7 @@
|
|||
<form method=post autocomplete=off>
|
||||
<input type=hidden name=action value=tokenlogin />
|
||||
<input type=hidden name=hwstate value="{{{hwstate}}}" />
|
||||
<div id=message4>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message4></div>
|
||||
<table>
|
||||
<tr>
|
||||
<td align=right width=100>Login token:</td>
|
||||
|
@ -172,9 +164,7 @@
|
|||
<div id=resettokenpanel style="display:none">
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=resetaccount />
|
||||
<div id=message5>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message5></div>
|
||||
<table>
|
||||
<tr>
|
||||
<td align=right width=100>Login token:</td>
|
||||
|
@ -196,9 +186,7 @@
|
|||
<div id=resetpasswordpanel style="display:none;position:relative">
|
||||
<form method=post>
|
||||
<input type=hidden name=action value=resetpassword />
|
||||
<div id=message6>
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id=message6></div>
|
||||
<div id="rpasswordPolicyCallout" style="display:none"></div>
|
||||
<table>
|
||||
<tr>
|
||||
|
@ -276,6 +264,20 @@
|
|||
var nightMode = (getstore('_nightMode', '0') == '1');
|
||||
var publicKeyCredentialRequestOptions = null;
|
||||
|
||||
// Display the right server message
|
||||
var messageid = parseInt('{{{messageid}}}');
|
||||
var okmessages = ['', "Hold on, reset mail sent."];
|
||||
var failmessages = ["Unable to create account.", "Account limit reached.", "Existing account with this email address.", "Invalid account creation token.", "Username already exists.", "Password rejected, use a different one.", "Invalid email.", "Account not found.", "Invalid token, try again.", "Unable to sent email.", "Account locked.", "Access denied.", "Login failed, check username and password.", "Password change requested."];
|
||||
if (messageid > 0) {
|
||||
var msg = '';
|
||||
if ((messageid < 100) && (messageid < okmessages.length)) { msg = okmessages[messageid]; }
|
||||
else if ((messageid >= 100) && ((messageid - 100) < failmessages.length)) { msg = failmessages[messageid - 100]; }
|
||||
if (msg != '') {
|
||||
if (messageid >= 100) { msg = ('<span class="msg error"><b style=color:#8C001A>' + msg + '<b></span><br /><br />'); } else { msg = ('<span class="msg success"><b>' + msg + '</b></span><br /><br />'); }
|
||||
for (var i = 1; i < 7; i++) { QH('message' + i, msg); }
|
||||
}
|
||||
}
|
||||
|
||||
// If URL arguments are provided, add them to form posts
|
||||
if (window.location.href.indexOf('?') > 0) {
|
||||
var urlargs = window.location.href.substring(window.location.href.indexOf('?'));
|
||||
|
@ -353,9 +355,7 @@
|
|||
QE('tokenOkButton', true);
|
||||
Q('tokenOkButton').click();
|
||||
},
|
||||
function (error) {
|
||||
console.log('credentials-get error', error);
|
||||
}
|
||||
function (error) { console.log('credentials-get error', error); }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -44,9 +44,7 @@
|
|||
<div id="loginpanel" style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;clear:both;display:none">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="login">
|
||||
<div id="message1">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message1"></div>
|
||||
<div>
|
||||
<b>Log In</b>
|
||||
</div>
|
||||
|
@ -78,9 +76,7 @@
|
|||
<div style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;clear:both;position:relative">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="createaccount">
|
||||
<div id="message2">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message2"></div>
|
||||
<div>
|
||||
<b>Account Creation</b>
|
||||
</div>
|
||||
|
@ -125,9 +121,7 @@
|
|||
<div id="resetpanel" style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;display:none;clear:both">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="resetaccount">
|
||||
<div id="message3">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message3"></div>
|
||||
<div>
|
||||
<b>Account Reset</b>
|
||||
</div>
|
||||
|
@ -151,9 +145,7 @@
|
|||
<form method="post" autocomplete="off">
|
||||
<input type="hidden" name="action" value="tokenlogin">
|
||||
<input type="hidden" name="hwstate" value="{{{hwstate}}}">
|
||||
<div id="message4">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message4"></div>
|
||||
<table>
|
||||
<tbody><tr>
|
||||
<td align="right" width="100">Login token:</td>
|
||||
|
@ -176,9 +168,7 @@
|
|||
<div id="resettokenpanel" style="background-color:#979797;border-radius:16px;width:260px;padding:16px;text-align:center;display:none;clear:both">
|
||||
<form method="post" autocomplete="off">
|
||||
<input type="hidden" name="action" value="resetaccount">
|
||||
<div id="message5">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message5"></div>
|
||||
<table>
|
||||
<tbody><tr>
|
||||
<td align="right" width="100">Login token:</td>
|
||||
|
@ -201,9 +191,7 @@
|
|||
<div id="resetpasswordpanel" style="position:relative;background-color:#979797;border-radius:16px;width:300px;padding:16px;text-align:center;display:none">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="resetpassword">
|
||||
<div id="message6">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message6"></div>
|
||||
<div id="rpasswordPolicyCallout" style="left:-10px;width:100px;display:none;position:absolute;background-color:#FFC;border-radius:5px;padding:5px;box-shadow:0px 0px 15px #666;font-size:10px"></div>
|
||||
<table>
|
||||
<tbody><tr>
|
||||
|
@ -277,6 +265,20 @@
|
|||
var hardwareKeyChallenge = decodeURIComponent('{{{hkey}}}');
|
||||
var currentpanel = 0;
|
||||
|
||||
// Display the right server message
|
||||
var messageid = parseInt('{{{messageid}}}');
|
||||
var okmessages = ['', "Hold on, reset mail sent."];
|
||||
var failmessages = ["Unable to create account.", "Account limit reached.", "Existing account with this email address.", "Invalid account creation token.", "Username already exists.", "Password rejected, use a different one.", "Invalid email.", "Account not found.", "Invalid token, try again.", "Unable to sent email.", "Account locked.", "Access denied.", "Login failed, check username and password.", "Password change requested."];
|
||||
if (messageid > 0) {
|
||||
var msg = '';
|
||||
if ((messageid < 100) && (messageid < okmessages.length)) { msg = okmessages[messageid]; }
|
||||
else if ((messageid >= 100) && ((messageid - 100) < failmessages.length)) { msg = failmessages[messageid - 100]; }
|
||||
if (msg != '') {
|
||||
if (messageid >= 100) { msg = ('<span class="msg error"><b style=color:#8C001A>' + msg + '<b></span><br /><br />'); } else { msg = ('<span class="msg success"><b>' + msg + '</b></span><br /><br />'); }
|
||||
for (var i = 1; i < 7; i++) { QH('message' + i, msg); }
|
||||
}
|
||||
}
|
||||
|
||||
// If URL arguments are provided, add them to form posts
|
||||
if (window.location.href.indexOf('?') > 0) {
|
||||
var urlargs = window.location.href.substring(window.location.href.indexOf('?'));
|
||||
|
|
|
@ -41,9 +41,7 @@
|
|||
<div id="loginpanel" style="display:none">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="login">
|
||||
<div id="message1">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message1"></div>
|
||||
<div>
|
||||
<b>Log In</b>
|
||||
</div>
|
||||
|
@ -74,9 +72,7 @@
|
|||
<div id="createpanel" style="display:none;position:relative">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="createaccount">
|
||||
<div id="message2">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message2"></div>
|
||||
<div>
|
||||
<b>Account Creation</b>
|
||||
</div>
|
||||
|
@ -120,9 +116,7 @@
|
|||
<div id="resetpanel" style="display:none">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="resetaccount">
|
||||
<div id="message3">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message3"></div>
|
||||
<div>
|
||||
<b>Account Reset</b>
|
||||
</div>
|
||||
|
@ -146,9 +140,7 @@
|
|||
<form method="post" autocomplete="off">
|
||||
<input type="hidden" name="action" value="tokenlogin">
|
||||
<input type="hidden" name="hwstate" value="{{{hwstate}}}">
|
||||
<div id="message4">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message4"></div>
|
||||
<table>
|
||||
<tbody><tr>
|
||||
<td align="right" width="100">Login token:</td>
|
||||
|
@ -170,9 +162,7 @@
|
|||
<div id="resettokenpanel" style="display:none">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="resetaccount">
|
||||
<div id="message5">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message5"></div>
|
||||
<table>
|
||||
<tbody><tr>
|
||||
<td align="right" width="100">Login token:</td>
|
||||
|
@ -194,9 +184,7 @@
|
|||
<div id="resetpasswordpanel" style="display:none;position:relative">
|
||||
<form method="post">
|
||||
<input type="hidden" name="action" value="resetpassword">
|
||||
<div id="message6">
|
||||
{{{message}}}
|
||||
</div>
|
||||
<div id="message6"></div>
|
||||
<div id="rpasswordPolicyCallout" style="display:none"></div>
|
||||
<table>
|
||||
<tbody><tr>
|
||||
|
@ -274,6 +262,20 @@
|
|||
var nightMode = (getstore('_nightMode', '0') == '1');
|
||||
var publicKeyCredentialRequestOptions = null;
|
||||
|
||||
// Display the right server message
|
||||
var messageid = parseInt('{{{messageid}}}');
|
||||
var okmessages = ['', "Hold on, reset mail sent."];
|
||||
var failmessages = ["Unable to create account.", "Account limit reached.", "Existing account with this email address.", "Invalid account creation token.", "Username already exists.", "Password rejected, use a different one.", "Invalid email.", "Account not found.", "Invalid token, try again.", "Unable to sent email.", "Account locked.", "Access denied.", "Login failed, check username and password.", "Password change requested."];
|
||||
if (messageid > 0) {
|
||||
var msg = '';
|
||||
if ((messageid < 100) && (messageid < okmessages.length)) { msg = okmessages[messageid]; }
|
||||
else if ((messageid >= 100) && ((messageid - 100) < failmessages.length)) { msg = failmessages[messageid - 100]; }
|
||||
if (msg != '') {
|
||||
if (messageid >= 100) { msg = ('<span class="msg error"><b style=color:#8C001A>' + msg + '<b></span><br /><br />'); } else { msg = ('<span class="msg success"><b>' + msg + '</b></span><br /><br />'); }
|
||||
for (var i = 1; i < 7; i++) { QH('message' + i, msg); }
|
||||
}
|
||||
}
|
||||
|
||||
// If URL arguments are provided, add them to form posts
|
||||
if (window.location.href.indexOf('?') > 0) {
|
||||
var urlargs = window.location.href.substring(window.location.href.indexOf('?'));
|
||||
|
@ -351,9 +353,7 @@
|
|||
QE('tokenOkButton', true);
|
||||
Q('tokenOkButton').click();
|
||||
},
|
||||
function (error) {
|
||||
console.log('credentials-get error', error);
|
||||
}
|
||||
function (error) { console.log('credentials-get error', error); }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue