diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-07-15 16:17:24 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-07-15 16:17:24 +0200 |
commit | a5016cfee8ee7dd6ac642063edb09152c5820c2a (patch) | |
tree | 96bb38a67f1feac288c65e57670664b579c0e35a | |
parent | e46ec4a6b6fd48cf7684daa1e2d6b266162600c6 (diff) | |
parent | 23d1cf26b9c0e40c6259e8c8f139a609ad4dbc04 (diff) | |
download | nextcloud-server-a5016cfee8ee7dd6ac642063edb09152c5820c2a.tar.gz nextcloud-server-a5016cfee8ee7dd6ac642063edb09152c5820c2a.zip |
Merge pull request #17659 from owncloud/files-scan-user-path
Lock scanner to the given user
-rw-r--r-- | apps/files/command/scan.php | 9 |
1 files 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 { |