summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-06-26 12:48:19 +0200
committerLukas Reschke <lukas@owncloud.com>2016-06-26 12:48:19 +0200
commitdcb5f0046192c242d274e301c7e462651dcdebe0 (patch)
treea42975dc5602338dd5c361eb3e7907931a8eca36
parentea327cdea1172768816bb79cf920e74e7585348a (diff)
parent907c90165a4d147f8608705df15c6d0d9dbdb335 (diff)
downloadnextcloud-server-dcb5f0046192c242d274e301c7e462651dcdebe0.tar.gz
nextcloud-server-dcb5f0046192c242d274e301c7e462651dcdebe0.zip
Merge remote-tracking branch 'upstream/stable9' into stable9-upstream-sync
-rw-r--r--apps/dav/lib/connector/sabre/filesplugin.php29
-rw-r--r--apps/dav/lib/connector/sabre/serverfactory.php6
-rw-r--r--apps/dav/lib/server.php6
-rw-r--r--apps/dav/tests/unit/connector/sabre/filesplugin.php13
-rw-r--r--apps/dav/tests/unit/connector/sabre/filesreportplugin.php6
-rw-r--r--apps/files_external/controller/globalstoragescontroller.php6
-rw-r--r--apps/files_external/controller/storagescontroller.php11
-rw-r--r--apps/files_external/controller/userglobalstoragescontroller.php11
-rw-r--r--apps/files_external/controller/userstoragescontroller.php10
-rw-r--r--apps/files_external/js/settings.js5
-rw-r--r--apps/files_external/js/statusmanager.js1
-rw-r--r--apps/files_external/lib/config.php4
-rw-r--r--apps/files_external/tests/js/settingsSpec.js3
-rw-r--r--apps/files_sharing/appinfo/application.php3
-rw-r--r--apps/files_sharing/lib/mountprovider.php40
-rw-r--r--apps/files_sharing/lib/sharedmount.php47
-rw-r--r--apps/files_versions/lib/storage.php9
-rw-r--r--apps/user_ldap/lib/access.php9
-rw-r--r--build/integration/features/sharing-v1.feature13
-rw-r--r--build/integration/features/webdav-related.feature4
-rw-r--r--core/js/setupchecks.js6
-rw-r--r--lib/private/app/appmanager.php2
22 files changed, 189 insertions, 55 deletions
diff --git a/apps/dav/lib/connector/sabre/filesplugin.php b/apps/dav/lib/connector/sabre/filesplugin.php
index bf9bee02578..857c98247bd 100644
--- a/apps/dav/lib/connector/sabre/filesplugin.php
+++ b/apps/dav/lib/connector/sabre/filesplugin.php
@@ -77,15 +77,25 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
private $fileView;
/**
+ * @var IRequest
+ */
+ private $request;
+
+ /**
* @param \Sabre\DAV\Tree $tree
* @param \OC\Files\View $view
+ * @param \OCP\IRequest $request
* @param bool $isPublic
*/
- public function __construct(\Sabre\DAV\Tree $tree,
- \OC\Files\View $view,
- $isPublic = false) {
+ public function __construct(
+ \Sabre\DAV\Tree $tree,
+ \OC\Files\View $view,
+ \OCP\IRequest $request,
+ $isPublic = false
+ ) {
$this->tree = $tree;
$this->fileView = $view;
+ $this->request = $request;
$this->isPublic = $isPublic;
}
@@ -193,7 +203,18 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin {
if (!($node instanceof IFile)) return;
// adds a 'Content-Disposition: attachment' header
- $response->addHeader('Content-Disposition', 'attachment');
+ $filename = $node->getName();
+ if ($this->request->isUserAgent(
+ [
+ \OC\AppFramework\Http\Request::USER_AGENT_IE,
+ \OC\AppFramework\Http\Request::USER_AGENT_ANDROID_MOBILE_CHROME,
+ \OC\AppFramework\Http\Request::USER_AGENT_FREEBOX,
+ ])) {
+ $response->addHeader('Content-Disposition', 'attachment; filename="' . rawurlencode($filename) . '"');
+ } else {
+ $response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\'' . rawurlencode($filename)
+ . '; filename="' . rawurlencode($filename) . '"');
+ }
if ($node instanceof \OCA\DAV\Connector\Sabre\File) {
//Add OC-Checksum header
diff --git a/apps/dav/lib/connector/sabre/serverfactory.php b/apps/dav/lib/connector/sabre/serverfactory.php
index c0b45c36a00..8462f624552 100644
--- a/apps/dav/lib/connector/sabre/serverfactory.php
+++ b/apps/dav/lib/connector/sabre/serverfactory.php
@@ -137,7 +137,11 @@ class ServerFactory {
}
$objectTree->init($root, $view, $this->mountManager);
- $server->addPlugin(new \OCA\DAV\Connector\Sabre\FilesPlugin($objectTree, $view));
+ $server->addPlugin(new \OCA\DAV\Connector\Sabre\FilesPlugin(
+ $objectTree,
+ $view,
+ $this->request
+ ));
$server->addPlugin(new \OCA\DAV\Connector\Sabre\QuotaPlugin($view));
if($this->userSession->isLoggedIn()) {
diff --git a/apps/dav/lib/server.php b/apps/dav/lib/server.php
index 4711a80800d..791bd1ba7e8 100644
--- a/apps/dav/lib/server.php
+++ b/apps/dav/lib/server.php
@@ -125,7 +125,11 @@ class Server {
$user = \OC::$server->getUserSession()->getUser();
if (!is_null($user)) {
$view = \OC\Files\Filesystem::getView();
- $this->server->addPlugin(new FilesPlugin($this->server->tree, $view));
+ $this->server->addPlugin(new FilesPlugin(
+ $this->server->tree,
+ $view,
+ $this->request
+ ));
$this->server->addPlugin(
new \Sabre\DAV\PropertyStorage\Plugin(
diff --git a/apps/dav/tests/unit/connector/sabre/filesplugin.php b/apps/dav/tests/unit/connector/sabre/filesplugin.php
index 0a790ec6fc9..ecad56d004d 100644
--- a/apps/dav/tests/unit/connector/sabre/filesplugin.php
+++ b/apps/dav/tests/unit/connector/sabre/filesplugin.php
@@ -72,8 +72,13 @@ class FilesPlugin extends \Test\TestCase {
$this->view = $this->getMockBuilder('\OC\Files\View')
->disableOriginalConstructor()
->getMock();
+ $request = $this->getMock('\OCP\IRequest');
- $this->plugin = new \OCA\DAV\Connector\Sabre\FilesPlugin($this->tree, $this->view);
+ $this->plugin = new \OCA\DAV\Connector\Sabre\FilesPlugin(
+ $this->tree,
+ $this->view,
+ $request
+ );
$this->plugin->initialize($this->server);
}
@@ -237,7 +242,11 @@ class FilesPlugin extends \Test\TestCase {
}
public function testGetPublicPermissions() {
- $this->plugin = new \OCA\DAV\Connector\Sabre\FilesPlugin($this->tree, $this->view, true);
+ $this->plugin = new \OCA\DAV\Connector\Sabre\FilesPlugin(
+ $this->tree,
+ $this->view,
+ $this->getMock('\OCP\IRequest'),
+ true);
$this->plugin->initialize($this->server);
$propFind = new \Sabre\DAV\PropFind(
diff --git a/apps/dav/tests/unit/connector/sabre/filesreportplugin.php b/apps/dav/tests/unit/connector/sabre/filesreportplugin.php
index 87973ef0071..c17cc0f30a3 100644
--- a/apps/dav/tests/unit/connector/sabre/filesreportplugin.php
+++ b/apps/dav/tests/unit/connector/sabre/filesreportplugin.php
@@ -336,7 +336,11 @@ class FilesReportPlugin extends \Test\TestCase {
->method('getSize')
->will($this->returnValue(1024));
- $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\FilesPlugin($this->tree, $this->view));
+ $this->server->addPlugin(new \OCA\DAV\Connector\Sabre\FilesPlugin(
+ $this->tree,
+ $this->view,
+ $this->getMock('\OCP\IRequest')
+ ));
$this->plugin->initialize($this->server);
$responses = $this->plugin->prepareResponses($requestedProps, [$node1, $node2]);
diff --git a/apps/files_external/controller/globalstoragescontroller.php b/apps/files_external/controller/globalstoragescontroller.php
index b443cf4ea8f..dc7e8c0c24c 100644
--- a/apps/files_external/controller/globalstoragescontroller.php
+++ b/apps/files_external/controller/globalstoragescontroller.php
@@ -131,6 +131,7 @@ class GlobalStoragesController extends StoragesController {
* @param array $applicableUsers users for which to mount the storage
* @param array $applicableGroups groups for which to mount the storage
* @param int $priority priority
+ * @param bool $testOnly whether to storage should only test the connection or do more things
*
* @return DataResponse
*/
@@ -143,7 +144,8 @@ class GlobalStoragesController extends StoragesController {
$mountOptions,
$applicableUsers,
$applicableGroups,
- $priority
+ $priority,
+ $testOnly = true
) {
$storage = $this->createStorage(
$mountPoint,
@@ -176,7 +178,7 @@ class GlobalStoragesController extends StoragesController {
);
}
- $this->updateStorageStatus($storage);
+ $this->updateStorageStatus($storage, $testOnly);
return new DataResponse(
$storage,
diff --git a/apps/files_external/controller/storagescontroller.php b/apps/files_external/controller/storagescontroller.php
index 09b83104700..b26e85cc9af 100644
--- a/apps/files_external/controller/storagescontroller.php
+++ b/apps/files_external/controller/storagescontroller.php
@@ -240,8 +240,9 @@ abstract class StoragesController extends Controller {
* on whether the remote storage is available or not.
*
* @param StorageConfig $storage storage configuration
+ * @param bool $testOnly whether to storage should only test the connection or do more things
*/
- protected function updateStorageStatus(StorageConfig &$storage) {
+ protected function updateStorageStatus(StorageConfig &$storage, $testOnly = true) {
try {
$this->manipulateStorageConfig($storage);
@@ -252,7 +253,8 @@ abstract class StoragesController extends Controller {
\OC_Mount_Config::getBackendStatus(
$backend->getStorageClass(),
$storage->getBackendOptions(),
- false
+ false,
+ $testOnly
)
);
} catch (InsufficientDataForMeaningfulAnswerException $e) {
@@ -293,14 +295,15 @@ abstract class StoragesController extends Controller {
* Get an external storage entry.
*
* @param int $id storage id
+ * @param bool $testOnly whether to storage should only test the connection or do more things
*
* @return DataResponse
*/
- public function show($id) {
+ public function show($id, $testOnly = true) {
try {
$storage = $this->service->getStorage($id);
- $this->updateStorageStatus($storage);
+ $this->updateStorageStatus($storage, $testOnly);
} catch (NotFoundException $e) {
return new DataResponse(
[
diff --git a/apps/files_external/controller/userglobalstoragescontroller.php b/apps/files_external/controller/userglobalstoragescontroller.php
index 36c3740eed3..f89022ee468 100644
--- a/apps/files_external/controller/userglobalstoragescontroller.php
+++ b/apps/files_external/controller/userglobalstoragescontroller.php
@@ -106,15 +106,16 @@ class UserGlobalStoragesController extends StoragesController {
* Get an external storage entry.
*
* @param int $id storage id
+ * @param bool $testOnly whether to storage should only test the connection or do more things
* @return DataResponse
*
* @NoAdminRequired
*/
- public function show($id) {
+ public function show($id, $testOnly = true) {
try {
$storage = $this->service->getStorage($id);
- $this->updateStorageStatus($storage);
+ $this->updateStorageStatus($storage, $testOnly);
} catch (NotFoundException $e) {
return new DataResponse(
[
@@ -138,6 +139,7 @@ class UserGlobalStoragesController extends StoragesController {
*
* @param int $id storage id
* @param array $backendOptions backend-specific options
+ * @param bool $testOnly whether to storage should only test the connection or do more things
*
* @return DataResponse
*
@@ -145,7 +147,8 @@ class UserGlobalStoragesController extends StoragesController {
*/
public function update(
$id,
- $backendOptions
+ $backendOptions,
+ $testOnly = true
) {
try {
$storage = $this->service->getStorage($id);
@@ -170,7 +173,7 @@ class UserGlobalStoragesController extends StoragesController {
);
}
- $this->updateStorageStatus($storage);
+ $this->updateStorageStatus($storage, $testOnly);
$this->sanitizeStorage($storage);
return new DataResponse(
diff --git a/apps/files_external/controller/userstoragescontroller.php b/apps/files_external/controller/userstoragescontroller.php
index e53ea21f005..8ab22341225 100644
--- a/apps/files_external/controller/userstoragescontroller.php
+++ b/apps/files_external/controller/userstoragescontroller.php
@@ -104,8 +104,8 @@ class UserStoragesController extends StoragesController {
*
* {@inheritdoc}
*/
- public function show($id) {
- return parent::show($id);
+ public function show($id, $testOnly = true) {
+ return parent::show($id, $testOnly);
}
/**
@@ -162,6 +162,7 @@ class UserStoragesController extends StoragesController {
* @param string $authMechanism authentication mechanism identifier
* @param array $backendOptions backend-specific options
* @param array $mountOptions backend-specific mount options
+ * @param bool $testOnly whether to storage should only test the connection or do more things
*
* @return DataResponse
*
@@ -173,7 +174,8 @@ class UserStoragesController extends StoragesController {
$backend,
$authMechanism,
$backendOptions,
- $mountOptions
+ $mountOptions,
+ $testOnly = true
) {
$storage = $this->createStorage(
$mountPoint,
@@ -203,7 +205,7 @@ class UserStoragesController extends StoragesController {
);
}
- $this->updateStorageStatus($storage);
+ $this->updateStorageStatus($storage, $testOnly);
return new DataResponse(
$storage,
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 0b33458bec2..6262245688b 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -305,7 +305,8 @@ StorageConfig.prototype = {
mountPoint: this.mountPoint,
backend: this.backend,
authMechanism: this.authMechanism,
- backendOptions: this.backendOptions
+ backendOptions: this.backendOptions,
+ testOnly: true
};
if (this.id) {
data.id = this.id;
@@ -332,6 +333,7 @@ StorageConfig.prototype = {
$.ajax({
type: 'GET',
url: OC.generateUrl(this._url + '/{id}', {id: this.id}),
+ data: {'testOnly': true},
success: options.success,
error: options.error
});
@@ -911,6 +913,7 @@ MountConfigListView.prototype = _.extend({
$.ajax({
type: 'GET',
url: OC.generateUrl('apps/files_external/userglobalstorages'),
+ data: {'testOnly': true},
contentType: 'application/json',
success: function(result) {
var onCompletion = jQuery.Deferred();
diff --git a/apps/files_external/js/statusmanager.js b/apps/files_external/js/statusmanager.js
index 33d2ea104be..c51562558cf 100644
--- a/apps/files_external/js/statusmanager.js
+++ b/apps/files_external/js/statusmanager.js
@@ -78,6 +78,7 @@ OCA.External.StatusManager = {
defObj = $.ajax({
type: 'GET',
url: OC.webroot + '/index.php/apps/files_external/' + ((mountData.type === 'personal') ? 'userstorages' : 'userglobalstorages') + '/' + mountData.id,
+ data: {'testOnly': false},
success: function (response) {
if (response && response.status === 0) {
self.mountStatus[mountData.mount_point] = response;
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 70f8550f39b..11a111bd8ff 100644
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -215,7 +215,7 @@ class OC_Mount_Config {
* @return int see self::STATUS_*
* @throws Exception
*/
- public static function getBackendStatus($class, $options, $isPersonal) {
+ public static function getBackendStatus($class, $options, $isPersonal, $testOnly = true) {
if (self::$skipTest) {
return StorageNotAvailableException::STATUS_SUCCESS;
}
@@ -228,7 +228,7 @@ class OC_Mount_Config {
$storage = new $class($options);
try {
- $result = $storage->test($isPersonal);
+ $result = $storage->test($isPersonal, $testOnly);
$storage->setAvailability($result);
if ($result) {
return StorageNotAvailableException::STATUS_SUCCESS;
diff --git a/apps/files_external/tests/js/settingsSpec.js b/apps/files_external/tests/js/settingsSpec.js
index 462407e9540..e4ee7a61aa9 100644
--- a/apps/files_external/tests/js/settingsSpec.js
+++ b/apps/files_external/tests/js/settingsSpec.js
@@ -223,7 +223,8 @@ describe('OCA.External.Settings tests', function() {
applicableGroups: [],
mountOptions: {
'previews': true
- }
+ },
+ testOnly: true
});
// TODO: respond and check data-id
diff --git a/apps/files_sharing/appinfo/application.php b/apps/files_sharing/appinfo/application.php
index 64c7517456d..311250ce195 100644
--- a/apps/files_sharing/appinfo/application.php
+++ b/apps/files_sharing/appinfo/application.php
@@ -111,7 +111,8 @@ class Application extends App {
/** @var \OCP\IServerContainer $server */
$server = $c->query('ServerContainer');
return new MountProvider(
- $server->getConfig()
+ $server->getConfig(),
+ $server->getLogger()
);
});
diff --git a/apps/files_sharing/lib/mountprovider.php b/apps/files_sharing/lib/mountprovider.php
index 4a60e44bb26..b386c6704f9 100644
--- a/apps/files_sharing/lib/mountprovider.php
+++ b/apps/files_sharing/lib/mountprovider.php
@@ -27,6 +27,7 @@ use OC\User\NoUserException;
use OCP\Files\Config\IMountProvider;
use OCP\Files\Storage\IStorageFactory;
use OCP\IConfig;
+use OCP\ILogger;
use OCP\IUser;
class MountProvider implements IMountProvider {
@@ -36,10 +37,17 @@ class MountProvider implements IMountProvider {
protected $config;
/**
+ * @var ILogger
+ */
+ protected $logger;
+
+ /**
* @param \OCP\IConfig $config
+ * @param ILogger $logger
*/
- public function __construct(IConfig $config) {
+ public function __construct(IConfig $config, ILogger $logger) {
$this->config = $config;
+ $this->logger = $logger;
}
@@ -55,19 +63,25 @@ class MountProvider implements IMountProvider {
$shares = array_filter($shares, function ($share) {
return $share['permissions'] > 0;
});
- $shares = array_map(function ($share) use ($user, $storageFactory) {
+ $mounts = [];
+ foreach ($shares as $share) {
+ try {
+ $mounts[] = new SharedMount(
+ '\OC\Files\Storage\Shared',
+ $mounts,
+ [
+ 'share' => $share,
+ 'user' => $user->getUID()
+ ],
+ $storageFactory
+ );
+ } catch (\Exception $e) {
+ $this->logger->logException($e);
+ $this->logger->error('Error while trying to create shared mount');
+ }
+ }
- return new SharedMount(
- '\OC\Files\Storage\Shared',
- '/' . $user->getUID() . '/' . $share['file_target'],
- array(
- 'share' => $share,
- 'user' => $user->getUID()
- ),
- $storageFactory
- );
- }, $shares);
// array_filter removes the null values from the array
- return array_filter($shares);
+ return array_filter($mounts);
}
}
diff --git a/apps/files_sharing/lib/sharedmount.php b/apps/files_sharing/lib/sharedmount.php
index 3a65794b606..8eaf5469646 100644
--- a/apps/files_sharing/lib/sharedmount.php
+++ b/apps/files_sharing/lib/sharedmount.php
@@ -25,6 +25,7 @@
namespace OCA\Files_Sharing;
+use OC\Files\Filesystem;
use OC\Files\Mount\MountPoint;
use OC\Files\Mount\MoveableMount;
use OC\Files\View;
@@ -50,14 +51,14 @@ class SharedMount extends MountPoint implements MoveableMount {
/**
* @param string $storage
- * @param string $mountpoint
+ * @param SharedMount[] $mountpoints
* @param array|null $arguments
* @param \OCP\Files\Storage\IStorageFactory $loader
*/
- public function __construct($storage, $mountpoint, $arguments = null, $loader = null) {
+ public function __construct($storage, array $mountpoints, $arguments = null, $loader = null) {
$this->user = $arguments['user'];
$this->recipientView = new View('/' . $this->user . '/files');
- $newMountPoint = $this->verifyMountPoint($arguments['share']);
+ $newMountPoint = $this->verifyMountPoint($arguments['share'], $mountpoints);
$absMountPoint = '/' . $this->user . '/files' . $newMountPoint;
$arguments['ownerView'] = new View('/' . $arguments['share']['uid_owner'] . '/files');
parent::__construct($storage, $absMountPoint, $arguments, $loader);
@@ -67,9 +68,10 @@ class SharedMount extends MountPoint implements MoveableMount {
* check if the parent folder exists otherwise move the mount point up
*
* @param array $share
+ * @param SharedMount[] $mountpoints
* @return string
*/
- private function verifyMountPoint(&$share) {
+ private function verifyMountPoint(&$share, array $mountpoints) {
$mountPoint = basename($share['file_target']);
$parent = dirname($share['file_target']);
@@ -78,10 +80,10 @@ class SharedMount extends MountPoint implements MoveableMount {
$parent = Helper::getShareFolder($this->recipientView);
}
- $newMountPoint = \OCA\Files_Sharing\Helper::generateUniqueTarget(
+ $newMountPoint = $this->generateUniqueTarget(
\OC\Files\Filesystem::normalizePath($parent . '/' . $mountPoint),
- [],
- $this->recipientView
+ $this->recipientView,
+ $mountpoints
);
if ($newMountPoint !== $share['file_target']) {
@@ -94,6 +96,37 @@ class SharedMount extends MountPoint implements MoveableMount {
}
/**
+ * @param string $path
+ * @param View $view
+ * @param SharedMount[] $mountpoints
+ * @return mixed
+ */
+ private function generateUniqueTarget($path, $view, array $mountpoints) {
+ $pathinfo = pathinfo($path);
+ $ext = (isset($pathinfo['extension'])) ? '.'.$pathinfo['extension'] : '';
+ $name = $pathinfo['filename'];
+ $dir = $pathinfo['dirname'];
+
+ // Helper function to find existing mount points
+ $mountpointExists = function($path) use ($mountpoints) {
+ foreach ($mountpoints as $mountpoint) {
+ if ($mountpoint->getShare()['file_target'] === $path) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ $i = 2;
+ while ($view->file_exists($path) || $mountpointExists($path)) {
+ $path = Filesystem::normalizePath($dir . '/' . $name . ' ('.$i.')' . $ext);
+ $i++;
+ }
+
+ return $path;
+ }
+
+ /**
* update fileTarget in the database if the mount point changed
*
* @param string $newPath
diff --git a/apps/files_versions/lib/storage.php b/apps/files_versions/lib/storage.php
index a1069410e70..1062f49cf69 100644
--- a/apps/files_versions/lib/storage.php
+++ b/apps/files_versions/lib/storage.php
@@ -337,9 +337,16 @@ class Storage {
// Restore encrypted version of the old file for the newly restored file
// This has to happen manually here since the file is manually copied below
$oldVersion = $users_view->getFileInfo($fileToRestore)->getEncryptedVersion();
+ $oldFileInfo = $users_view->getFileInfo($fileToRestore);
$newFileInfo = $files_view->getFileInfo($filename);
$cache = $newFileInfo->getStorage()->getCache();
- $cache->update($newFileInfo->getId(), ['encrypted' => $oldVersion, 'encryptedVersion' => $oldVersion]);
+ $cache->update(
+ $newFileInfo->getId(), [
+ 'encrypted' => $oldVersion,
+ 'encryptedVersion' => $oldVersion,
+ 'size' => $oldFileInfo->getSize()
+ ]
+ );
// rollback
if (self::copyFileContents($users_view, $fileToRestore, 'files' . $filename)) {
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index f92ded64797..dd4aeee3b24 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -730,7 +730,14 @@ class Access extends LDAPUtility implements user\IUserTools {
$user->unmark();
$user = $this->userManager->get($ocName);
}
- $user->processAttributes($userRecord);
+ if ($user !== null) {
+ $user->processAttributes($userRecord);
+ } else {
+ \OC::$server->getLogger()->debug(
+ "The ldap user manager returned null for $ocName",
+ ['app'=>'user_ldap']
+ );
+ }
}
}
diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature
index ba535e83aab..56399eefdb0 100644
--- a/build/integration/features/sharing-v1.feature
+++ b/build/integration/features/sharing-v1.feature
@@ -566,3 +566,16 @@ Feature: sharing
| path | welcome.txt |
| shareType | 3 |
Then share ids should match
+
+ Scenario: unique target names for incomming shares
+ Given user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And user "user0" created a folder "/foo"
+ And user "user1" created a folder "/foo"
+ When file "/foo" of user "user0" is shared with user "user2"
+ And file "/foo" of user "user1" is shared with user "user2"
+ Then user "user2" should see following elements
+ | /foo/ |
+ | /foo%20(2)/ |
+
diff --git a/build/integration/features/webdav-related.feature b/build/integration/features/webdav-related.feature
index 9231fbebbe9..c6d2919db8d 100644
--- a/build/integration/features/webdav-related.feature
+++ b/build/integration/features/webdav-related.feature
@@ -73,7 +73,7 @@ Feature: webdav-related
And As an "admin"
When Downloading file "/welcome.txt"
Then The following headers should be set
- |Content-Disposition|attachment|
+ |Content-Disposition|attachment; filename*=UTF-8''welcome.txt; filename="welcome.txt"|
|Content-Security-Policy|default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *|
|X-Content-Type-Options |nosniff|
|X-Download-Options|noopen|
@@ -88,7 +88,7 @@ Feature: webdav-related
And As an "admin"
When Downloading file "/welcome.txt"
Then The following headers should be set
- |Content-Disposition|attachment|
+ |Content-Disposition|attachment; filename*=UTF-8''welcome.txt; filename="welcome.txt"|
|Content-Security-Policy|default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *|
|X-Content-Type-Options |nosniff|
|X-Download-Options|noopen|
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js
index 72e5c529a38..3b645675f92 100644
--- a/core/js/setupchecks.js
+++ b/core/js/setupchecks.js
@@ -76,7 +76,8 @@
$.ajax({
type: 'PROPFIND',
url: url,
- complete: afterCall
+ complete: afterCall,
+ allowAuthErrors: true
});
return deferred.promise();
},
@@ -209,7 +210,8 @@
$.ajax({
type: 'GET',
url: OC.linkTo('', oc_dataURL+'/htaccesstest.txt?t=' + (new Date()).getTime()),
- complete: afterCall
+ complete: afterCall,
+ allowAuthErrors: true
});
return deferred.promise();
},
diff --git a/lib/private/app/appmanager.php b/lib/private/app/appmanager.php
index fba5bb19f61..608c69dd54a 100644
--- a/lib/private/app/appmanager.php
+++ b/lib/private/app/appmanager.php
@@ -256,7 +256,7 @@ class AppManager implements IAppManager {
}
unset($this->installedAppsCache[$appId]);
$this->appConfig->setValue($appId, 'enabled', 'no');
- $this->dispatcher->dispatch(ManagerEvent::EVENT_APP_ENABLE, new ManagerEvent(
+ $this->dispatcher->dispatch(ManagerEvent::EVENT_APP_DISABLE, new ManagerEvent(
ManagerEvent::EVENT_APP_DISABLE, $appId
));
$this->clearAppsCache();