diff options
Diffstat (limited to 'core/command/user')
-rw-r--r-- | core/command/user/delete.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/command/user/delete.php b/core/command/user/delete.php index f64b40e4921..d5ec3ee0bde 100644 --- a/core/command/user/delete.php +++ b/core/command/user/delete.php @@ -14,6 +14,17 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputArgument; class Delete extends Command { + /** @var \OC\User\Manager */ + protected $userManager; + + /** + * @param \OC\User\Manager $userManager + */ + public function __construct(\OC\User\Manager $userManager) { + $this->userManager = $userManager; + parent::__construct(); + } + protected function configure() { $this ->setName('user:delete') @@ -26,7 +37,7 @@ class Delete extends Command { } protected function execute(InputInterface $input, OutputInterface $output) { - $wasSuccessful = \OC_User::deleteUser($input->getArgument('uid')); + $wasSuccessful = $this->userManager->get($input->getArgument('uid'))->delete(); if($wasSuccessful === true) { $output->writeln('The specified user was deleted'); return; |