2017-08-26 18:31:18 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Pterodactyl\Services\Subusers;
|
|
|
|
|
2017-09-25 03:28:16 +00:00
|
|
|
use Pterodactyl\Models\Subuser;
|
2017-08-26 18:31:18 +00:00
|
|
|
use Pterodactyl\Contracts\Repository\SubuserRepositoryInterface;
|
|
|
|
|
|
|
|
class SubuserDeletionService
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var \Pterodactyl\Contracts\Repository\SubuserRepositoryInterface
|
|
|
|
*/
|
2017-11-03 21:52:18 +00:00
|
|
|
private $repository;
|
2017-08-26 18:31:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* SubuserDeletionService constructor.
|
|
|
|
*
|
2017-09-25 02:12:30 +00:00
|
|
|
* @param \Pterodactyl\Contracts\Repository\SubuserRepositoryInterface $repository
|
2017-08-26 18:31:18 +00:00
|
|
|
*/
|
|
|
|
public function __construct(
|
2017-09-25 02:12:30 +00:00
|
|
|
SubuserRepositoryInterface $repository
|
2017-08-26 18:31:18 +00:00
|
|
|
) {
|
|
|
|
$this->repository = $repository;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delete a subuser and their associated permissions from the Panel and Daemon.
|
|
|
|
*
|
2017-10-28 02:42:53 +00:00
|
|
|
* @param \Pterodactyl\Models\Subuser $subuser
|
2017-08-26 18:31:18 +00:00
|
|
|
*/
|
2017-10-28 02:42:53 +00:00
|
|
|
public function handle(Subuser $subuser)
|
2017-08-26 18:31:18 +00:00
|
|
|
{
|
2017-09-25 02:12:30 +00:00
|
|
|
$this->repository->delete($subuser->id);
|
2017-08-26 18:31:18 +00:00
|
|
|
}
|
|
|
|
}
|