fix pterodactyl:user command
This commit is contained in:
parent
7222754580
commit
73d153cacb
|
@ -25,7 +25,8 @@
|
||||||
namespace Pterodactyl\Console\Commands;
|
namespace Pterodactyl\Console\Commands;
|
||||||
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Pterodactyl\Repositories\oldUserRepository;
|
use Pterodactyl\Repositories\UserRepository;
|
||||||
|
use Pterodactyl\Services\Users\UserCreationService;
|
||||||
|
|
||||||
class MakeUser extends Command
|
class MakeUser extends Command
|
||||||
{
|
{
|
||||||
|
@ -49,12 +50,20 @@ class MakeUser extends Command
|
||||||
*/
|
*/
|
||||||
protected $description = 'Create a user within the panel.';
|
protected $description = 'Create a user within the panel.';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \Pterodactyl\Services\Users\UserCreationService
|
||||||
|
*/
|
||||||
|
protected $creationService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new command instance.
|
* Create a new command instance.
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct(
|
||||||
|
UserCreationService $creationService
|
||||||
|
)
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
$this->creationService = $creationService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -78,8 +87,8 @@ class MakeUser extends Command
|
||||||
$data['root_admin'] = is_null($this->option('admin')) ? $this->confirm('Is this user a root administrator?') : $this->option('admin');
|
$data['root_admin'] = is_null($this->option('admin')) ? $this->confirm('Is this user a root administrator?') : $this->option('admin');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$user = new oldUserRepository;
|
|
||||||
$user->create($data);
|
$this->creationService->handle($data);
|
||||||
|
|
||||||
return $this->info('User successfully created.');
|
return $this->info('User successfully created.');
|
||||||
} catch (\Exception $ex) {
|
} catch (\Exception $ex) {
|
||||||
|
|
Loading…
Reference in New Issue