fix force2fa for files and groupactions #6247 #6246

Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
si458 2024-07-10 15:33:39 +01:00
parent 721c909158
commit ee0018e4d1
3 changed files with 3540 additions and 3520 deletions

File diff suppressed because it is too large Load Diff

View File

@ -2261,7 +2261,11 @@
if (idtype == 'mesh') { gotoMesh(id); }
if (idtype == 'account') { go(3); }
if (idtype == 'devices') { go(2); }
if (idtype == 'files') { go(5); }
if (idtype == 'files') {
// Remind the user to add two factor authentication
if ((features & 0x00040000) && !((userinfo.otpsecret == 1) || (userinfo.otphkeys > 0) || (userinfo.otpkeys > 0) || ((features & 0x00800000) && (userinfo.otpekey == 1)))) { setDialogMode(2, "Account Security", 1, null, "Unable to access this feature until two-factor authentication is enabled. This is required for extra security. Go to the \"My Account\" and look at the \"Account Security\" section."); return; }
go(5);
}
}
function updateFooterMenu(options) {
@ -2635,6 +2639,8 @@
}
function gotoMesh(meshid) {
// Remind the user to add two factor authentication
if ((features & 0x00040000) && !((userinfo.otpsecret == 1) || (userinfo.otphkeys > 0) || (userinfo.otpkeys > 0) || ((features & 0x00800000) && (userinfo.otpekey == 1)))) { setDialogMode(2, "Account Security", 1, null, "Unable to access this feature until two-factor authentication is enabled. This is required for extra security. Go to the \"My Account\" and look at the \"Account Security\" section."); return; }
currentMesh = meshes[meshid];
if (currentMesh == null) { goBack(); }
p20updateMesh();

View File

@ -5797,6 +5797,9 @@
function groupActionFunction() {
var addedOptions = [], nodeids = getCheckedDevices(), added = 0;
// Remind the user to add two factor authentication
if ((features & 0x00040000) && (count2factoraAuths() == 0)) { setDialogMode(2, "Account Security", 1, null, "Unable to access this feature until two-factor authentication is enabled. This is required for extra security. Go to the \"My Account\" tab and look at the \"Account Security\" section."); return; }
// Check if any of the selected devices have a MQTT connection active
if (features & 0x00400000) {
for (var i in nodeids) { if ((getNodeFromId(nodeids[i]).conn & 16) != 0) { addedOptions.push({ v:103, name: "Send MQTT Message" });; break; } }