mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-17 13:53:45 +02:00
Return a 404 if attempting to delete a user that does not exist; closes #503
This commit is contained in:
@@ -151,6 +151,8 @@ class UserRepository
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$user = Models\User::findOrFail($id);
|
||||
|
||||
if (Models\Server::where('owner_id', $id)->count() > 0) {
|
||||
throw new DisplayException('Cannot delete a user with active servers attached to thier account.');
|
||||
}
|
||||
@@ -170,7 +172,7 @@ class UserRepository
|
||||
$subuser->delete();
|
||||
}
|
||||
|
||||
Models\User::destroy($id);
|
||||
$user->delete();
|
||||
DB::commit();
|
||||
} catch (\Exception $ex) {
|
||||
DB::rollBack();
|
||||
|
||||
Reference in New Issue
Block a user