Skip to content
Snippets Groups Projects
Commit a5016cfe authored by Vincent Petry's avatar Vincent Petry
Browse files

Merge pull request #17659 from owncloud/files-scan-user-path

Lock scanner to the given user
parents e46ec4a6 23d1cf26
No related branches found
No related tags found
No related merge requests found
......@@ -92,10 +92,10 @@ class Scan extends Command {
}
protected function execute(InputInterface $input, OutputInterface $output) {
$path = $input->getOption('path');
if ($path) {
$path = '/'.trim($path, '/');
list (, $user, ) = explode('/', $path, 3);
$inputPath = $input->getOption('path');
if ($inputPath) {
$inputPath = '/' . trim($inputPath, '/');
list (, $user,) = explode('/', $inputPath, 3);
$users = array($user);
} else if ($input->getOption('all')) {
$users = $this->userManager->search('');
......@@ -114,6 +114,7 @@ class Scan extends Command {
if (is_object($user)) {
$user = $user->getUID();
}
$path = $inputPath ? $inputPath : '/' . $user;
if ($this->userManager->userExists($user)) {
$this->scanFiles($user, $path, $quiet, $output);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment