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); } /** 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); } } 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', 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); + } + } 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() 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; } 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 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.

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 +