Skip to content
This repository has been archived by the owner on May 7, 2019. It is now read-only.

Commit

Permalink
Fix double redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
TheReverend403 committed Oct 12, 2016
1 parent 0b16283 commit 22e4f4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Account/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function deleteUpload(Request $request, Upload $upload)
$upload->forceDelete();
flash()->success(trans('messages.file_deleted', ['name' => $upload->original_name]));

return redirect()->back();
return redirect()->route('account.uploads');
}

public function postResetKey(Request $request)
Expand Down
14 changes: 7 additions & 7 deletions app/Http/Controllers/Admin/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,35 +47,35 @@ public function postUserBan(User $user)
if ($user->isSuperUser()) {
flash()->error(trans('messages.admin.failed_superuser_action', ['type' => 'ban']));

return redirect()->back();
return redirect()->route('admin.users');
}

$user->fill(['banned' => true])->save();
flash()->success(trans('messages.admin.banned_user', ['name' => $user->name]));

return redirect()->back();
return redirect()->route('admin.users');
}

public function postUserDelete(User $user)
{
if ($user->isSuperUser()) {
flash()->error(trans('messages.admin.failed_superuser_action', ['type' => 'delete']));

return redirect()->back();
return redirect()->route('admin.users');
}

$user->forceDelete();
flash()->success(trans('messages.admin.deleted_user', ['name' => $user->name]));

return redirect()->back();
return redirect()->route('admin.users');
}

public function postUserUnban(User $user)
{
$user->fill(['banned' => false])->save();
flash()->success(trans('messages.admin.unbanned_user', ['name' => $user->name]));

return redirect()->back();
return redirect()->route('admin.users');
}

public function getUploads(Request $request, User $user)
Expand All @@ -99,7 +99,7 @@ public function postUserAccept(User $user)

flash()->success(trans('messages.admin.account_accepted', ['name' => $user->name]));

return redirect()->back();
return redirect()->route('admin.users');
}

public function postUserReject(User $user)
Expand All @@ -112,6 +112,6 @@ public function postUserReject(User $user)
$user->forceDelete();
flash()->success(trans('messages.admin.account_rejected', ['name' => $user->name]));

return redirect()->back();
return redirect()->route('admin.users');
}
}

0 comments on commit 22e4f4f

Please sign in to comment.