Skip to content

Commit

Permalink
validate if user actually exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Rello authored Nov 24, 2016
1 parent 9e91e51 commit 15cc76d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 6 additions & 2 deletions command/reset.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ protected function execute(InputInterface $input, OutputInterface $output) {
if (is_object($user)) {
$user = $user->getUID();
}
$output->writeln("<info>Reset library for $user</info>");
$this->reset->resetMediaLibrary($user, $output);
if ($this->userManager->userExists($user)) {
$output->writeln("<info>Reset library for $user</info>");
$this->reset->resetMediaLibrary($user, $output);
} else {
$output->writeln("<error>Unknown user $user</error>");
}
}
}

Expand Down
10 changes: 6 additions & 4 deletions command/scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,12 @@ protected function execute(InputInterface $input, OutputInterface $output) {
if (is_object($user)) {
$user = $user->getUID();
}
$output->writeln("");
$output->writeln("");
$output->writeln("<info>Start scan for $user</info>");
$this->scanner->scanForAudios($user, $output, $input->getOption('debug'));
if ($this->userManager->userExists($user)) {
$output->writeln("<info>Start scan for $user</info>");
$this->scanner->scanForAudios($user, $output, $input->getOption('debug'));
} else {
$output->writeln("<error>Unknown user $user</error>");
}
}
}
}

0 comments on commit 15cc76d

Please sign in to comment.