Commit Graph

166 Commits

Author SHA1 Message Date
Roardom
0492a9d704 fix: provide banned rss feed when user banned
We can't log them out (which the code would do instead) because rss doesn't have cookies. Provides a similar solution as what's done with the api.
2025-07-23 01:08:52 +00:00
Roardom
48adfce1af fix: group cache
Laravel returns numeric strings when an int is saved to cache, which breaks a lot of the logic here. Fixed by removing cache everywhere except rss and middleware, and in those two spots, caching the whole group and not just the id of the group.
2025-07-19 11:59:00 +00:00
Roardom
9bdbe9764c refactor: cached select group id by slug queries
Uses a better key. Doesn't use the cache when it's not needed.
2025-07-14 18:15:29 +00:00
Roardom
3de7b17381 refactor: swap null coalescing for default model in user settings
Cleans up the code to remove null coalescing on user_settings when it doesn't exist. Sometimes null was unintentionally being cast to false. Allowing the user_setting remain optional allows the site administration to configure and change defaults for their users without it affecting users who have explicitly chosen their existing user settings.

Alternative to #4789
2025-06-20 03:00:48 +00:00
Roardom
005eb62d59 refactor: simplify UpdateLastAction middleware
Removes second return statement.
2025-06-18 04:45:47 +00:00
Roardom
9f1e6f3851 refactor: remove unused middlewares 3
I missed some more from the other times (#4744 and #4749). The json check in Authenticate.php has since been upstreamed into laravel, so we don't need to modify that explicitly anymore and can swap it out for laravel's middleware. The RedirectIfAuthenticated middleware now has an option to set the route to redirect to, so we can call that method directly instead of overwriting the method in the middleware. The TrimStrings middleware also now has an option to exclude certain attributes, so we can call that method directly instead of overwriting the method in the middleware.

TrustProxies.php is the only remaining Laravel middleware that is customized, but that can only be replaced with the laravel 11 app structure.
2025-06-09 04:48:44 +00:00
Roardom
513f81f6f0 refactor: remove unused middlwares 2
I missed some the first time (#4744).
2025-06-07 18:53:17 +00:00
Roardom
51aa570cbf refactor: remove unused middlewares
These middlewares are the same as what exists in laravel. We can directly use Laravel's middlewares in Kernel.php instead of importing them and not overwriting anything.
2025-06-05 05:55:39 +00:00
Roardom
a7159d7c9f add: outbound mail rate limiter 2024-06-27 09:02:47 +00:00
Roardom
d00475778b update: normalize user settings
Use a 1-1 relation. Cache it indefinitely to reduce queries for every http request. This will make it much easier to add additional user settings for various site features without sacrificing clean code or performance.
2024-05-26 10:42:00 +00:00
Roardom
b86475a732 add: strict types to all files 2024-05-23 13:58:29 +00:00
HDVinnie
93b17f0419 chore: license 2024-03-19 17:56:44 -04:00
HDVinnie
46ebbe2632 revert: #3306 2023-12-27 14:02:22 -05:00
Roardom
a33bf6b8c6 add: requests per second metric tracking 2023-12-25 08:49:30 +00:00
HDVinnie
c4b37341a9 fix: #3260 2023-11-20 18:47:09 -05:00
HDVinnie
3f03214e39 PHP Style Change (Laravel Pint CI) 2023-11-07 23:54:38 +00:00
HDVinnie
f4aab26086 remove: email based 2fa 2023-11-06 10:30:18 -05:00
HDVinnie
b37c330572 Merge branch '7.x.x' into Ip-Blocking 2023-11-06 10:04:14 -05:00
HDVinnie
85c7dd0265 update: BlockIpAddress Middleware
Co-authored-by: Roardom <78790963+Roardom@users.noreply.github.com>
2023-09-12 19:25:38 -04:00
HDVinnie
bf5989cd5a remove: Http2ServerPush middleware
- http3 will be released soon and Http2ServerPush will be deprecated.
2023-09-11 19:21:14 -04:00
HDVinnie
0c89b79eab update: ip blocking system 2023-09-11 13:37:54 -04:00
HDVinnie
b387ad6a91 add: ip blocking system 2023-09-10 21:02:35 -04:00
Roardom
372ea1d20c fix: incorrect php doc block type 2023-08-25 02:38:13 +00:00
Roardom
8e1b51a263 fix: batch user last action updates with redis
If there are no users in the list, null is returned, so we have to check against null.

Since we cache users for 30 seconds, checking their last action time is pointless.
2023-07-20 05:02:46 +00:00
Roardom
01ef9e29ff update: batch user last action updates with redis 2023-07-20 01:17:00 +00:00
Roardom
9d4789ba91 refactor: require whitespace before statements 2023-07-07 00:27:13 +00:00
HDVinnie
3e8567376b update: core laravel files 2023-02-22 13:28:31 -05:00
Shift
af180307a6 Add PHP type hints for Laravel 10 2023-02-15 00:30:18 +00:00
Shift
e5a6a09f76 Shift core files 2023-02-15 00:28:10 +00:00
HDVinnie
f4ebee885c update: lint 2023-02-03 22:23:00 -05:00
HDVinnie
3650900c97 update: lint
- not_operator_with_space to false
2023-02-03 16:01:29 -05:00
HDVinnie
472c820f99 update: UNIT3D linting
- github action updated with new ruleset in pint.json
- codebase linted with new ruleset
- contributors can now run `./vendor/bin/pint`
- action workflow will auto correct any lint issues upon commit/opened pull request
2023-02-02 08:02:34 -05:00
HDVinnie
2ca429c4ce Revert "PSR12 Linting"
This reverts commit 7e65e1d589.
2022-09-11 19:51:58 -04:00
HDVinnie
7e65e1d589 PSR12 Linting 2022-09-11 23:50:41 +00:00
HDVinnie
4e5af0cb20 update: banned middleware 2022-08-24 20:24:02 -04:00
HDVinnie
02eea1206c fix: #2152
- closes #2152
2022-08-24 20:15:30 -04:00
StyleCI Bot
e292545306 Apply fixes from StyleCI 2022-05-31 22:06:07 +00:00
Shift
be2d37ed6e Use Illuminate\Support\Carbon 2022-05-31 22:05:34 +00:00
HDVinnie
594b7864d9 refactor: adopt new helpers in laravel 9 2022-03-06 17:20:05 -05:00
HDVinnie
aa15a5a1b5 update: middleware 2022-02-28 05:04:54 -05:00
HDVinnie
bc7873fd86 fix: type hints 2022-02-09 22:18:55 -05:00
StyleCI Bot
2cc3d2b2cb Apply fixes from StyleCI 2022-01-23 22:42:35 +00:00
HDVinnie
00d00024e5 chore: cleanup 2022-01-23 17:42:16 -05:00
Shift
49742aa048 Replace deprecated HEADER_X_FORWARDED_ALL constant 2022-01-19 19:51:13 +00:00
HDVinnie
98521378d2 chore: phpdoc blocks 2022-01-10 17:46:43 -05:00
HDVinnie
77ec35bea5 chore: apply the laravel code style linter 2022-01-08 00:03:12 -05:00
HDVinnie
97394c062f chore: adopt type hints 2022-01-07 23:35:33 -05:00
Apoorv Pal
f994d1fd87 Merge branch 'master' of github.com:apoorvpal01/UNIT3D-Community-Edition 2021-10-21 17:08:20 +05:30
HDVinnie
2a53cea216 refactor: newline after statement 2021-09-28 12:49:46 -04:00
HDVinnie
281eef3a94 update: redirect if authenticated middleware
- convert redirect call to use Laravel’s expressive method chain.
2021-07-12 21:48:40 -04:00