mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
More work on SMS integration, added Plivo support.
This commit is contained in:
parent
2b6925205f
commit
cefd6c98b3
8 changed files with 1877 additions and 1630 deletions
|
@ -163,6 +163,7 @@
|
|||
<div style=float:right>
|
||||
<input style="display:none;float:right" id=securityKeyButton type=button value="Use Security Key" onclick="useSecurityKey()" />
|
||||
<input style="display:none;float:right" id=emailKeyButton type=button value="Email" onclick="useEmailToken()" />
|
||||
<input style="display:none;float:right" id=smsKeyButton type=button value="SMS" onclick="useSMSToken()" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -299,10 +300,11 @@
|
|||
var nightMode = (getstore('_nightMode', '0') == '1');
|
||||
var publicKeyCredentialRequestOptions = null;
|
||||
var otpemail = ('{{{otpemail}}}' === 'true');
|
||||
var otpsms = ('{{{otpsms}}}' === 'true');
|
||||
|
||||
// Display the right server message
|
||||
var messageid = parseInt('{{{messageid}}}');
|
||||
var okmessages = ['', "Hold on, reset mail sent.", "Email sent.", "Email verification required, check your mailbox and click the confirmation link."];
|
||||
var okmessages = ['', "Hold on, reset mail sent.", "Email sent.", "Email verification required, check your mailbox and click the confirmation link.", "SMS 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.", "IP address blocked, try again later."];
|
||||
if (messageid > 0) {
|
||||
var msg = '';
|
||||
|
@ -380,6 +382,7 @@
|
|||
try { if (hardwareKeyChallenge.length > 0) { hardwareKeyChallenge = JSON.parse(hardwareKeyChallenge); } else { hardwareKeyChallenge = null; } } catch (ex) { hardwareKeyChallenge = null }
|
||||
QV('securityKeyButton', (hardwareKeyChallenge != null) && (hardwareKeyChallenge.type == 'webAuthn'));
|
||||
QV('emailKeyButton', otpemail && (messageid != 2));
|
||||
QV('smsKeyButton', otpsms && (messageid != 2));
|
||||
}
|
||||
|
||||
if (loginMode == '5') {
|
||||
|
@ -459,6 +462,17 @@
|
|||
Q('tokenOkButton').click();
|
||||
}
|
||||
|
||||
function useSMSToken() {
|
||||
if (otpsms != true) return;
|
||||
setDialogMode(1, "Secure Login", 3, useSMSTokenEx, "Send token to registed phone number?");
|
||||
}
|
||||
|
||||
function useSMSTokenEx() {
|
||||
Q('hwtokenInput').value = '**sms**';
|
||||
QE('tokenOkButton', true);
|
||||
Q('tokenOkButton').click();
|
||||
}
|
||||
|
||||
function showPassHint(e) {
|
||||
messagebox("Password Hint", passhint);
|
||||
haltEvent(e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue