From eaf9332096eee5c694784f163fe41a2cc14cdc84 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 17 Jan 2023 17:21:03 -0800 Subject: [PATCH] Added filterability to 2FA fields Signed-off-by: snipe --- app/Http/Controllers/Api/UsersController.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 9348b04b57..c5f334fc31 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -149,6 +149,14 @@ class UsersController extends Controller $users = $users->where('remote', '=', $request->input('remote')); } + if ($request->filled('two_factor_enrolled')) { + $users = $users->where('two_factor_enrolled', '=', $request->input('two_factor_enrolled')); + } + + if ($request->filled('two_factor_optin')) { + $users = $users->where('two_factor_optin', '=', $request->input('two_factor_optin')); + } + if ($request->filled('start_date')) { $users = $users->where('users.start_date', '=', $request->input('start_date')); } @@ -157,7 +165,6 @@ class UsersController extends Controller $users = $users->where('users.end_date', '=', $request->input('end_date')); } - if ($request->filled('assets_count')) { $users->has('assets', '=', $request->input('assets_count')); }