mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 02:44:45 +02:00
Make sure that you can't delete your own account. (#110)
This commit is contained in:
parent
6d479dabf4
commit
b67813b260
@ -30,6 +30,7 @@ use Hash;
|
||||
use Validator;
|
||||
use Mail;
|
||||
use Carbon;
|
||||
use Auth;
|
||||
|
||||
use Pterodactyl\Models;
|
||||
use Pterodactyl\Services\UuidService;
|
||||
@ -152,6 +153,10 @@ class UserRepository
|
||||
throw new DisplayException('Cannot delete a user with active servers attached to thier account.');
|
||||
}
|
||||
|
||||
if(Auth::user()->id === $id) {
|
||||
throw new DisplayException('Cannot delete your own account.');
|
||||
}
|
||||
|
||||
DB::beginTransaction();
|
||||
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user