214 Commits

Author SHA1 Message Date
Roardom
72a1e1a885 refactor: rename warnings/bans/notes <-> user/staff relations
These relations are older than the laravel convention for using camel case. Clean up their names to match modern styling and make them easier to read.
2025-11-08 10:23:22 +00:00
Jay
1d3b052b21 Updates from code review
Co-authored-by: Roardom <roardom@protonmail.com>
2025-11-01 12:19:38 +00:00
Jay Sizzla
fb31f889d3 Add reports assigning 2025-11-01 12:19:38 +00:00
Roardom
8b27413fe8 refactor: make laravel eloquent models final
We never plan to extend a model, and value composition over inheritance. We need to add the AllowDynamicProperties warning to prevent PHPStan errors that arise with pivot relations (https://www.github.com/larastan/larastan/issues/2256).
2025-10-29 10:19:39 +00:00
Roardom
3988eaaf70 update: model phpdocs
- `use` the relation types
- Use sentence case
- Write better summaries similar to laravel's documentation (don't just repeat the type and the model)
2025-09-20 01:35:37 +00:00
HDVinnie
a1e45a4dca add: ability to hide adult content
- closes #4866
- closes #4867
2025-09-17 14:35:00 -04:00
HDVinnie
170f704d0c add: user homepage block ordering
- closes #4791
- uses alpinejs drag and drop function
- renames visible columns for better consistency
- eager loads user settings for block performance
2025-07-15 18:04:18 -04:00
HDVinnie
3f5b275df4 Merge pull request #4801 from Roardom/two-factor-timeline
(Update) Require 24 hours after enabling 2fa before inviting
2025-06-26 11:46:16 -04:00
Roardom
da7a606d3a update: require 24 (configurable) hours after enabling 2fa before inviting
Previous (less secure) behavior can be restored by setting the config value to 0.
2025-06-23 06:33:03 +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
0d92098d6f refactor: replace users.active with users.email_verified_at
This is the correct column intended to be used by the Laravel framework. `active` seems to be a custom column that was implemented in UNIT3D before Laravel added email verification in version 5.7.
2025-06-11 06:07:56 +00:00
Roardom
cead2c21a7 fix: ci from phpstan update 2025-05-21 17:10:28 +00:00
Roardom
c9e58f6f56 add: playlist suggestions
Allow other users to suggest torrents to add to other users' playlists.
2025-04-15 11:41:22 +00:00
HDVinnie
8fff964cea Merge pull request #4515 from Roardom/phpstan-fixes
(Fix) Phpstan fixes
2025-03-04 21:48:57 -05:00
Roardom
ad8b0da80b fix: phpstan property.phpDoctype
Larastan uses a different doctype for these properties
2025-03-02 07:11:25 +00:00
Roardom
b87638e1c2 fix: allow User model instantiation with new User(['id' => $id])
We use this syntax for sending notifications without requerying the database. Also, we don't use $request->all() for anything user-related anymore so we should be safe to allow all attributes to be mass filled.
2025-02-26 19:18:01 +00:00
HDVinnie
bc25ffa3be Merge pull request #4465 from Roardom/bbcode-blade-directive 2025-02-13 08:12:37 -05:00
Roardom
6a103cee97 refactor: use laravel notifications for system user private messages 2025-02-02 18:48:27 +00:00
Roardom
047f10be36 add: bbcode and linkify blade directives
Also add escaping content inside joypixels blade directive where necessary.
2025-02-01 16:15:34 +00:00
Roardom
ad716d7cc3 update: remove XSS cleaner and remove XSS vulnerabilities
We've been mostly relying on the 3rd party xss cleaner to make sure user submitted content is clean. This PR fixes up any leftover holes in the bbcode parser that allow xss vulnerabilities, and as a result, the 3rd party library isn't needed anymore. It cleans responsibly by first, running `htmlspecialchars()` over the content, followed by sanitizing the untrusted urls and whitelisting their protocol.
2025-01-20 02:52:42 +00:00
Roardom
ff5e30295a add: staff-configurable events with daily prizes 2024-10-15 08:20:13 +00:00
Roardom
3878bb85d7 update: add indexes to audits to speed up staff activity counts
Speeds up the queries from 1.1 s to 75 ms.
2024-09-27 07:39:25 +00:00
HDVinnie
428bf63910 add: base donation system 2024-09-12 13:03:38 -04:00
Roardom
8ae95f9713 fix: system users not included in conversation
We need to include system users in the conversation, even if they are soft deleted in cron job, that way they show up in the private message list
2024-08-28 05:15:13 +00:00
Roardom
5f28892153 add: password reset history logging 2024-08-17 15:05:47 +00:00
Roardom
872d28d9c0 fix: larastan relations 2024-08-09 07:33:56 +00:00
HDVinnie
7469a11ea1 add: #4006
- closes #4006
2024-07-28 21:18:09 -04:00
HDVinnie
3ad3bb992b PHP Style Change (Laravel Pint CI) 2024-07-19 03:43:14 +00:00
HDVinnie
8ad0097fc9 fix: HasFactory types 2024-07-18 23:42:13 -04:00
Roardom
62799be78a fix: cache null values for user settings/notifications/privacy relations 2024-07-06 07:49:47 +00:00
Roardom
8c08356fe1 fix: send system messages from system instead of user 2024-07-02 21:08:54 +00:00
HDVinnie
9182121ce7 Merge pull request #3937 from HDInnovations/PHPStan-Errors
(Fix) PHPStan Errors
2024-06-23 13:25:06 -04:00
HDVinnie
eddad86406 fix: phpstan errors
- this commit tackles more phpstan errors from the baseline.
- the 2024_06_19_210338_update_colum_types.php migration will have more added to it. This PR is draft until more baaseline errors are closed.
2024-06-19 21:19:02 -04:00
HDVinnie
c4cd52e23b fix: multiple bugs
- adds laravel 11 casts support to phpstan https://github.com/larastan/larastan/blob/2.x/UPGRADE.md#upgrading-to-296-from-295
- fixes multiple bugs found by phpstan
- removes dead code in torrent filter trait
- ignores three new files in phpstan.neon temp until debugged for timeouts
2024-06-19 13:43:59 -04:00
Roardom
c33376608b fix: properly remove receiver_id column from private_messages 2024-06-19 09:41:05 +00:00
Roardom
8b9b038701 fix: conversation creation
Should use `sender_id`, not `user_id`. Also need to create conversations for all non-system pms.
2024-06-15 01:55:03 +00:00
Roardom
cdb063d8e0 add: private message threads 2024-06-07 20:47:36 +00:00
Roardom
0e0fc3524f refactor: modularize system notifications and prevent replies 2024-06-07 14:08:23 +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
683ba9077a remove: unused columns on users table 2024-05-26 04:40:57 +00:00
Roardom
12903f64ac fix: strict type issues
Don't pass null into functions that don't accept null.
2024-05-23 17:40:16 +00:00
Roardom
b1873bfa27 fix: decimal docblocks
MySQL decimal column type is casted to PHP string type by default. Let's also make sure it only has 2 decimal places while we're at it.
2024-05-23 15:46:31 +00:00
Roardom
2e57262e97 fix: strict types phpstan errors 2024-05-23 15:38:35 +00:00
Roardom
b86475a732 add: strict types to all files 2024-05-23 13:58:29 +00:00
HDVinnie
51fa8ec46b update: laravel
- Laravel 11 introduces a new default application structure with fewer default files. Namely, new Laravel applications contain fewer service providers, middleware, and configuration files.

However, it is not recommend that Laravel 10 applications upgrading to Laravel 11 attempt to migrate their application structure, as Laravel 11 has been carefully tuned to also support the Laravel 10 application structure.
2024-04-23 16:06:37 -04:00
Roardom
98c32a38f3 update: remove request bon transactions
This data is already stored in the requests and bounty tables. At this point, the name and comment fields are duplicates of each other and don't need to both be kept.
2024-02-26 09:33:33 +00:00
Roardom
a37f414145 update: normalize post tips and torrent tips 2024-02-26 09:33:32 +00:00
Roardom
537ad1e831 refactor: normalize user gifts 2024-02-26 09:33:08 +00:00
Roardom
580da7022d refactor: rename permissions to forum_permissions 2024-02-25 00:19:04 +00:00
Roardom
c3c95c2d41 update: allow users to be part of multiple internal groups 2024-02-23 23:57:12 +00:00