mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-29 17:53:16 +00:00
Update SettingsController
This commit is contained in:
parent
868a83cb65
commit
251cb72aa4
1 changed files with 23 additions and 1 deletions
|
@ -15,6 +15,7 @@ use App\Http\Controllers\Settings\{
|
|||
PrivacySettings,
|
||||
SecuritySettings
|
||||
};
|
||||
use App\Jobs\DeletePipeline\DeleteAccountPipeline;
|
||||
|
||||
class SettingsController extends Controller
|
||||
{
|
||||
|
@ -43,7 +44,7 @@ class SettingsController extends Controller
|
|||
'optimize_screen_reader',
|
||||
'high_contrast_mode',
|
||||
'video_autoplay',
|
||||
];
|
||||
];
|
||||
foreach ($fields as $field) {
|
||||
$form = $request->input($field);
|
||||
if ($form == 'on') {
|
||||
|
@ -130,5 +131,26 @@ class SettingsController extends Controller
|
|||
{
|
||||
return view('settings.developers');
|
||||
}
|
||||
|
||||
public function removeAccountTemporary(Request $request)
|
||||
{
|
||||
return view('settings.remove.temporary');
|
||||
}
|
||||
|
||||
public function removeAccountPermanent(Request $request)
|
||||
{
|
||||
return view('settings.remove.permanent');
|
||||
}
|
||||
|
||||
public function removeAccountPermanentSubmit(Request $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
if($user->is_admin == true) {
|
||||
return abort(400, 'You cannot delete an admin account.');
|
||||
}
|
||||
DeleteAccountPipeline::dispatch($user);
|
||||
Auth::logout();
|
||||
return redirect('/');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue