Merge branch 'develop' of https://github.com/Pterodactyl/Panel into develop

This commit is contained in:
Dane Everitt 2017-09-10 23:45:33 -05:00
commit 97d87ff57c
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
11 changed files with 217 additions and 52 deletions

View file

@ -25,7 +25,8 @@
namespace Pterodactyl\Console\Commands;
use Illuminate\Console\Command;
use Pterodactyl\Repositories\oldUserRepository;
use Pterodactyl\Repositories\UserRepository;
use Pterodactyl\Services\Users\UserCreationService;
class MakeUser extends Command
{
@ -49,12 +50,20 @@ class MakeUser extends Command
*/
protected $description = 'Create a user within the panel.';
/**
* @var \Pterodactyl\Services\Users\UserCreationService
*/
protected $creationService;
/**
* Create a new command instance.
*/
public function __construct()
public function __construct(
UserCreationService $creationService
)
{
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');
try {
$user = new oldUserRepository;
$user->create($data);
$this->creationService->handle($data);
return $this->info('User successfully created.');
} catch (\Exception $ex) {