mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
User account deletion from user profile
This commit is contained in:
@@ -301,15 +301,14 @@ class ProfileController extends BasePageController
|
||||
$this->setPrefs();
|
||||
$userId = $request->input('id');
|
||||
|
||||
if ($userId !== null && $this->userdata->role->id !== User::ROLE_ADMIN && (int) $userId === Auth::id()) {
|
||||
if ($userId !== null && $this->userdata->hasRole('Admin') === false && (int) $userId === Auth::id()) {
|
||||
Mail::to(Settings::settingValue('site.main.email'))->send(new AccountDeleted($userId));
|
||||
Auth::logout();
|
||||
User::deleteUser($userId);
|
||||
|
||||
return redirect('login');
|
||||
}
|
||||
|
||||
if ($this->userdata->role->id === User::ROLE_ADMIN) {
|
||||
if ($this->userdata->hasRole('Admin')) {
|
||||
return redirect('profile');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user