mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update controllers, fixes #2906
This commit is contained in:
parent
a1d7586be4
commit
ac6b3f07de
4 changed files with 18 additions and 18 deletions
|
@ -17,6 +17,9 @@ trait Instagram
|
||||||
{
|
{
|
||||||
public function instagram()
|
public function instagram()
|
||||||
{
|
{
|
||||||
|
if(config_cache('pixelfed.import.instagram.enabled') != true) {
|
||||||
|
abort(404, 'Feature not enabled');
|
||||||
|
}
|
||||||
return view('settings.import.instagram.home');
|
return view('settings.import.instagram.home');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,9 @@ trait Mastodon
|
||||||
{
|
{
|
||||||
public function mastodon()
|
public function mastodon()
|
||||||
{
|
{
|
||||||
|
if(config_cache('pixelfed.import.instagram.enabled') != true) {
|
||||||
|
abort(404, 'Feature not enabled');
|
||||||
|
}
|
||||||
return view('settings.import.mastodon.home');
|
return view('settings.import.mastodon.home');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,10 +11,6 @@ class ImportController extends Controller
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->middleware('auth');
|
$this->middleware('auth');
|
||||||
|
|
||||||
if(config_cache('pixelfed.import.instagram.enabled') != true) {
|
|
||||||
abort(404, 'Feature not enabled');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,14 +11,10 @@ use App\Services\FollowerService;
|
||||||
|
|
||||||
class PollController extends Controller
|
class PollController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct()
|
|
||||||
{
|
|
||||||
abort_if(!config_cache('instance.polls.enabled'), 404);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getPoll(Request $request, $id)
|
public function getPoll(Request $request, $id)
|
||||||
{
|
{
|
||||||
|
abort_if(!config_cache('instance.polls.enabled'), 404);
|
||||||
|
|
||||||
$poll = Poll::findOrFail($id);
|
$poll = Poll::findOrFail($id);
|
||||||
$status = Status::findOrFail($poll->status_id);
|
$status = Status::findOrFail($poll->status_id);
|
||||||
if($status->scope != 'public') {
|
if($status->scope != 'public') {
|
||||||
|
@ -34,6 +30,8 @@ class PollController extends Controller
|
||||||
|
|
||||||
public function vote(Request $request, $id)
|
public function vote(Request $request, $id)
|
||||||
{
|
{
|
||||||
|
abort_if(!config_cache('instance.polls.enabled'), 404);
|
||||||
|
|
||||||
abort_unless($request->user(), 403);
|
abort_unless($request->user(), 403);
|
||||||
|
|
||||||
$this->validate($request, [
|
$this->validate($request, [
|
||||||
|
|
Loading…
Reference in a new issue