mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Allow admins to disable 2FA for users
This commit is contained in:
6
post.php
6
post.php
@@ -148,6 +148,7 @@ if(isset($_POST['edit_user'])){
|
||||
$role = intval($_POST['role']);
|
||||
$existing_file_name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['existing_file_name'])));
|
||||
$extended_log_description = '';
|
||||
$two_fa = $_POST['2fa'];
|
||||
|
||||
if(!file_exists("uploads/users/$user_id/")) {
|
||||
mkdir("uploads/users/$user_id");
|
||||
@@ -211,6 +212,11 @@ if(isset($_POST['edit_user'])){
|
||||
$extended_log_description .= ", password changed";
|
||||
}
|
||||
|
||||
if(!empty($two_fa) && $two_fa == 'disable'){
|
||||
mysqli_query($mysqli, "UPDATE users SET user_token = '' WHERE user_id = '$user_id'");
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'User', log_action = 'Modify', log_description = '$session_name disabled 2FA for $name', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_created_at = NOW(), log_user_id = $session_user_id, company_id = $session_company_id");
|
||||
}
|
||||
|
||||
//Update User Settings
|
||||
mysqli_query($mysqli,"UPDATE user_settings SET user_role = $role, user_default_company = $default_company WHERE user_id = $user_id");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user