Update SettingsController

This commit is contained in:
Daniel Supernault 2019-02-05 13:59:31 -07:00
parent 326a1b353a
commit 507fbb90c0
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\AccountLog;
use App\Following;
use App\Report;
use App\UserFilter;
use Auth, DB, Cache, Purify;
use Carbon\Carbon;
@ -160,6 +161,7 @@ class SettingsController extends Controller
if(config('pixelfed.account_deletion') == false) {
abort(404);
}
$user = Auth::user();
if($user->is_admin == true) {
return abort(400, 'You cannot delete an admin account.');
@ -175,5 +177,18 @@ class SettingsController extends Controller
Auth::logout();
return redirect('/');
}
public function requestFullExport(Request $request)
{
$user = Auth::user();
return view('settings.export.show');
}
public function reportsHome(Request $request)
{
$profile = Auth::user()->profile;
$reports = Report::whereProfileId($profile->id)->orderByDesc('created_at')->paginate(10);
return view('settings.reports', compact('reports'));
}
}