From f22a4b2d755536dbe07dd55283d5805e7054bb48 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 17 Aug 2019 01:40:53 -0600 Subject: [PATCH 1/9] Update RegisterController, bump min password length from 6 to 8 --- .../Controllers/Auth/RegisterController.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 360dc0c0..efda66a4 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -76,7 +76,7 @@ class RegisterController extends Controller 'name' => 'required|string|max:'.config('pixelfed.max_name_length'), 'username' => $usernameRules, 'email' => 'required|string|email|max:255|unique:users', - 'password' => 'required|string|min:6|confirmed', + 'password' => 'required|string|min:8|confirmed', ]; return Validator::make($data, $rules); @@ -123,14 +123,17 @@ class RegisterController extends Controller */ public function showRegistrationForm() { - $count = User::count(); - $limit = config('pixelfed.max_users'); - if($limit && $limit <= $count) { - $view = 'site.closed-registration'; + if(config('pixelfed.open_registration')) { + $limit = config('pixelfed.max_users'); + if($limit) { + abort_if($limit <= User::count(), 404); + return view('auth.register'); + } else { + return view('auth.register'); + } } else { - $view = config('pixelfed.open_registration') == true ? 'auth.register' : 'site.closed-registration'; + abort(404); } - return view($view); } /** From bd61a921e8eb31dfcf2fadae273ef1c752f70d1f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 17 Aug 2019 01:41:35 -0600 Subject: [PATCH 2/9] Update ProfileSponsorController --- app/Http/Controllers/ProfileSponsorController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ProfileSponsorController.php b/app/Http/Controllers/ProfileSponsorController.php index e0d5f900..99e228d5 100644 --- a/app/Http/Controllers/ProfileSponsorController.php +++ b/app/Http/Controllers/ProfileSponsorController.php @@ -10,7 +10,8 @@ class ProfileSponsorController extends Controller { public function get(Request $request, $id) { - $res = ProfileSponsor::whereProfileId($id)->firstOrFail()->sponsors; - return response($res)->header('Content-Type', 'application/json'); + $profile = ProfileSponsor::whereProfileId($id)->first(); + $res = $profile ? $profile->sponsors : []; + return response()->json($res); } } From 94e444267f436562ba31cf9ac169e674817aa9a0 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 17 Aug 2019 01:42:21 -0600 Subject: [PATCH 3/9] Update PublicApiController --- app/Http/Controllers/PublicApiController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index 245871a8..ba0f7d83 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -269,6 +269,7 @@ class PublicApiController extends Controller 'local', 'reply_count', 'comments_disabled', + 'place_id', 'created_at', 'updated_at' )->where('id', $dir, $id) @@ -299,6 +300,7 @@ class PublicApiController extends Controller 'reply_count', 'comments_disabled', 'created_at', + 'place_id', 'updated_at' )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album']) ->with('profile', 'hashtags', 'mentions') @@ -377,6 +379,7 @@ class PublicApiController extends Controller 'local', 'reply_count', 'comments_disabled', + 'place_id', 'created_at', 'updated_at' )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album']) @@ -405,6 +408,7 @@ class PublicApiController extends Controller 'local', 'reply_count', 'comments_disabled', + 'place_id', 'created_at', 'updated_at' )->whereIn('type', ['photo', 'photo:album', 'video', 'video:album']) @@ -523,7 +527,9 @@ class PublicApiController extends Controller public function relationships(Request $request) { - abort_if(!Auth::check(), 403); + if(!Auth::check()) { + return response()->json([]); + } $this->validate($request, [ 'id' => 'required|array|min:1|max:20', From 57edd32ed161c623468f218751483b89d8a9f882 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 17 Aug 2019 01:44:59 -0600 Subject: [PATCH 4/9] Update Status model, add place relation --- app/Status.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Status.php b/app/Status.php index d0396ebf..a76d6dad 100644 --- a/app/Status.php +++ b/app/Status.php @@ -403,4 +403,9 @@ class Status extends Model return $res[$audience]; } + public function place() + { + return $this->belongsTo(Place::class); + } + } From e43663c93ff2f6e83bbf9d6f14150643aae2f0da Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 17 Aug 2019 01:45:55 -0600 Subject: [PATCH 5/9] Update AP Inbox --- app/Util/ActivityPub/Inbox.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index f378ab58..48a0ab50 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -103,7 +103,7 @@ class Inbox public function actorFirstOrCreate($actorUrl) { - return Helpers::profileFirstOrNew($actorUrl); + return Helpers::profileFetch($actorUrl); } public function handleCreateActivity() From 3d53661b18986d75c27dbaab7d5cf5005e26e09e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 17 Aug 2019 01:46:34 -0600 Subject: [PATCH 6/9] Update Image util --- app/Util/Media/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Util/Media/Image.php b/app/Util/Media/Image.php index feabbd26..ac960f0f 100644 --- a/app/Util/Media/Image.php +++ b/app/Util/Media/Image.php @@ -131,7 +131,7 @@ class Image $quality = config('pixelfed.image_quality'); $img->save($newPath, $quality); - + $img->destroy(); if (!$thumbnail) { $media->orientation = $orientation; } From 22d75629f79dd77a39efc2e8b9421a6c6ea993e5 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 17 Aug 2019 01:47:56 -0600 Subject: [PATCH 7/9] Remove unused svg --- public/img/Macbook__ipad__iphone.svg | 33 ---------------------------- 1 file changed, 33 deletions(-) delete mode 100644 public/img/Macbook__ipad__iphone.svg diff --git a/public/img/Macbook__ipad__iphone.svg b/public/img/Macbook__ipad__iphone.svg deleted file mode 100644 index ea7eec9c..00000000 --- a/public/img/Macbook__ipad__iphone.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - - IPAD 2 - Created with Sketch. - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From cd7ea97500943d6554fa5d16314fb4ab91277591 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 17 Aug 2019 01:48:25 -0600 Subject: [PATCH 8/9] Update register view --- resources/views/auth/register.blade.php | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 9448f8c3..a0fc6506 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -3,26 +3,17 @@ @section('content')
-
-
-
-

A Photo Sharing Experience For Everyone

-
- -
-
-
-
-
+
{{ __('Register a new account') }}
-
+ @csrf
+ @if ($errors->has('name')) @@ -35,6 +26,7 @@
+ @if ($errors->has('username')) @@ -47,6 +39,7 @@
+ @if ($errors->has('email')) @@ -59,6 +52,7 @@
+ @if ($errors->has('password')) @@ -71,9 +65,12 @@
+
+ +

By signing up, you agree to our Terms of Use and Privacy Policy.

@@ -82,7 +79,6 @@
-

By signing up, you agree to our Terms of Use and Privacy Policy.

From 49157894ad3a479dcfaa524132a3ab0af1ed9ab4 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sat, 17 Aug 2019 01:48:47 -0600 Subject: [PATCH 9/9] Update navbar view --- resources/views/layouts/partial/nav.blade.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/views/layouts/partial/nav.blade.php b/resources/views/layouts/partial/nav.blade.php index 6d85a100..fb626fb0 100644 --- a/resources/views/layouts/partial/nav.blade.php +++ b/resources/views/layouts/partial/nav.blade.php @@ -20,9 +20,11 @@ @endauth @guest +