Make sure that you can't delete your own account. (#110)

This commit is contained in:
Dominic Fitch-Jones 2016-10-02 21:27:25 -04:00 committed by Dane Everitt
parent 6d479dabf4
commit b67813b260

View file

@ -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 {