From f8a21bdb2dfbe6985d97c5cad369be2f6bf033b6 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 5 Jan 2024 11:59:31 +0000 Subject: [PATCH 1/2] Moved limit and offset to after additional qualifiers Signed-off-by: snipe --- app/Http/Controllers/Api/UsersController.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Api/UsersController.php b/app/Http/Controllers/Api/UsersController.php index 671c8aafee..3eb7783e3d 100644 --- a/app/Http/Controllers/Api/UsersController.php +++ b/app/Http/Controllers/Api/UsersController.php @@ -192,11 +192,6 @@ class UsersController extends Controller $order = $request->input('order') === 'asc' ? 'asc' : 'desc'; - // Make sure the offset and limit are actually integers and do not exceed system limits - $offset = ($request->input('offset') > $users->count()) ? $users->count() : app('api_offset_value'); - $limit = app('api_limit_value'); - - switch ($request->input('sort')) { case 'manager': $users = $users->OrderManager($order); @@ -273,7 +268,17 @@ class UsersController extends Controller } $users = Company::scopeCompanyables($users); - + + + // Make sure the offset and limit are actually integers and do not exceed system limits + $offset = ($request->input('offset') > $users->count()) ? $users->count() : app('api_offset_value'); + $limit = app('api_limit_value'); + + \Log::debug('Requested offset: '. $request->input('offset')); + \Log::debug('App offset: '. app('api_offset_value')); + \Log::debug('Actual offset: '. $offset); + \Log::debug('Limit: '. $limit); + $total = $users->count(); $users = $users->skip($offset)->take($limit)->get(); From 7c5d29ccd9ccfe6ee8a8a19ecea1cc2ff14eeeb9 Mon Sep 17 00:00:00 2001 From: snipe Date: Fri, 5 Jan 2024 14:56:34 +0000 Subject: [PATCH 2/2] Move Google Login prompt higher, made it bigger Signed-off-by: snipe --- public/css/build/app.css | Bin 23442 -> 23903 bytes public/css/build/overrides.css | Bin 16592 -> 17053 bytes public/css/dist/all.css | Bin 514716 -> 515638 bytes public/mix-manifest.json | 6 +++--- resources/assets/less/overrides.less | 30 +++++++++++++++++++++++++- resources/lang/en-US/auth/general.php | 2 +- resources/lang/en-US/general.php | 1 + resources/views/auth/login.blade.php | 18 ++++++++++------ 8 files changed, 46 insertions(+), 11 deletions(-) diff --git a/public/css/build/app.css b/public/css/build/app.css index ad6e6539cfcd55cba9abe080b384fdd32972cc39..23a455db61fbb91d9778643129efad780ced902d 100644 GIT binary patch delta 429 zcmZvY!Ait15Qf=nz`G|I@UU8JSH&XD9=&+hqo=f;wt+M$$&}q9vd^IV9^y^#WqcKr z>aJ8gB!_?g`Tn1Id7piL%-)_KHj5}?{=q$V!U{4L91RK`tRyu+xF(Pqs6l9DSt?B6 zrneR~sR4}kU+=Jld>Adt)ZW~Q8X@m#%+UkC}TMsXK8korAzkY6LtZd=U5qw zXA@0S9tk14FrKc7!+ahhLIVyL+wS0K^Dj;tI^o!MG@S0xBc~PCA0f7~ZanNfxlFPB Q(`2&x+u&zYVKrG~UzGKZ3IG5A delta 11 Scmcb=i*eF+#tjpr8My!BvKu!}$czd!T&GJAWSy?@+n7D2%Lg9mJc6=W

J&OyNveQwO&~Q;g;2{p zR~W%vYb|P09T@Gu)?p55H(Hb_y}1!3LfX>E%}lHO9DjVM9Ih&~7%>PIEOPhz+9w8( zOV=pTaVQk7mtGJ`mO7M#wd0WaRJ8#?7!H`JZ&&?Bc7)*l{PSymo)5naVt P{}=t+;5VtTm;~7tq1cO4 delta 11 ScmbQ+%6OrXal?5BMlJvyiUdFa diff --git a/public/css/dist/all.css b/public/css/dist/all.css index cf1f1c6ca03c807d575fb20a5e8ae90f6488df49..53e604b8a841f8fea3b7af65bdd6757e78ffbd27 100644 GIT binary patch delta 721 zcmbQUReswZ`Gyw87N!>F7M2#)7Pc+yzeDTwwY0c^SRpvIAh9U1B)>?ZxTG>CwOFA% zvm`^IB(l}%Le!<^6sMMFq!y*>aVco&bLkax!L6;HF8G>FWV+BxHu34H z8mwZ|kBG2~>L=&tppl4*7nu}%^isHnylGGxF wYAywZ+{7ZFmvwVe(@Lxq5E`co#F7M2#)7Pc+yzeA@R7P5 'Remember Me', 'username_help_top' => 'Enter your username to be emailed a password reset link.', 'username_help_bottom' => 'Your username and email address may be the same, but may not be, depending on your configuration. If you cannot remember your username, contact your administrator.

Usernames without an associated email address will not be emailed a password reset link. ', - 'google_login' => 'Or login with Google Workspace', + 'google_login' => 'Login with Google Workspace', 'google_login_failed' => 'Google Login failed, please try again.', ]; diff --git a/resources/lang/en-US/general.php b/resources/lang/en-US/general.php index 5e1ad742e3..ec2c9c121a 100644 --- a/resources/lang/en-US/general.php +++ b/resources/lang/en-US/general.php @@ -499,5 +499,6 @@ return [ 'action_permission_generic' => 'You do not have permission to :action this :item_type', 'edit' => 'edit', 'action_source' => 'Action Source', + 'or' => 'or', ]; diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index bd91170b7d..16c67ff2b9 100755 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -17,6 +17,18 @@

+ @if (($snipeSettings->google_login=='1') && ($snipeSettings->google_client_id!='') && ($snipeSettings->google_client_secret!='')) + +

+ + + {{ trans('auth/general.google_login') }} + + +
{{ strtoupper(trans('general.or')) }}
+ @endif + +