|
|
@ -30,6 +30,7 @@ function userpasslogin(username, password) {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
showmsg(resp.msg, "danger");
|
|
|
|
showmsg(resp.msg, "danger");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$(this).data("uid")
|
|
|
|
}, "json");
|
|
|
|
}, "json");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -50,6 +51,22 @@ function codelogin(code) {
|
|
|
|
}, "json");
|
|
|
|
}, "json");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function doQuickLogin(username, name, uid, pin) {
|
|
|
|
|
|
|
|
$('#pinmodal').modal('hide');
|
|
|
|
|
|
|
|
if (pin) {
|
|
|
|
|
|
|
|
$('#pinmodal').data("username", username);
|
|
|
|
|
|
|
|
$('#pinmodal').data("name", name);
|
|
|
|
|
|
|
|
$('#pinmodal').data("uid", uid);
|
|
|
|
|
|
|
|
$('#pinmodal').modal('show');
|
|
|
|
|
|
|
|
$('#pincode-box').val("");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
setuser(username);
|
|
|
|
|
|
|
|
setname(name);
|
|
|
|
|
|
|
|
setuid(uid);
|
|
|
|
|
|
|
|
openScreen("home");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function loadQuickLogin() {
|
|
|
|
function loadQuickLogin() {
|
|
|
|
if (!isNaN(group) && group != "") {
|
|
|
|
if (!isNaN(group) && group != "") {
|
|
|
|
$.post(accounthubapi, {
|
|
|
|
$.post(accounthubapi, {
|
|
|
@ -62,7 +79,7 @@ function loadQuickLogin() {
|
|
|
|
var userhtml = "";
|
|
|
|
var userhtml = "";
|
|
|
|
for (var user in resp.users) {
|
|
|
|
for (var user in resp.users) {
|
|
|
|
var u = resp.users[user];
|
|
|
|
var u = resp.users[user];
|
|
|
|
userhtml += '<div class="col-4 col-lg-3 quick-user" data-uid="' + u["uid"] + '" data-username="' + u["username"] + '" data-name="' + u["name"] + '">\n'
|
|
|
|
userhtml += '<div class="col-4 col-lg-3 quick-user" data-uid="' + u["uid"] + '" data-username="' + u["username"] + '" data-name="' + u["name"] + '" data-pin="' + (u["pin"] == true ? "1" : "") + '" >\n'
|
|
|
|
+ '<i class="far fa-user fa-3x"></i>\n'
|
|
|
|
+ '<i class="far fa-user fa-3x"></i>\n'
|
|
|
|
+ '<br />\n'
|
|
|
|
+ '<br />\n'
|
|
|
|
+ u["name"] + "\n"
|
|
|
|
+ u["name"] + "\n"
|
|
|
@ -70,10 +87,7 @@ function loadQuickLogin() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#userlist .row").html(userhtml);
|
|
|
|
$("#userlist .row").html(userhtml);
|
|
|
|
$(".quick-user").click(function () {
|
|
|
|
$(".quick-user").click(function () {
|
|
|
|
setuser($(this).data("username"));
|
|
|
|
doQuickLogin($(this).data("username"), $(this).data("name"), $(this).data("uid"), $(this).data("pin") == "1");
|
|
|
|
setname($(this).data("name"));
|
|
|
|
|
|
|
|
setuid($(this).data("uid"));
|
|
|
|
|
|
|
|
openScreen("home");
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$("#quickaccess_tab").tab("dispose");
|
|
|
|
$("#quickaccess_tab").tab("dispose");
|
|
|
@ -104,6 +118,52 @@ $("#mobilecode_form").submit(function (event) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function tryPinModalLogin(pin) {
|
|
|
|
|
|
|
|
$.post(accounthubapi, {
|
|
|
|
|
|
|
|
key: apikey,
|
|
|
|
|
|
|
|
pin: pin,
|
|
|
|
|
|
|
|
uid: $('#pinmodal').data("uid"),
|
|
|
|
|
|
|
|
action: "checkpin"
|
|
|
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
|
|
|
if (resp.pinvalid === true || resp.nopinset === true) {
|
|
|
|
|
|
|
|
doQuickLogin($('#pinmodal').data("username"), $('#pinmodal').data("name"), $('#pinmodal').data("uid"), false);
|
|
|
|
|
|
|
|
} else if (resp.pinvalid === false) {
|
|
|
|
|
|
|
|
showmsg("PIN incorrect.", "danger");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
showmsg(resp.msg, "danger");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}, "json");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
|
|
|
var dials = $("#pinpad .digits");
|
|
|
|
|
|
|
|
var index;
|
|
|
|
|
|
|
|
var number = $("#pincode-box");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dials.click(function () {
|
|
|
|
|
|
|
|
index = dials.index(this);
|
|
|
|
|
|
|
|
if (index === 9) {
|
|
|
|
|
|
|
|
number.val("");
|
|
|
|
|
|
|
|
} else if (index === 10) {
|
|
|
|
|
|
|
|
number.val(number.val() + "0");
|
|
|
|
|
|
|
|
} else if (index === 11) {
|
|
|
|
|
|
|
|
tryPinModalLogin(number.val());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
number.val(number.val() + (index + 1));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
number.keypress(function (event) {
|
|
|
|
|
|
|
|
// Handle pressing Enter key
|
|
|
|
|
|
|
|
if (event.keyCode === 13) {
|
|
|
|
|
|
|
|
tryPinModalLogin(number.val());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
loadQuickLogin();
|
|
|
|
loadQuickLogin();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#pinmodal').on('shown.bs.modal', function () {
|
|
|
|
|
|
|
|
$('#pincode-box').trigger('focus');
|
|
|
|
|
|
|
|
})
|