Skip to content

Commit b67813b

Browse files
Dominic Fitch-JonesDaneEveritt
authored andcommitted
Make sure that you can't delete your own account. (pterodactyl#110)
1 parent 6d479da commit b67813b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/Repositories/UserRepository.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use Validator;
3131
use Mail;
3232
use Carbon;
33+
use Auth;
3334

3435
use Pterodactyl\Models;
3536
use Pterodactyl\Services\UuidService;
@@ -152,6 +153,10 @@ public function delete($id)
152153
throw new DisplayException('Cannot delete a user with active servers attached to thier account.');
153154
}
154155

156+
if(Auth::user()->id === $id) {
157+
throw new DisplayException('Cannot delete your own account.');
158+
}
159+
155160
DB::beginTransaction();
156161

157162
try {

0 commit comments

Comments
 (0)