From 4c6b26d0563dcfd28c8969ad65e2d41f79578873 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 15 Jul 2015 14:08:06 +0200 Subject: Lock scanner to the given user --- apps/files/command/scan.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/files/command/scan.php b/apps/files/command/scan.php index 599dc603c7b..99ce64e09cc 100644 --- a/apps/files/command/scan.php +++ b/apps/files/command/scan.php @@ -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 { -- cgit v1.2.3