mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-25 15:55:22 +00:00
Update controllers, fixes #2906
This commit is contained in:
parent
a1d7586be4
commit
ac6b3f07de
4 changed files with 18 additions and 18 deletions
|
@ -15,10 +15,13 @@ use App\Jobs\ImportPipeline\ImportInstagram;
|
||||||
|
|
||||||
trait Instagram
|
trait Instagram
|
||||||
{
|
{
|
||||||
public function instagram()
|
public function instagram()
|
||||||
{
|
{
|
||||||
return view('settings.import.instagram.home');
|
if(config_cache('pixelfed.import.instagram.enabled') != true) {
|
||||||
}
|
abort(404, 'Feature not enabled');
|
||||||
|
}
|
||||||
|
return view('settings.import.instagram.home');
|
||||||
|
}
|
||||||
|
|
||||||
public function instagramStart(Request $request)
|
public function instagramStart(Request $request)
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,8 +6,11 @@ use Illuminate\Http\Request;
|
||||||
|
|
||||||
trait Mastodon
|
trait Mastodon
|
||||||
{
|
{
|
||||||
public function mastodon()
|
public function mastodon()
|
||||||
{
|
{
|
||||||
return view('settings.import.mastodon.home');
|
if(config_cache('pixelfed.import.instagram.enabled') != true) {
|
||||||
}
|
abort(404, 'Feature not enabled');
|
||||||
|
}
|
||||||
|
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