Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
81761b8
DAV now returns file name with Content-Disposition header
Jun 10, 2016
9e3cf79
Use capped cache for encryption's user access list
Jun 13, 2016
3e846a4
Use an explicit version of sabre/dav to allow caching on the jenkins …
DeepDiver1975 Jun 14, 2016
a0215b1
decrease initial users to load to 50
butonic Jun 7, 2016
ea330df
Allow empty host when installing on oracle via CLI (#25034)
butonic Jun 10, 2016
173f732
Merge pull request #25106 from owncloud/stable9-allow-empty-host-when…
Jun 15, 2016
57d3bb3
Merge pull request #25105 from owncloud/stable9-initial-userloading-w…
Jun 15, 2016
c5a60c3
Merge pull request #25084 from owncloud/stable9-enc-cappedcache-getac…
Jun 15, 2016
a9c98da
Capped cache for cache info in UserMountCache
Jun 15, 2016
3da5d06
Merge pull request #25052 from owncloud/stable9-webdav-download-mimetype
Jun 15, 2016
ffec0f1
Merge pull request #25118 from owncloud/stable9-fs-usermountcache-capped
Jun 16, 2016
2656f68
load authentication apps first
ChristophWurst Jun 15, 2016
416d4c5
fix grouped input fields, make sure they take precedence
jancborchardt Jun 16, 2016
b1e60cc
Merge pull request #25143 from owncloud/stable9-fix-grouped-inputs
Jun 16, 2016
5e17e99
Convert Dropbox Forbidden exception to StorageNotAvailableException
Jun 16, 2016
d55ad77
Merge pull request #25148 from owncloud/stable9-dropbox-catchratelimit
Jun 16, 2016
f429be1
Merge pull request #25137 from owncloud/stable9-backport-25126
Jun 16, 2016
3ac02c9
–emit correct signal when disabling an app
butonic Jun 16, 2016
82384ab
Merge pull request #25149 from owncloud/backport25146
Jun 16, 2016
2ce078e
ownCloud 9.0.3 RC1
Jun 16, 2016
b5d3e87
Remove shares of the root folder (#25138)
Jun 17, 2016
7aa825f
Revert "[stable9] Remove shares of the root folder" (#25157)
Jun 17, 2016
2d7bbf4
Do not recurse link share fetching
rullzer Mar 8, 2016
0e3682d
Capped cache for user config
butonic Jun 17, 2016
a3111e8
Merge pull request #25160 from owncloud/fix-oracle-endless-loop-stable9
Jun 17, 2016
0129437
Make getShareFolder use given view instead of static FS (#25150)
Jun 20, 2016
2f61c29
Delay files_sharing's registerMountProviders
Jun 17, 2016
3e3c17a
Merge pull request #25187 from owncloud/share-app-initorder-stable9
Jun 20, 2016
826654b
Merge pull request #25165 from owncloud/stable9-capped-user-cache
Jun 20, 2016
11c1d39
Fix null pointer exception in user_ldap
butonic Jun 10, 2016
fa9ba64
Catch exceptions while creating shared mounts
icewind1991 Jun 20, 2016
bf7a08f
dd support to know where the storage test comes from (#25166)
jvillafanez Jun 21, 2016
ddd4f36
Merge pull request #25199 from owncloud/shared-mount-catch-9
Jun 21, 2016
54209ab
Merge pull request #25197 from owncloud/fix-npe-in-user-ldap-stable9
Jun 21, 2016
880ff12
Rollback version must also adjust cached size
Jun 22, 2016
3aaa33d
Merge pull request #25228 from owncloud/stable9-enc-revertversionsize
Jun 22, 2016
b6192c3
On mount make sure multiple shares with same target map to unique one…
rullzer Apr 14, 2016
eb8e151
Merge pull request #25248 from owncloud/stable9-unique_targets
Jun 23, 2016
e366ed6
Don't reload page in case of auth errors during setup checks
Jun 23, 2016
907c901
Merge pull request #25256 from owncloud/stable9-setupchecks-preventre…
ChristophWurst Jun 24, 2016
dcb5f00
Merge remote-tracking branch 'upstream/stable9' into stable9-upstream…
LukasReschke Jun 26, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions apps/dav/lib/connector/sabre/filesplugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,26 @@ 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;
}

Expand Down Expand Up @@ -193,7 +203,18 @@ function httpGet(RequestInterface $request, ResponseInterface $response) {
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
Expand Down
6 changes: 5 additions & 1 deletion apps/dav/lib/connector/sabre/serverfactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ public function createServer($baseUri,
}
$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()) {
Expand Down
6 changes: 5 additions & 1 deletion apps/dav/lib/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ public function __construct(IRequest $request, $baseUri) {
$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(
Expand Down
13 changes: 11 additions & 2 deletions apps/dav/tests/unit/connector/sabre/filesplugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,13 @@ public function setUp() {
$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);
}

Expand Down Expand Up @@ -237,7 +242,11 @@ public function testGetPropertiesStorageNotAvailable() {
}

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(
Expand Down
6 changes: 5 additions & 1 deletion apps/dav/tests/unit/connector/sabre/filesreportplugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,11 @@ public function testPrepareResponses() {
->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]);

Expand Down
6 changes: 4 additions & 2 deletions apps/files_external/controller/globalstoragescontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public function create(
* @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
*/
Expand All @@ -143,7 +144,8 @@ public function update(
$mountOptions,
$applicableUsers,
$applicableGroups,
$priority
$priority,
$testOnly = true
) {
$storage = $this->createStorage(
$mountPoint,
Expand Down Expand Up @@ -176,7 +178,7 @@ public function update(
);
}

$this->updateStorageStatus($storage);
$this->updateStorageStatus($storage, $testOnly);

return new DataResponse(
$storage,
Expand Down
11 changes: 7 additions & 4 deletions apps/files_external/controller/storagescontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,9 @@ protected function manipulateStorageConfig(StorageConfig $storage) {
* 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);

Expand All @@ -252,7 +253,8 @@ protected function updateStorageStatus(StorageConfig &$storage) {
\OC_Mount_Config::getBackendStatus(
$backend->getStorageClass(),
$storage->getBackendOptions(),
false
false,
$testOnly
)
);
} catch (InsufficientDataForMeaningfulAnswerException $e) {
Expand Down Expand Up @@ -293,14 +295,15 @@ public function index() {
* 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(
[
Expand Down
11 changes: 7 additions & 4 deletions apps/files_external/controller/userglobalstoragescontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,16 @@ protected function manipulateStorageConfig(StorageConfig $storage) {
* 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(
[
Expand All @@ -138,14 +139,16 @@ public function show($id) {
*
* @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
*
* @NoAdminRequired
*/
public function update(
$id,
$backendOptions
$backendOptions,
$testOnly = true
) {
try {
$storage = $this->service->getStorage($id);
Expand All @@ -170,7 +173,7 @@ public function update(
);
}

$this->updateStorageStatus($storage);
$this->updateStorageStatus($storage, $testOnly);
$this->sanitizeStorage($storage);

return new DataResponse(
Expand Down
10 changes: 6 additions & 4 deletions apps/files_external/controller/userstoragescontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ public function index() {
*
* {@inheritdoc}
*/
public function show($id) {
return parent::show($id);
public function show($id, $testOnly = true) {
return parent::show($id, $testOnly);
}

/**
Expand Down Expand Up @@ -162,6 +162,7 @@ public function create(
* @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
*
Expand All @@ -173,7 +174,8 @@ public function update(
$backend,
$authMechanism,
$backendOptions,
$mountOptions
$mountOptions,
$testOnly = true
) {
$storage = $this->createStorage(
$mountPoint,
Expand Down Expand Up @@ -203,7 +205,7 @@ public function update(
);
}

$this->updateStorageStatus($storage);
$this->updateStorageStatus($storage, $testOnly);

return new DataResponse(
$storage,
Expand Down
5 changes: 4 additions & 1 deletion apps/files_external/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
});
Expand Down Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions apps/files_external/js/statusmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions apps/files_external/lib/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public static function setUserVars($user, $input) {
* @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;
}
Expand All @@ -228,7 +228,7 @@ public static function getBackendStatus($class, $options, $isPersonal) {
$storage = new $class($options);

try {
$result = $storage->test($isPersonal);
$result = $storage->test($isPersonal, $testOnly);
$storage->setAvailability($result);
if ($result) {
return StorageNotAvailableException::STATUS_SUCCESS;
Expand Down
3 changes: 2 additions & 1 deletion apps/files_external/tests/js/settingsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ describe('OCA.External.Settings tests', function() {
applicableGroups: [],
mountOptions: {
'previews': true
}
},
testOnly: true
});

// TODO: respond and check data-id
Expand Down
3 changes: 2 additions & 1 deletion apps/files_sharing/appinfo/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ public function __construct(array $urlParams = array()) {
/** @var \OCP\IServerContainer $server */
$server = $c->query('ServerContainer');
return new MountProvider(
$server->getConfig()
$server->getConfig(),
$server->getLogger()
);
});

Expand Down
Loading