summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-07-15 14:08:06 +0200
committerRobin Appelman <icewind@owncloud.com>2015-11-30 17:01:52 +0100
commit5d7bd6f6ad4d77132857739a02087a9d93e64c6b (patch)
tree3be25945b01d1e02c4c54f79dca5ec9ce7b40ec0
parent64ae79a9d9e1a76a221f15986956ae93d593d3d8 (diff)
downloadnextcloud-server-5d7bd6f6ad4d77132857739a02087a9d93e64c6b.tar.gz
nextcloud-server-5d7bd6f6ad4d77132857739a02087a9d93e64c6b.zip
Lock scanner to the given user
-rw-r--r--apps/files/command/scan.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/files/command/scan.php b/apps/files/command/scan.php
index 87f799a0187..9a453f16fe5 100644
--- a/apps/files/command/scan.php
+++ b/apps/files/command/scan.php
@@ -76,10 +76,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('');
@@ -98,6 +98,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 {