mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
Update SettingsController
This commit is contained in:
parent
326a1b353a
commit
507fbb90c0
1 changed files with 15 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue