Make sure that you can't delete your own account. (#110)
This commit is contained in:
parent
6d479dabf4
commit
b67813b260
1 changed files with 5 additions and 0 deletions
|
@ -30,6 +30,7 @@ use Hash;
|
||||||
use Validator;
|
use Validator;
|
||||||
use Mail;
|
use Mail;
|
||||||
use Carbon;
|
use Carbon;
|
||||||
|
use Auth;
|
||||||
|
|
||||||
use Pterodactyl\Models;
|
use Pterodactyl\Models;
|
||||||
use Pterodactyl\Services\UuidService;
|
use Pterodactyl\Services\UuidService;
|
||||||
|
@ -152,6 +153,10 @@ class UserRepository
|
||||||
throw new DisplayException('Cannot delete a user with active servers attached to thier account.');
|
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();
|
DB::beginTransaction();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue