Skip to content

Commit

Permalink
Added functionality to batch disable 2FA
Browse files Browse the repository at this point in the history
For multiple users at once
  • Loading branch information
Moc committed Aug 30, 2021
1 parent 65f3a0a commit 05608fa
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
23 changes: 23 additions & 0 deletions admin_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,29 @@ public function init()
$user_id = key($_POST['disable_tfa']);
$this->disableTfa($user_id);
}

if($this->getAction() == "list")
{
$this->batchOptions = array(
'disabletfa' => LAN_2FA_DISABLE_BATCH,
);
}
}

public function handleListDisabletfaBatch($arr)
{
if(empty($arr))
{
return null;
}

$arr = e107::getParser()->filter($arr, 'int');

//print_a($arr);
foreach($arr as $key => $userID)
{
$this->disableTfa($userID);
}
}

function disableTfa($user_id)
Expand Down
2 changes: 2 additions & 0 deletions languages/English/English_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
define("LAN_2FA_DISABLE_SUCCESS", "Two Factor Authentication has been disabled for User ID [x]");
define("LAN_2FA_DISABLE_ERROR", "Could not disable Two Factor Authentication for User ID [x]");

define("LAN_2FA_DISABLE_BATCH", "Disable Two Factor Authentication for selected users");

// Help
define("LAN_2FA_HELP_MANAGE", "The table on right right shows every user who has activated Two Factor Authentication on their account.");
define("LAN_2FA_HELP_DISABLE1", "As an admin, you can disable Two Factor Authentication for each user by clicking the cross icon.");
Expand Down

0 comments on commit 05608fa

Please sign in to comment.