Update SettingsController

pull/780/head
Daniel Supernault 6 years ago
parent 326a1b353a
commit 507fbb90c0
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7

@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\AccountLog; use App\AccountLog;
use App\Following; use App\Following;
use App\Report;
use App\UserFilter; use App\UserFilter;
use Auth, DB, Cache, Purify; use Auth, DB, Cache, Purify;
use Carbon\Carbon; use Carbon\Carbon;
@ -160,6 +161,7 @@ class SettingsController extends Controller
if(config('pixelfed.account_deletion') == false) { if(config('pixelfed.account_deletion') == false) {
abort(404); abort(404);
} }
$user = Auth::user(); $user = Auth::user();
if($user->is_admin == true) { if($user->is_admin == true) {
return abort(400, 'You cannot delete an admin account.'); return abort(400, 'You cannot delete an admin account.');
@ -175,5 +177,18 @@ class SettingsController extends Controller
Auth::logout(); Auth::logout();
return redirect('/'); 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'));
}
} }

Loading…
Cancel
Save