mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13: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,
|
PrivacySettings,
|
||||||
SecuritySettings
|
SecuritySettings
|
||||||
};
|
};
|
||||||
|
use App\Jobs\DeletePipeline\DeleteAccountPipeline;
|
||||||
|
|
||||||
class SettingsController extends Controller
|
class SettingsController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -130,5 +131,26 @@ class SettingsController extends Controller
|
||||||
{
|
{
|
||||||
return view('settings.developers');
|
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