diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dav/tests/unit/connector/sabre/requesttest/partfileinrootupload.php | 56 | ||||
-rw-r--r-- | apps/files/appinfo/info.xml | 2 | ||||
-rw-r--r-- | apps/files/appinfo/install.php | 22 | ||||
-rw-r--r-- | apps/files/appinfo/update.php | 2 | ||||
-rw-r--r-- | apps/files/js/newfilemenu.js | 2 | ||||
-rw-r--r-- | apps/files/lib/backgroundjob/cleanupfilelocks.php | 57 | ||||
-rw-r--r-- | apps/files_sharing/js/public.js | 6 | ||||
-rw-r--r-- | apps/files_sharing/lib/controllers/sharecontroller.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/grouppropagationmanager.php | 2 | ||||
-rw-r--r-- | apps/files_trashbin/lib/trashbin.php | 2 |
10 files changed, 90 insertions, 63 deletions
diff --git a/apps/dav/tests/unit/connector/sabre/requesttest/partfileinrootupload.php b/apps/dav/tests/unit/connector/sabre/requesttest/partfileinrootupload.php deleted file mode 100644 index 52790c5b00b..00000000000 --- a/apps/dav/tests/unit/connector/sabre/requesttest/partfileinrootupload.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -/** - * @author Robin Appelman <icewind@owncloud.com> - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @copyright Copyright (c) 2016, ownCloud, Inc. - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - -namespace OCA\DAV\Tests\Unit\Connector\Sabre\RequestTest; - -use OC\Files\View; -use Test\Traits\EncryptionTrait; - -/** - * Class EncryptionUploadTest - * - * @group DB - * - * @package OCA\DAV\Tests\Unit\Connector\Sabre\RequestTest - */ -class PartFileInRootUpload extends UploadTest { - protected function setUp() { - $config = \OC::$server->getConfig(); - $mockConfig = $this->getMock('\OCP\IConfig'); - $mockConfig->expects($this->any()) - ->method('getSystemValue') - ->will($this->returnCallback(function ($key, $default) use ($config) { - if ($key === 'part_file_in_storage') { - return false; - } else { - return $config->getSystemValue($key, $default); - } - })); - $this->overwriteService('AllConfig', $mockConfig); - parent::setUp(); - } - - protected function tearDown() { - $this->restoreService('AllConfig'); - return parent::tearDown(); - } -} diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml index a7c3968cb8f..5227b2f044a 100644 --- a/apps/files/appinfo/info.xml +++ b/apps/files/appinfo/info.xml @@ -8,7 +8,7 @@ <shipped>true</shipped> <standalone/> <default_enable/> - <version>1.2.0</version> + <version>1.2.1</version> <types> <filesystem/> </types> diff --git a/apps/files/appinfo/install.php b/apps/files/appinfo/install.php new file mode 100644 index 00000000000..0815ff2524e --- /dev/null +++ b/apps/files/appinfo/install.php @@ -0,0 +1,22 @@ +<?php +/** + * @author Morris Jobke <hey@morrisjobke.de> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +\OC::$server->getJobList()->add('OCA\Files\BackgroundJob\CleanupFileLocks'); diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php index 6084435fa5a..0da6ad04911 100644 --- a/apps/files/appinfo/update.php +++ b/apps/files/appinfo/update.php @@ -104,3 +104,5 @@ if ($installedVersion === '1.1.9' && ( if(defined('DEBUG') && DEBUG === true) { \OC::$server->getConfig()->setSystemValue('debug', true); } + +\OC::$server->getJobList()->add('OCA\Files\BackgroundJob\CleanupFileLocks'); diff --git a/apps/files/js/newfilemenu.js b/apps/files/js/newfilemenu.js index 0a67aba202b..28fda494089 100644 --- a/apps/files/js/newfilemenu.js +++ b/apps/files/js/newfilemenu.js @@ -27,7 +27,7 @@ var TEMPLATE_FILENAME_FORM = '<form class="filenameform">' + '<label class="hidden-visually" for="{{cid}}-input-{{fileType}}">{{fileName}}</label>' + - '<input id="{{cid}}-input-{{fileType}}" type="text" value="{{fileName}}">' + + '<input id="{{cid}}-input-{{fileType}}" type="text" value="{{fileName}}" autocomplete="off" autocapitalize="off" autocorrect="off">' + '</form>'; /** diff --git a/apps/files/lib/backgroundjob/cleanupfilelocks.php b/apps/files/lib/backgroundjob/cleanupfilelocks.php new file mode 100644 index 00000000000..b5cf8e94551 --- /dev/null +++ b/apps/files/lib/backgroundjob/cleanupfilelocks.php @@ -0,0 +1,57 @@ +<?php +/** + * @author Morris Jobke <hey@morrisjobke.de> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCA\Files\BackgroundJob; + +use OC\BackgroundJob\TimedJob; +use OC\Lock\DBLockingProvider; + +/** + * Clean up all file locks that are expired for the DB file locking provider + */ +class CleanupFileLocks extends TimedJob { + + /** + * Default interval in minutes + * + * @var int $defaultIntervalMin + **/ + protected $defaultIntervalMin = 5; + + /** + * sets the correct interval for this timed job + */ + public function __construct() { + $this->interval = $this->defaultIntervalMin * 60; + } + + /** + * Makes the background job do its work + * + * @param array $argument unused argument + */ + public function run($argument) { + $lockingProvider = \OC::$server->getLockingProvider(); + if($lockingProvider instanceof DBLockingProvider) { + $lockingProvider->cleanExpiredLocks(); + } + } +} diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index b684e08be8b..cdeeb598e40 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -142,9 +142,11 @@ OCA.Sharing.PublicApp = { } var path = dir || FileList.getCurrentDirectory(); var params = { - path: path, - files: filename + path: path }; + if (filename) { + params.files = filename; + } return OC.generateUrl('/s/' + token + '/download') + '?' + OC.buildQueryString(params); }; diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php index 4d227e78ff7..220da77cdaf 100644 --- a/apps/files_sharing/lib/controllers/sharecontroller.php +++ b/apps/files_sharing/lib/controllers/sharecontroller.php @@ -304,7 +304,7 @@ class ShareController extends Controller { } // download selected files - if (!is_null($files)) { + if (!is_null($files) && $files !== '') { // FIXME: The exit is required here because otherwise the AppFramework is trying to add headers as well // after dispatching the request which results in a "Cannot modify header information" notice. OC_Files::get($originalSharePath, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD'); diff --git a/apps/files_sharing/tests/grouppropagationmanager.php b/apps/files_sharing/tests/grouppropagationmanager.php index 6fc6ef7a532..2e5ef8f7587 100644 --- a/apps/files_sharing/tests/grouppropagationmanager.php +++ b/apps/files_sharing/tests/grouppropagationmanager.php @@ -73,7 +73,7 @@ class GroupPropagationManagerTest extends TestCase { $userSession = $this->getMockBuilder('\OCP\IUserSession') ->disableOriginalConstructor() ->getMock(); - $userSession->method('getUser')->willReturn(selF::TEST_FILES_SHARING_API_USER1); + $userSession->method('getUser')->willReturn(self::TEST_FILES_SHARING_API_USER1); $this->propagationManager = $this->getMockBuilder('OCA\Files_Sharing\Propagation\PropagationManager') ->disableOriginalConstructor() diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 64f3506b8c9..0d7ad1a423e 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -180,7 +180,7 @@ class Trashbin { $ownerView = new \OC\Files\View('/' . $owner); // file has been deleted in between - if (!$ownerView->file_exists('/files/' . $ownerPath)) { + if (is_null($ownerPath) || $ownerPath === '' || !$ownerView->file_exists('/files/' . $ownerPath)) { return true; } |