diff --git a/routes/api.php b/routes/api.php index 5e6f1c0d..df321638 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,8 +1,8 @@ call( - fn() => resolve(DeleteFailedFilesAction::class)() + fn () => resolve(DeleteFailedFilesAction::class)() )->everySixHours(); } $schedule->call( - fn() => resolve(DeleteExpiredShareLinksAction::class)() + fn () => resolve(DeleteExpiredShareLinksAction::class)() )->everyTenMinutes(); $schedule->call( - fn() => resolve(DeleteUnverifiedUsersAction::class)() + fn () => resolve(DeleteUnverifiedUsersAction::class)() )->daily(); // Run queue jobs every minute diff --git a/src/Domain/Sharing/Actions/ProtectShareRecordAction.php b/src/Domain/Sharing/Actions/ProtectShareRecordAction.php index e9f375ea..716b6ff6 100644 --- a/src/Domain/Sharing/Actions/ProtectShareRecordAction.php +++ b/src/Domain/Sharing/Actions/ProtectShareRecordAction.php @@ -11,7 +11,6 @@ class ProtectShareRecordAction Share $shared ): void { if ($shared->is_protected) { - if (! request()->hasCookie('share_session')) { abort(403, $this->message); } diff --git a/src/Domain/Sharing/Controllers/ShareController.php b/src/Domain/Sharing/Controllers/ShareController.php index 7dbc0075..d5158bcd 100644 --- a/src/Domain/Sharing/Controllers/ShareController.php +++ b/src/Domain/Sharing/Controllers/ShareController.php @@ -1,7 +1,6 @@ user_id; @@ -89,4 +85,4 @@ class ZipAction return $zip; } -} \ No newline at end of file +} diff --git a/src/Domain/Zip/Controllers/VisitorZipController.php b/src/Domain/Zip/Controllers/VisitorZipController.php index 27a89944..0f58bb7f 100644 --- a/src/Domain/Zip/Controllers/VisitorZipController.php +++ b/src/Domain/Zip/Controllers/VisitorZipController.php @@ -1,19 +1,16 @@ protectShareRecord)($shared); @@ -44,7 +41,6 @@ class VisitorZipController extends Controller // Check access to requested files if ($files->isNotEmpty()) { - $file_parent_folders = File::whereUserId($shared->user_id) ->whereIn('id', $files->pluck('id')) ->get() @@ -65,4 +61,4 @@ class VisitorZipController extends Controller return $zip; } -} \ No newline at end of file +} diff --git a/src/Domain/Zip/Controllers/ZipController.php b/src/Domain/Zip/Controllers/ZipController.php index be75b721..d8fb66c0 100644 --- a/src/Domain/Zip/Controllers/ZipController.php +++ b/src/Domain/Zip/Controllers/ZipController.php @@ -1,16 +1,13 @@ get("/api/zip/{$share->token}?items=$files[0]|file,$files[1]|file,$folder->id|folder") ->assertStatus(200) @@ -158,7 +157,7 @@ class SharedZippingTest extends TestCase } // Check public shared item - if (!$is_protected) { + if (! $is_protected) { $this ->get("/api/zip/$share->token?items=$files[0]|file,$files[1]|file") ->assertStatus(403); @@ -229,7 +228,7 @@ class SharedZippingTest extends TestCase } // Check public shared item - if (!$is_protected) { + if (! $is_protected) { $this->getJson("/api/zip/$share->token?items=$children->id|folder") ->assertStatus(200); } @@ -273,7 +272,7 @@ class SharedZippingTest extends TestCase } // Check public shared item - if (!$is_protected) { + if (! $is_protected) { $this->getJson("/api/zip/$share->token?items=$folder->id|folder") ->assertStatus(403); } diff --git a/tests/Domain/Zip/UserZippingTest.php b/tests/Domain/Zip/UserZippingTest.php index b0ab883c..da1eb4a2 100644 --- a/tests/Domain/Zip/UserZippingTest.php +++ b/tests/Domain/Zip/UserZippingTest.php @@ -1,8 +1,6 @@