mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 16:24:29 +00:00
Update UserInviteController, fixes #3017
This commit is contained in:
parent
78b2650f3a
commit
b8e9056ee3
1 changed files with 3 additions and 5 deletions
|
@ -9,19 +9,16 @@ use Illuminate\Support\Str;
|
||||||
|
|
||||||
class UserInviteController extends Controller
|
class UserInviteController extends Controller
|
||||||
{
|
{
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
abort_if(!config('pixelfed.user_invites.enabled'), 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function create(Request $request)
|
public function create(Request $request)
|
||||||
{
|
{
|
||||||
|
abort_if(!config('pixelfed.user_invites.enabled'), 404);
|
||||||
abort_unless(Auth::check(), 403);
|
abort_unless(Auth::check(), 403);
|
||||||
return view('settings.invites.create');
|
return view('settings.invites.create');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show(Request $request)
|
public function show(Request $request)
|
||||||
{
|
{
|
||||||
|
abort_if(!config('pixelfed.user_invites.enabled'), 404);
|
||||||
abort_unless(Auth::check(), 403);
|
abort_unless(Auth::check(), 403);
|
||||||
$invites = UserInvite::whereUserId(Auth::id())->paginate(10);
|
$invites = UserInvite::whereUserId(Auth::id())->paginate(10);
|
||||||
$limit = config('pixelfed.user_invites.limit.total');
|
$limit = config('pixelfed.user_invites.limit.total');
|
||||||
|
@ -31,6 +28,7 @@ class UserInviteController extends Controller
|
||||||
|
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
|
abort_if(!config('pixelfed.user_invites.enabled'), 404);
|
||||||
abort_unless(Auth::check(), 403);
|
abort_unless(Auth::check(), 403);
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
'email' => 'required|email|unique:users|unique:user_invites',
|
'email' => 'required|email|unique:users|unique:user_invites',
|
||||||
|
|
Loading…
Reference in a new issue