diff options
Diffstat (limited to 'apps')
60 files changed, 657 insertions, 365 deletions
diff --git a/apps/admin_audit/lib/actions/trashbin.php b/apps/admin_audit/lib/actions/trashbin.php index fd7869b1b22..b04bd6b8f61 100644 --- a/apps/admin_audit/lib/actions/trashbin.php +++ b/apps/admin_audit/lib/actions/trashbin.php @@ -25,9 +25,6 @@ namespace OCA\Admin_Audit\Actions; -use OCP\ILogger; -use OCP\IUserSession; - class Trashbin extends Action { public function delete($params) { diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php index c99689619d8..84ec8433a83 100644 --- a/apps/dav/lib/CalDAV/CalDavBackend.php +++ b/apps/dav/lib/CalDAV/CalDavBackend.php @@ -152,7 +152,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription $query->andWhere($query->expr()->neq('uri', $query->createNamedParameter(BirthdayService::BIRTHDAY_CALENDAR_URI))); } - return $query->execute()->fetchColumn(); + return (int)$query->execute()->fetchColumn(); } /** diff --git a/apps/dav/lib/CardDAV/CardDavBackend.php b/apps/dav/lib/CardDAV/CardDavBackend.php index 48e3b04b38b..b8491c08ff6 100644 --- a/apps/dav/lib/CardDAV/CardDavBackend.php +++ b/apps/dav/lib/CardDAV/CardDavBackend.php @@ -111,7 +111,7 @@ class CardDavBackend implements BackendInterface, SyncSupport { ->from('addressbooks') ->where($query->expr()->eq('principaluri', $query->createNamedParameter($principalUri))); - return $query->execute()->fetchColumn(); + return (int)$query->execute()->fetchColumn(); } /** diff --git a/apps/dav/lib/CardDAV/ImageExportPlugin.php b/apps/dav/lib/CardDAV/ImageExportPlugin.php index 31e8ed6a5e5..e48410d26d6 100644 --- a/apps/dav/lib/CardDAV/ImageExportPlugin.php +++ b/apps/dav/lib/CardDAV/ImageExportPlugin.php @@ -87,6 +87,7 @@ class ImageExportPlugin extends ServerPlugin { if ($result = $this->getPhoto($node)) { $response->setHeader('Content-Type', $result['Content-Type']); + $response->setHeader('Content-Disposition', 'attachment'); $response->setStatus(200); $response->setBody($result['body']); @@ -121,6 +122,17 @@ class ImageExportPlugin extends ServerPlugin { } $val = file_get_contents($val); } + + $allowedContentTypes = [ + 'image/png', + 'image/jpeg', + 'image/gif', + ]; + + if(!in_array($type, $allowedContentTypes, true)) { + $type = 'application/octet-stream'; + } + return [ 'Content-Type' => $type, 'body' => $val diff --git a/apps/dav/lib/Files/BrowserErrorPagePlugin.php b/apps/dav/lib/Files/BrowserErrorPagePlugin.php index 8c257b324b9..b58ce4df874 100644 --- a/apps/dav/lib/Files/BrowserErrorPagePlugin.php +++ b/apps/dav/lib/Files/BrowserErrorPagePlugin.php @@ -31,7 +31,6 @@ use Sabre\DAV\Server; use Sabre\DAV\ServerPlugin; class BrowserErrorPagePlugin extends ServerPlugin { - /** @var Server */ private $server; @@ -88,8 +87,7 @@ class BrowserErrorPagePlugin extends ServerPlugin { /** * @codeCoverageIgnore - * @param \Exception $ex - * @param int $httpCode + * @param \Exception $exception * @return bool|string */ public function generateBody(\Exception $exception) { @@ -109,10 +107,11 @@ class BrowserErrorPagePlugin extends ServerPlugin { return $content->fetchPage(); } - /* + /** * @codeCoverageIgnore */ public function sendResponse() { $this->server->sapi->sendResponse($this->server->httpResponse); + exit(); } } diff --git a/apps/dav/lib/Upload/AssemblyStream.php b/apps/dav/lib/Upload/AssemblyStream.php index 5853adfa77b..3a18f91677d 100644 --- a/apps/dav/lib/Upload/AssemblyStream.php +++ b/apps/dav/lib/Upload/AssemblyStream.php @@ -50,6 +50,9 @@ class AssemblyStream implements \Icewind\Streams\File { /** @var int */ private $size; + /** @var resource */ + private $currentStream = null; + /** * @param string $path * @param string $mode @@ -102,16 +105,36 @@ class AssemblyStream implements \Icewind\Streams\File { * @return string */ public function stream_read($count) { + do { + if ($this->currentStream === null) { + list($node, $posInNode) = $this->getNodeForPosition($this->pos); + if (is_null($node)) { + // reached last node, no more data + return ''; + } + $this->currentStream = $this->getStream($node); + fseek($this->currentStream, $posInNode); + } - list($node, $posInNode) = $this->getNodeForPosition($this->pos); - if (is_null($node)) { - return null; - } - $stream = $this->getStream($node); + $data = fread($this->currentStream, $count); + // isset is faster than strlen + if (isset($data[$count - 1])) { + // we read the full count + $read = $count; + } else { + // reaching end of stream, which happens less often so strlen is ok + $read = strlen($data); + } - fseek($stream, $posInNode); - $data = fread($stream, $count); - $read = strlen($data); + if (feof($this->currentStream)) { + fclose($this->currentStream); + $this->currentNode = null; + $this->currentStream = null; + } + // if no data read, try again with the next node because + // returning empty data can make the caller think there is no more + // data left to read + } while ($read === 0); // update position $this->pos += $read; diff --git a/apps/dav/templates/exception.php b/apps/dav/templates/exception.php index ff3d1f3d20d..c4abd205bfc 100644 --- a/apps/dav/templates/exception.php +++ b/apps/dav/templates/exception.php @@ -1,7 +1,5 @@ <?php /** - - * * @author Thomas Müller <thomas.mueller@tmit.eu> * * @license GNU AGPL version 3 or any later version @@ -21,10 +19,11 @@ * */ style('core', ['styles', 'header']); + +/** @param $_ array */ ?> <span class="error error-wide"> <h2><strong><?php p($_['title']) ?></strong></h2> - <p><?php p($_['message']) ?></p> <br> <h2><strong><?php p($l->t('Technical details')) ?></strong></h2> diff --git a/apps/dav/tests/travis/litmus-v1/install.sh b/apps/dav/tests/travis/litmus-v1/install.sh deleted file mode 100644 index 0ee2cb08d82..00000000000 --- a/apps/dav/tests/travis/litmus-v1/install.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# compile litmus -if [ ! -f /tmp/litmus/litmus-0.13.tar.gz ]; then - mkdir -p /tmp/litmus - wget -O /tmp/litmus/litmus-0.13.tar.gz http://www.webdav.org/neon/litmus/litmus-0.13.tar.gz - cd /tmp/litmus - tar -xzf litmus-0.13.tar.gz - cd /tmp/litmus/litmus-0.13 - ./configure - make -fi diff --git a/apps/dav/tests/travis/litmus-v2/install.sh b/apps/dav/tests/travis/litmus-v2/install.sh deleted file mode 100644 index 0ee2cb08d82..00000000000 --- a/apps/dav/tests/travis/litmus-v2/install.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# compile litmus -if [ ! -f /tmp/litmus/litmus-0.13.tar.gz ]; then - mkdir -p /tmp/litmus - wget -O /tmp/litmus/litmus-0.13.tar.gz http://www.webdav.org/neon/litmus/litmus-0.13.tar.gz - cd /tmp/litmus - tar -xzf litmus-0.13.tar.gz - cd /tmp/litmus/litmus-0.13 - ./configure - make -fi diff --git a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php index 229fa7ec6f2..e878cbd4f59 100644 --- a/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php +++ b/apps/dav/tests/unit/CardDAV/ImageExportPluginTest.php @@ -107,9 +107,20 @@ class ImageExportPluginTest extends TestCase { $this->plugin->expects($this->once())->method('getPhoto')->willReturn($getPhotoResult); if (!$expected) { - $this->response->expects($this->once())->method('setHeader'); - $this->response->expects($this->once())->method('setStatus'); - $this->response->expects($this->once())->method('setBody'); + $this->response + ->expects($this->at(0)) + ->method('setHeader') + ->with('Content-Type', $getPhotoResult['Content-Type']); + $this->response + ->expects($this->at(1)) + ->method('setHeader') + ->with('Content-Disposition', 'attachment'); + $this->response + ->expects($this->once()) + ->method('setStatus'); + $this->response + ->expects($this->once()) + ->method('setBody'); } $result = $this->plugin->httpGet($this->request, $this->response); @@ -142,12 +153,43 @@ class ImageExportPluginTest extends TestCase { public function providesPhotoData() { return [ - 'empty vcard' => [false, ''], - 'vcard without PHOTO' => [false, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nEND:VCARD\r\n"], - 'vcard 3 with PHOTO' => [['Content-Type' => 'image/jpeg', 'body' => '12345'], "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO;ENCODING=b;TYPE=JPEG:MTIzNDU=\r\nEND:VCARD\r\n"], - 'vcard 3 with PHOTO URL' => [false, "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO;TYPE=JPEG;VALUE=URI:http://example.com/photo.jpg\r\nEND:VCARD\r\n"], - 'vcard 4 with PHOTO' => [['Content-Type' => 'image/jpeg', 'body' => '12345'], "BEGIN:VCARD\r\nVERSION:4.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO:data:image/jpeg;base64,MTIzNDU=\r\nEND:VCARD\r\n"], - 'vcard 4 with PHOTO URL' => [false, "BEGIN:VCARD\r\nVERSION:4.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO;MEDIATYPE=image/jpeg:http://example.org/photo.jpg\r\nEND:VCARD\r\n"], + 'empty vcard' => [ + false, + '' + ], + 'vcard without PHOTO' => [ + false, + "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nEND:VCARD\r\n" + ], + 'vcard 3 with PHOTO' => [ + [ + 'Content-Type' => 'image/jpeg', + 'body' => '12345' + ], + "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO;ENCODING=b;TYPE=JPEG:MTIzNDU=\r\nEND:VCARD\r\n" + ], + 'vcard 3 with PHOTO URL' => [ + false, + "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO;TYPE=JPEG;VALUE=URI:http://example.com/photo.jpg\r\nEND:VCARD\r\n" + ], + 'vcard 4 with PHOTO' => [ + [ + 'Content-Type' => 'image/jpeg', + 'body' => '12345' + ], + "BEGIN:VCARD\r\nVERSION:4.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO:data:image/jpeg;base64,MTIzNDU=\r\nEND:VCARD\r\n" + ], + 'vcard 4 with PHOTO URL' => [ + false, + "BEGIN:VCARD\r\nVERSION:4.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO;MEDIATYPE=image/jpeg:http://example.org/photo.jpg\r\nEND:VCARD\r\n" + ], + 'vcard 4 with PHOTO AND INVALID MIMEtYPE' => [ + [ + 'Content-Type' => 'application/octet-stream', + 'body' => '12345' + ], + "BEGIN:VCARD\r\nVERSION:4.0\r\nPRODID:-//Sabre//Sabre VObject 3.5.0//EN\r\nUID:12345\r\nFN:12345\r\nN:12345;;;;\r\nPHOTO:data:image/svg;base64,MTIzNDU=\r\nEND:VCARD\r\n" + ], ]; } } diff --git a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php index ea875886af7..66aea40ef22 100644 --- a/apps/dav/tests/unit/Upload/AssemblyStreamTest.php +++ b/apps/dav/tests/unit/Upload/AssemblyStreamTest.php @@ -35,18 +35,78 @@ class AssemblyStreamTest extends \Test\TestCase { $this->assertEquals($expected, $content); } + /** + * @dataProvider providesNodes() + */ + public function testGetContentsFread($expected, $nodes) { + $stream = \OCA\DAV\Upload\AssemblyStream::wrap($nodes); + + $content = ''; + while (!feof($stream)) { + $content .= fread($stream, 3); + } + + $this->assertEquals($expected, $content); + } + function providesNodes() { + $data8k = $this->makeData(8192); + $dataLess8k = $this->makeData(8191); return[ - 'one node only' => ['1234567890', [ + 'one node zero bytes' => [ + '', [ + $this->buildNode('0', '') + ]], + 'one node only' => [ + '1234567890', [ $this->buildNode('0', '1234567890') ]], - 'two nodes' => ['1234567890', [ + 'one node buffer boundary' => [ + $data8k, [ + $this->buildNode('0', $data8k) + ]], + 'two nodes' => [ + '1234567890', [ $this->buildNode('1', '67890'), $this->buildNode('0', '12345') - ]] + ]], + 'two nodes end on buffer boundary' => [ + $data8k . $data8k, [ + $this->buildNode('1', $data8k), + $this->buildNode('0', $data8k) + ]], + 'two nodes with one on buffer boundary' => [ + $data8k . $dataLess8k, [ + $this->buildNode('1', $dataLess8k), + $this->buildNode('0', $data8k) + ]], + 'two nodes on buffer boundary plus one byte' => [ + $data8k . 'X' . $data8k, [ + $this->buildNode('1', $data8k), + $this->buildNode('0', $data8k . 'X') + ]], + 'two nodes on buffer boundary plus one byte at the end' => [ + $data8k . $data8k . 'X', [ + $this->buildNode('1', $data8k . 'X'), + $this->buildNode('0', $data8k) + ]], ]; } + private function makeData($count) { + $data = ''; + $base = '1234567890'; + $j = 0; + for ($i = 0; $i < $count; $i++) { + $data .= $base[$j]; + $j++; + if (!isset($base[$j])) { + $j = 0; + } + } + return $data; + } + private function buildNode($name, $data) { $node = $this->getMockBuilder('\Sabre\DAV\File') ->setMethods(['getName', 'get', 'getSize']) diff --git a/apps/encryption/lib/KeyManager.php b/apps/encryption/lib/KeyManager.php index 4099da4b5ab..26f023ed8f9 100644 --- a/apps/encryption/lib/KeyManager.php +++ b/apps/encryption/lib/KeyManager.php @@ -33,7 +33,6 @@ use OCA\Encryption\Exceptions\PublicKeyMissingException; use OCA\Encryption\Crypto\Crypt; use OCP\Encryption\Keys\IStorage; use OCP\IConfig; -use OCP\IDBConnection; use OCP\ILogger; use OCP\IUserSession; diff --git a/apps/encryption/tests/MigrationTest.php b/apps/encryption/tests/MigrationTest.php index 0aea7543c2c..868a1ad3922 100644 --- a/apps/encryption/tests/MigrationTest.php +++ b/apps/encryption/tests/MigrationTest.php @@ -46,7 +46,7 @@ class MigrationTest extends \Test\TestCase { private $recovery_key_id = 'recovery_key_id'; private $moduleId; - /** @var \PHPUnit_Framework_MockObject_MockObject | ILogger */ + /** @var \PHPUnit_Framework_MockObject_MockObject|ILogger */ private $logger; public static function setUpBeforeClass() { diff --git a/apps/federatedfilesharing/lib/AppInfo/Application.php b/apps/federatedfilesharing/lib/AppInfo/Application.php index b470bb3e584..c37cb9b87bb 100644 --- a/apps/federatedfilesharing/lib/AppInfo/Application.php +++ b/apps/federatedfilesharing/lib/AppInfo/Application.php @@ -29,7 +29,6 @@ use OCA\FederatedFileSharing\AddressHandler; use OCA\FederatedFileSharing\Controller\RequestHandlerController; use OCA\FederatedFileSharing\FederatedShareProvider; use OCA\FederatedFileSharing\Notifications; -use OCA\FederatedFileSharing\RequestHandler; use OCP\AppFramework\App; class Application extends App { diff --git a/apps/federatedfilesharing/settings-personal.php b/apps/federatedfilesharing/settings-personal.php index 92f96d1ba40..522cb297898 100644 --- a/apps/federatedfilesharing/settings-personal.php +++ b/apps/federatedfilesharing/settings-personal.php @@ -24,7 +24,6 @@ */ use OCA\FederatedFileSharing\AppInfo\Application; -use OCA\Theming\Template; \OC_Util::checkLoggedIn(); diff --git a/apps/federatedfilesharing/tests/TestCase.php b/apps/federatedfilesharing/tests/TestCase.php index 22d41038e6c..f8a47f27336 100644 --- a/apps/federatedfilesharing/tests/TestCase.php +++ b/apps/federatedfilesharing/tests/TestCase.php @@ -23,7 +23,6 @@ namespace OCA\FederatedFileSharing\Tests; use OC\Files\Filesystem; -use OCA\Files\Share; /** * Class Test_Files_Sharing_Base diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php index de6967c7d63..267e53829da 100644 --- a/apps/files_sharing/appinfo/routes.php +++ b/apps/files_sharing/appinfo/routes.php @@ -77,6 +77,39 @@ $application->registerRoutes($this, [ 'url' => '/api/v1/sharees', 'verb' => 'GET', ], + /* + * Remote Shares + */ + [ + 'name' => 'Remote#getShares', + 'url' => '/api/v1/remote_shares', + 'verb' => 'GET', + ], + [ + 'name' => 'Remote#getOpenShares', + 'url' => '/api/v1/remote_shares/pending', + 'verb' => 'GET', + ], + [ + 'name' => 'Remote#acceptShare', + 'url' => '/api/v1/remote_shares/pending/{id}', + 'verb' => 'POST', + ], + [ + 'name' => 'Remote#declineShare', + 'url' => '/api/v1/remote_shares/pending/{id}', + 'verb' => 'DELETE', + ], + [ + 'name' => 'Remote#getShare', + 'url' => '/api/v1/remote_shares/{id}', + 'verb' => 'GET', + ], + [ + 'name' => 'Remote#unshare', + 'url' => '/api/v1/remote_shares/{id}', + 'verb' => 'DELETE', + ], ], ]); @@ -96,33 +129,3 @@ $this->create('sharing_external_shareinfo', '/shareinfo') // OCS API //TODO: SET: mail notification, waiting for PR #4689 to be accepted - -API::register('get', - '/apps/files_sharing/api/v1/remote_shares', - array('\OCA\Files_Sharing\API\Remote', 'getShares'), - 'files_sharing'); - -API::register('get', - '/apps/files_sharing/api/v1/remote_shares/pending', - array('\OCA\Files_Sharing\API\Remote', 'getOpenShares'), - 'files_sharing'); - -API::register('post', - '/apps/files_sharing/api/v1/remote_shares/pending/{id}', - array('\OCA\Files_Sharing\API\Remote', 'acceptShare'), - 'files_sharing'); - -API::register('delete', - '/apps/files_sharing/api/v1/remote_shares/pending/{id}', - array('\OCA\Files_Sharing\API\Remote', 'declineShare'), - 'files_sharing'); - -API::register('get', - '/apps/files_sharing/api/v1/remote_shares/{id}', - array('\OCA\Files_Sharing\API\Remote', 'getShare'), - 'files_sharing'); - -API::register('delete', - '/apps/files_sharing/api/v1/remote_shares/{id}', - array('\OCA\Files_Sharing\API\Remote', 'unshare'), - 'files_sharing'); diff --git a/apps/files_sharing/lib/API/Remote.php b/apps/files_sharing/lib/API/Remote.php deleted file mode 100644 index a522f923a39..00000000000 --- a/apps/files_sharing/lib/API/Remote.php +++ /dev/null @@ -1,230 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Joas Schilling <coding@schilljs.com> - * @author Lukas Reschke <lukas@statuscode.ch> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @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_Sharing\API; - -use OC\Files\Filesystem; -use OCA\FederatedFileSharing\DiscoveryManager; -use OCA\Files_Sharing\External\Manager; - -class Remote { - - /** - * Get list of pending remote shares - * - * @param array $params empty - * @return \OC_OCS_Result - */ - public static function getOpenShares($params) { - $discoveryManager = new DiscoveryManager( - \OC::$server->getMemCacheFactory(), - \OC::$server->getHTTPClientService() - ); - $externalManager = new Manager( - \OC::$server->getDatabaseConnection(), - Filesystem::getMountManager(), - Filesystem::getLoader(), - \OC::$server->getHTTPClientService(), - \OC::$server->getNotificationManager(), - $discoveryManager, - \OC_User::getUser() - ); - - return new \OC_OCS_Result($externalManager->getOpenShares()); - } - - /** - * Accept a remote share - * - * @param array $params contains the shareID 'id' which should be accepted - * @return \OC_OCS_Result - */ - public static function acceptShare($params) { - $discoveryManager = new DiscoveryManager( - \OC::$server->getMemCacheFactory(), - \OC::$server->getHTTPClientService() - ); - $externalManager = new Manager( - \OC::$server->getDatabaseConnection(), - Filesystem::getMountManager(), - Filesystem::getLoader(), - \OC::$server->getHTTPClientService(), - \OC::$server->getNotificationManager(), - $discoveryManager, - \OC_User::getUser() - ); - - if ($externalManager->acceptShare((int) $params['id'])) { - return new \OC_OCS_Result(); - } - - // Make sure the user has no notification for something that does not exist anymore. - $externalManager->processNotification((int) $params['id']); - - return new \OC_OCS_Result(null, 404, "wrong share ID, share doesn't exist."); - } - - /** - * Decline a remote share - * - * @param array $params contains the shareID 'id' which should be declined - * @return \OC_OCS_Result - */ - public static function declineShare($params) { - $discoveryManager = new DiscoveryManager( - \OC::$server->getMemCacheFactory(), - \OC::$server->getHTTPClientService() - ); - $externalManager = new Manager( - \OC::$server->getDatabaseConnection(), - Filesystem::getMountManager(), - Filesystem::getLoader(), - \OC::$server->getHTTPClientService(), - \OC::$server->getNotificationManager(), - $discoveryManager, - \OC_User::getUser() - ); - - if ($externalManager->declineShare((int) $params['id'])) { - return new \OC_OCS_Result(); - } - - // Make sure the user has no notification for something that does not exist anymore. - $externalManager->processNotification((int) $params['id']); - - return new \OC_OCS_Result(null, 404, "wrong share ID, share doesn't exist."); - } - - /** - * @param array $share Share with info from the share_external table - * @return array enriched share info with data from the filecache - */ - private static function extendShareInfo($share) { - $view = new \OC\Files\View('/' . \OC_User::getUser() . '/files/'); - $info = $view->getFileInfo($share['mountpoint']); - - $share['mimetype'] = $info->getMimetype(); - $share['mtime'] = $info->getMtime(); - $share['permissions'] = $info->getPermissions(); - $share['type'] = $info->getType(); - $share['file_id'] = $info->getId(); - - return $share; - } - - /** - * List accepted remote shares - * - * @param array $params - * @return \OC_OCS_Result - */ - public static function getShares($params) { - $discoveryManager = new DiscoveryManager( - \OC::$server->getMemCacheFactory(), - \OC::$server->getHTTPClientService() - ); - $externalManager = new Manager( - \OC::$server->getDatabaseConnection(), - Filesystem::getMountManager(), - Filesystem::getLoader(), - \OC::$server->getHTTPClientService(), - \OC::$server->getNotificationManager(), - $discoveryManager, - \OC_User::getUser() - ); - - $shares = $externalManager->getAcceptedShares(); - - $shares = array_map('self::extendShareInfo', $shares); - - return new \OC_OCS_Result($shares); - } - - /** - * Get info of a remote share - * - * @param array $params contains the shareID 'id' - * @return \OC_OCS_Result - */ - public static function getShare($params) { - $discoveryManager = new DiscoveryManager( - \OC::$server->getMemCacheFactory(), - \OC::$server->getHTTPClientService() - ); - $externalManager = new Manager( - \OC::$server->getDatabaseConnection(), - Filesystem::getMountManager(), - Filesystem::getLoader(), - \OC::$server->getHTTPClientService(), - \OC::$server->getNotificationManager(), - $discoveryManager, - \OC_User::getUser() - ); - - $shareInfo = $externalManager->getShare($params['id']); - - if ($shareInfo === false) { - return new \OC_OCS_Result(null, 404, 'share does not exist'); - } else { - $shareInfo = self::extendShareInfo($shareInfo); - return new \OC_OCS_Result($shareInfo); - } - } - - /** - * Unshare a remote share - * - * @param array $params contains the shareID 'id' which should be unshared - * @return \OC_OCS_Result - */ - public static function unshare($params) { - $discoveryManager = new DiscoveryManager( - \OC::$server->getMemCacheFactory(), - \OC::$server->getHTTPClientService() - ); - $externalManager = new Manager( - \OC::$server->getDatabaseConnection(), - Filesystem::getMountManager(), - Filesystem::getLoader(), - \OC::$server->getHTTPClientService(), - \OC::$server->getNotificationManager(), - $discoveryManager, - \OC_User::getUser() - ); - - $shareInfo = $externalManager->getShare($params['id']); - - if ($shareInfo === false) { - return new \OC_OCS_Result(null, 404, 'Share does not exist'); - } - - $mountPoint = '/' . \OC_User::getUser() . '/files' . $shareInfo['mountpoint']; - - if ($externalManager->removeShare($mountPoint) === true) { - return new \OC_OCS_Result(null); - } else { - return new \OC_OCS_Result(null, 403, 'Could not unshare'); - } - } -} diff --git a/apps/files_sharing/lib/API/Share20OCS.php b/apps/files_sharing/lib/API/Share20OCS.php index 62a947ee2c9..34f73c7ac07 100644 --- a/apps/files_sharing/lib/API/Share20OCS.php +++ b/apps/files_sharing/lib/API/Share20OCS.php @@ -661,7 +661,7 @@ class Share20OCS extends OCSController { } } - if ($permissions !== null) { + if ($permissions !== null && $share->getShareOwner() !== $this->currentUser->getUID()) { /* Check if this is an incomming share */ $incomingShares = $this->shareManager->getSharedWith($this->currentUser->getUID(), \OCP\Share::SHARE_TYPE_USER, $share->getNode(), -1, 0); $incomingShares = array_merge($incomingShares, $this->shareManager->getSharedWith($this->currentUser->getUID(), \OCP\Share::SHARE_TYPE_GROUP, $share->getNode(), -1, 0)); diff --git a/apps/files_sharing/lib/AppInfo/Application.php b/apps/files_sharing/lib/AppInfo/Application.php index 0e70924da40..5558ffbdfc4 100644 --- a/apps/files_sharing/lib/AppInfo/Application.php +++ b/apps/files_sharing/lib/AppInfo/Application.php @@ -111,6 +111,7 @@ class Application extends App { $uid ); }); + $container->registerAlias('OCA\Files_Sharing\External\Manager', 'ExternalManager'); /** * Middleware diff --git a/apps/files_sharing/lib/Controller/RemoteController.php b/apps/files_sharing/lib/Controller/RemoteController.php new file mode 100644 index 00000000000..7c7a608ff2d --- /dev/null +++ b/apps/files_sharing/lib/Controller/RemoteController.php @@ -0,0 +1,183 @@ +<?php +/** + * @copyright Copyright (c) 2016, ownCloud, Inc. + * + * @author Joas Schilling <coding@schilljs.com> + * @author Lukas Reschke <lukas@statuscode.ch> + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @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_Sharing\Controller; + +use OCA\Files_Sharing\External\Manager; +use OCP\AppFramework\Http\DataResponse; +use OCP\AppFramework\OCS\OCSForbiddenException; +use OCP\AppFramework\OCS\OCSNotFoundException; +use OCP\AppFramework\OCSController; +use OCP\IRequest; + +class RemoteController extends OCSController { + + /** @var Manager */ + private $externalManager; + + /** + * @NoAdminRequired + * + * Remote constructor. + * + * @param string $appName + * @param IRequest $request + * @param Manager $externalManager + */ + public function __construct($appName, + IRequest $request, + Manager $externalManager) { + parent::__construct($appName, $request); + + $this->externalManager = $externalManager; + } + + /** + * @NoAdminRequired + * + * Get list of pending remote shares + * + * @return DataResponse + */ + public function getOpenShares() { + return new DataResponse($this->externalManager->getOpenShares()); + } + + /** + * @NoAdminRequired + * + * Accept a remote share + * + * @param int $id + * @return DataResponse + * @throws OCSNotFoundException + */ + public function acceptShare($id) { + if ($this->externalManager->acceptShare($id)) { + return new DataResponse(); + } + + // Make sure the user has no notification for something that does not exist anymore. + $this->externalManager->processNotification($id); + + throw new OCSNotFoundException('wrong share ID, share doesn\'t exist.'); + } + + /** + * @NoAdminRequired + * + * Decline a remote share + * + * @param int $id + * @return DataResponse + * @throws OCSNotFoundException + */ + public function declineShare($id) { + if ($this->externalManager->declineShare($id)) { + return new DataResponse(); + } + + // Make sure the user has no notification for something that does not exist anymore. + $this->externalManager->processNotification($id); + + throw new OCSNotFoundException('wrong share ID, share doesn\'t exist.'); + } + + /** + * @param array $share Share with info from the share_external table + * @return array enriched share info with data from the filecache + */ + private static function extendShareInfo($share) { + $view = new \OC\Files\View('/' . \OC_User::getUser() . '/files/'); + $info = $view->getFileInfo($share['mountpoint']); + + $share['mimetype'] = $info->getMimetype(); + $share['mtime'] = $info->getMTime(); + $share['permissions'] = $info->getPermissions(); + $share['type'] = $info->getType(); + $share['file_id'] = $info->getId(); + + return $share; + } + + /** + * @NoAdminRequired + * + * List accepted remote shares + * + * @return DataResponse + */ + public function getShares() { + $shares = $this->externalManager->getAcceptedShares(); + $shares = array_map('self::extendShareInfo', $shares); + + return new DataResponse($shares); + } + + /** + * @NoAdminRequired + * + * Get info of a remote share + * + * @param int $id + * @return DataResponse + * @throws OCSNotFoundException + */ + public function getShare($id) { + $shareInfo = $this->externalManager->getShare($id); + + if ($shareInfo === false) { + throw new OCSNotFoundException('share does not exist'); + } else { + $shareInfo = self::extendShareInfo($shareInfo); + return new DataResponse($shareInfo); + } + } + + /** + * @NoAdminRequired + * + * Unshare a remote share + * + * @param int $id + * @return DataResponse + * @throws OCSNotFoundException + * @throws OCSForbiddenException + */ + public function unshare($id) { + $shareInfo = $this->externalManager->getShare($id); + + if ($shareInfo === false) { + throw new OCSNotFoundException('Share does not exist'); + } + + $mountPoint = '/' . \OC_User::getUser() . '/files' . $shareInfo['mountpoint']; + + if ($this->externalManager->removeShare($mountPoint) === true) { + return new DataResponse(); + } else { + throw new OCSForbiddenException('Could not unshare'); + } + } +} diff --git a/apps/files_sharing/tests/API/Share20OCSTest.php b/apps/files_sharing/tests/API/Share20OCSTest.php index 1f0b4855a0d..f9579b89935 100644 --- a/apps/files_sharing/tests/API/Share20OCSTest.php +++ b/apps/files_sharing/tests/API/Share20OCSTest.php @@ -24,6 +24,8 @@ namespace OCA\Files_Sharing\Tests\API; use OCP\AppFramework\Http\DataResponse; +use OCP\AppFramework\OCS\OCSNotFoundException; +use OCP\Files\Folder; use OCP\IL10N; use OCA\Files_Sharing\API\Share20OCS; use OCP\Files\NotFoundException; @@ -108,8 +110,11 @@ class Share20OCSTest extends \Test\TestCase { ); } + /** + * @return Share20OCS|\PHPUnit_Framework_MockObject_MockObject + */ private function mockFormatShare() { - return $this->getMockBuilder('OCA\Files_Sharing\API\Share20OCS') + return $this->getMockBuilder(Share20OCS::class) ->setConstructorArgs([ $this->appName, $this->request, @@ -1569,6 +1574,103 @@ class Share20OCSTest extends \Test\TestCase { $this->assertEquals($expected->getData(), $result->getData()); } + public function testUpdateShareCannotIncreasePermissions() { + $ocs = $this->mockFormatShare(); + + $folder = $this->createMock(Folder::class); + + $share = \OC::$server->getShareManager()->newShare(); + $share + ->setId(42) + ->setSharedBy($this->currentUser->getUID()) + ->setShareOwner('anotheruser') + ->setShareType(\OCP\Share::SHARE_TYPE_GROUP) + ->setSharedWith('group1') + ->setPermissions(\OCP\Constants::PERMISSION_READ) + ->setNode($folder); + + // note: updateShare will modify the received instance but getSharedWith will reread from the database, + // so their values will be different + $incomingShare = \OC::$server->getShareManager()->newShare(); + $incomingShare + ->setId(42) + ->setSharedBy($this->currentUser->getUID()) + ->setShareOwner('anotheruser') + ->setShareType(\OCP\Share::SHARE_TYPE_GROUP) + ->setSharedWith('group1') + ->setPermissions(\OCP\Constants::PERMISSION_READ) + ->setNode($folder); + + $this->request + ->method('getParam') + ->will($this->returnValueMap([ + ['permissions', null, '31'], + ])); + + $this->shareManager->method('getShareById')->with('ocinternal:42')->willReturn($share); + + $this->shareManager->expects($this->any(0)) + ->method('getSharedWith') + ->will($this->returnValueMap([ + ['currentUser', \OCP\Share::SHARE_TYPE_USER, $share->getNode(), -1, 0, []], + ['currentUser', \OCP\Share::SHARE_TYPE_GROUP, $share->getNode(), -1, 0, [$incomingShare]] + ])); + + $this->shareManager->expects($this->never())->method('updateShare'); + + try { + $ocs->updateShare(42, 31); + $this->fail(); + } catch (OCSNotFoundException $e) { + $this->assertEquals('Cannot increase permissions', $e->getMessage()); + } + } + + public function testUpdateShareCanIncreasePermissionsIfOwner() { + $ocs = $this->mockFormatShare(); + + $folder = $this->createMock(Folder::class); + + $share = \OC::$server->getShareManager()->newShare(); + $share + ->setId(42) + ->setSharedBy($this->currentUser->getUID()) + ->setShareOwner($this->currentUser->getUID()) + ->setShareType(\OCP\Share::SHARE_TYPE_GROUP) + ->setSharedWith('group1') + ->setPermissions(\OCP\Constants::PERMISSION_READ) + ->setNode($folder); + + // note: updateShare will modify the received instance but getSharedWith will reread from the database, + // so their values will be different + $incomingShare = \OC::$server->getShareManager()->newShare(); + $incomingShare + ->setId(42) + ->setSharedBy($this->currentUser->getUID()) + ->setShareOwner($this->currentUser->getUID()) + ->setShareType(\OCP\Share::SHARE_TYPE_GROUP) + ->setSharedWith('group1') + ->setPermissions(\OCP\Constants::PERMISSION_READ) + ->setNode($folder); + + $this->shareManager->method('getShareById')->with('ocinternal:42')->willReturn($share); + + $this->shareManager->expects($this->any(0)) + ->method('getSharedWith') + ->will($this->returnValueMap([ + ['currentUser', \OCP\Share::SHARE_TYPE_USER, $share->getNode(), -1, 0, []], + ['currentUser', \OCP\Share::SHARE_TYPE_GROUP, $share->getNode(), -1, 0, [$incomingShare]] + ])); + + $this->shareManager->expects($this->once()) + ->method('updateShare') + ->with($share) + ->willReturn($share); + + $result = $ocs->updateShare(42, 31); + $this->assertInstanceOf(DataResponse::class, $result); + } + public function dataFormatShare() { $file = $this->getMockBuilder('\OCP\Files\File')->getMock(); $folder = $this->getMockBuilder('\OCP\Files\Folder')->getMock(); diff --git a/apps/files_trashbin/lib/Helper.php b/apps/files_trashbin/lib/Helper.php index 836f799381a..9c312443164 100644 --- a/apps/files_trashbin/lib/Helper.php +++ b/apps/files_trashbin/lib/Helper.php @@ -78,11 +78,12 @@ class Helper { $originalPath = substr($originalPath, 0, -1); } } + $type = $entry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE ? 'dir' : 'file'; $i = array( 'name' => $name, 'mtime' => $timestamp, - 'mimetype' => $entry->getMimeType(), - 'type' => $entry->getMimeType() === ICacheEntry::DIRECTORY_MIMETYPE ? 'dir' : 'file', + 'mimetype' => $type === 'dir' ? 'httpd/unix-directory' : \OC::$server->getMimeTypeDetector()->detectPath($name), + 'type' => $type, 'directory' => ($dir === '/') ? '' : $dir, 'size' => $entry->getSize(), 'etag' => '', diff --git a/apps/twofactor_backupcodes/l10n/cs_CZ.js b/apps/twofactor_backupcodes/l10n/cs_CZ.js new file mode 100644 index 00000000000..150310ae773 --- /dev/null +++ b/apps/twofactor_backupcodes/l10n/cs_CZ.js @@ -0,0 +1,15 @@ +OC.L10N.register( + "twofactor_backupcodes", + { + "Generate backup codes" : "Vytvořit záložní kódy", + "Backup codes have been generated. {{used}} of {{total}} codes have been used." : "Záložní kódy byly vytvořeny. {{used}} z {{total}} kódů bylo využito.", + "Save backup codes" : "Uložit záložní kódy", + "Print backup codes" : "Vytisknout záložní kódy", + "Regenerate backup codes" : "Vytvořit nové záložní kódy", + "If you regenerate backup codes, you automatically invalidate old codes." : "Pokud vytvoříte nové záložní kódy, staré budou automaticky zrušeny.", + "An error occurred while generating your backup codes" : "Při pokusu o vytvoření záložních kódů nastala chyba.", + "Nextcloud backup codes" : "Nextcloud záložní kódy", + "Backup code" : "Záložní kód", + "Use backup code" : "Použít záložní kód" +}, +"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"); diff --git a/apps/twofactor_backupcodes/l10n/cs_CZ.json b/apps/twofactor_backupcodes/l10n/cs_CZ.json new file mode 100644 index 00000000000..fea5e11f1e1 --- /dev/null +++ b/apps/twofactor_backupcodes/l10n/cs_CZ.json @@ -0,0 +1,13 @@ +{ "translations": { + "Generate backup codes" : "Vytvořit záložní kódy", + "Backup codes have been generated. {{used}} of {{total}} codes have been used." : "Záložní kódy byly vytvořeny. {{used}} z {{total}} kódů bylo využito.", + "Save backup codes" : "Uložit záložní kódy", + "Print backup codes" : "Vytisknout záložní kódy", + "Regenerate backup codes" : "Vytvořit nové záložní kódy", + "If you regenerate backup codes, you automatically invalidate old codes." : "Pokud vytvoříte nové záložní kódy, staré budou automaticky zrušeny.", + "An error occurred while generating your backup codes" : "Při pokusu o vytvoření záložních kódů nastala chyba.", + "Nextcloud backup codes" : "Nextcloud záložní kódy", + "Backup code" : "Záložní kód", + "Use backup code" : "Použít záložní kód" +},"pluralForm" :"nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;" +}
\ No newline at end of file diff --git a/apps/twofactor_backupcodes/l10n/de.js b/apps/twofactor_backupcodes/l10n/de.js new file mode 100644 index 00000000000..e5ca6422df6 --- /dev/null +++ b/apps/twofactor_backupcodes/l10n/de.js @@ -0,0 +1,17 @@ +OC.L10N.register( + "twofactor_backupcodes", + { + "Generate backup codes" : "Backup-Codes erstellen", + "Backup codes have been generated. {{used}} of {{total}} codes have been used." : "Backup-Codes wurden erstellt. {{used}} von {{total}} Codes wurden benutzt.", + "These are your backup codes. Please save and/or print them as you will not be able to read the codes again later" : "Dies sind Deine Backup-Codes. Bitte speichere und/oder drucke diese aus, da diese Codes später nicht mehr gelesen werden können", + "Save backup codes" : "Backup-Codes speichern", + "Print backup codes" : "Backup-Codes drucken", + "Regenerate backup codes" : "Backup-Codes neu generieren", + "If you regenerate backup codes, you automatically invalidate old codes." : "Wenn Du Backup-Codes neu generierst, werden alte automatisch ungültig.", + "An error occurred while generating your backup codes" : "Ein Fehler ist bei der Erstellung Deiner Backup-Codes aufgetreten", + "Nextcloud backup codes" : "Nextcloud-Backup-Codes", + "Backup code" : "Backup-Code", + "Use backup code" : "Backup-Code verwenden", + "Second-factor backup codes" : "Zweitfaktor-Backup-Codes" +}, +"nplurals=2; plural=(n != 1);"); diff --git a/apps/twofactor_backupcodes/l10n/de.json b/apps/twofactor_backupcodes/l10n/de.json new file mode 100644 index 00000000000..e3cdfce9d7b --- /dev/null +++ b/apps/twofactor_backupcodes/l10n/de.json @@ -0,0 +1,15 @@ +{ "translations": { + "Generate backup codes" : "Backup-Codes erstellen", + "Backup codes have been generated. {{used}} of {{total}} codes have been used." : "Backup-Codes wurden erstellt. {{used}} von {{total}} Codes wurden benutzt.", + "These are your backup codes. Please save and/or print them as you will not be able to read the codes again later" : "Dies sind Deine Backup-Codes. Bitte speichere und/oder drucke diese aus, da diese Codes später nicht mehr gelesen werden können", + "Save backup codes" : "Backup-Codes speichern", + "Print backup codes" : "Backup-Codes drucken", + "Regenerate backup codes" : "Backup-Codes neu generieren", + "If you regenerate backup codes, you automatically invalidate old codes." : "Wenn Du Backup-Codes neu generierst, werden alte automatisch ungültig.", + "An error occurred while generating your backup codes" : "Ein Fehler ist bei der Erstellung Deiner Backup-Codes aufgetreten", + "Nextcloud backup codes" : "Nextcloud-Backup-Codes", + "Backup code" : "Backup-Code", + "Use backup code" : "Backup-Code verwenden", + "Second-factor backup codes" : "Zweitfaktor-Backup-Codes" +},"pluralForm" :"nplurals=2; plural=(n != 1);" +}
\ No newline at end of file diff --git a/apps/twofactor_backupcodes/l10n/de_DE.js b/apps/twofactor_backupcodes/l10n/de_DE.js new file mode 100644 index 00000000000..498675698f6 --- /dev/null +++ b/apps/twofactor_backupcodes/l10n/de_DE.js @@ -0,0 +1,14 @@ +OC.L10N.register( + "twofactor_backupcodes", + { + "Generate backup codes" : "Backup-Codes erstellen", + "Backup codes have been generated. {{used}} of {{total}} codes have been used." : "Backup-Codes wurden erstellt. {{used}} von {{total}} Codes wurden verwandt.", + "These are your backup codes. Please save and/or print them as you will not be able to read the codes again later" : "Dies sind Ihre Backup-Codes. Bitte speichern und/oder drucken Sie diese, da diese Codes später nicht mehr gelesen werden können", + "Save backup codes" : "Backup-Codes speichern", + "Print backup codes" : "Backup-Codes drucken", + "An error occurred while generating your backup codes" : "Beim Erstellen Ihrer Backup-Codes ist ein Fehler aufgetreten", + "Nextcloud backup codes" : "Nextcloud Backup-Codes", + "Backup code" : "Backup-Code", + "Use backup code" : "Verwende Backup-Code" +}, +"nplurals=2; plural=(n != 1);"); diff --git a/apps/twofactor_backupcodes/l10n/de_DE.json b/apps/twofactor_backupcodes/l10n/de_DE.json new file mode 100644 index 00000000000..fcc4a672513 --- /dev/null +++ b/apps/twofactor_backupcodes/l10n/de_DE.json @@ -0,0 +1,12 @@ +{ "translations": { + "Generate backup codes" : "Backup-Codes erstellen", + "Backup codes have been generated. {{used}} of {{total}} codes have been used." : "Backup-Codes wurden erstellt. {{used}} von {{total}} Codes wurden verwandt.", + "These are your backup codes. Please save and/or print them as you will not be able to read the codes again later" : "Dies sind Ihre Backup-Codes. Bitte speichern und/oder drucken Sie diese, da diese Codes später nicht mehr gelesen werden können", + "Save backup codes" : "Backup-Codes speichern", + "Print backup codes" : "Backup-Codes drucken", + "An error occurred while generating your backup codes" : "Beim Erstellen Ihrer Backup-Codes ist ein Fehler aufgetreten", + "Nextcloud backup codes" : "Nextcloud Backup-Codes", + "Backup code" : "Backup-Code", + "Use backup code" : "Verwende Backup-Code" +},"pluralForm" :"nplurals=2; plural=(n != 1);" +}
\ No newline at end of file diff --git a/apps/twofactor_backupcodes/l10n/nl.js b/apps/twofactor_backupcodes/l10n/nl.js new file mode 100644 index 00000000000..e0dde0e9a0e --- /dev/null +++ b/apps/twofactor_backupcodes/l10n/nl.js @@ -0,0 +1,17 @@ +OC.L10N.register( + "twofactor_backupcodes", + { + "Generate backup codes" : "Genereer backup code", + "Backup codes have been generated. {{used}} of {{total}} codes have been used." : "Backup codes zijn gegenereerd. {{used}} van {{total}} codes zijn gebruikt.", + "These are your backup codes. Please save and/or print them as you will not be able to read the codes again later" : "Dit zijn jouw backup codes. Bewaar ze en/of druk ze af, aangezien je ze later niet weer kunt zien.", + "Save backup codes" : "Bewaren backup code", + "Print backup codes" : "Afdrukken backup code", + "Regenerate backup codes" : "Regenereer backup code", + "If you regenerate backup codes, you automatically invalidate old codes." : "Als je backup codes opnieuw genereert, worden oude codes automatisch ongeldig gemaakt.", + "An error occurred while generating your backup codes" : "Er trad een fout op bij het genereren van je backup codes", + "Nextcloud backup codes" : "Nextcloud backup codes", + "Backup code" : "Backup code", + "Use backup code" : "Gebruik backup code", + "Second-factor backup codes" : "Twee-factor backup code" +}, +"nplurals=2; plural=(n != 1);"); diff --git a/apps/twofactor_backupcodes/l10n/nl.json b/apps/twofactor_backupcodes/l10n/nl.json new file mode 100644 index 00000000000..77185e6f36e --- /dev/null +++ b/apps/twofactor_backupcodes/l10n/nl.json @@ -0,0 +1,15 @@ +{ "translations": { + "Generate backup codes" : "Genereer backup code", + "Backup codes have been generated. {{used}} of {{total}} codes have been used." : "Backup codes zijn gegenereerd. {{used}} van {{total}} codes zijn gebruikt.", + "These are your backup codes. Please save and/or print them as you will not be able to read the codes again later" : "Dit zijn jouw backup codes. Bewaar ze en/of druk ze af, aangezien je ze later niet weer kunt zien.", + "Save backup codes" : "Bewaren backup code", + "Print backup codes" : "Afdrukken backup code", + "Regenerate backup codes" : "Regenereer backup code", + "If you regenerate backup codes, you automatically invalidate old codes." : "Als je backup codes opnieuw genereert, worden oude codes automatisch ongeldig gemaakt.", + "An error occurred while generating your backup codes" : "Er trad een fout op bij het genereren van je backup codes", + "Nextcloud backup codes" : "Nextcloud backup codes", + "Backup code" : "Backup code", + "Use backup code" : "Gebruik backup code", + "Second-factor backup codes" : "Twee-factor backup code" +},"pluralForm" :"nplurals=2; plural=(n != 1);" +}
\ No newline at end of file diff --git a/apps/twofactor_backupcodes/lib/Db/BackupCode.php b/apps/twofactor_backupcodes/lib/Db/BackupCode.php index 5bfb681063c..a59a414e189 100644 --- a/apps/twofactor_backupcodes/lib/Db/BackupCode.php +++ b/apps/twofactor_backupcodes/lib/Db/BackupCode.php @@ -1,5 +1,4 @@ <?php - /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @@ -22,6 +21,7 @@ namespace OCA\TwoFactor_BackupCodes\Db; + use OCP\AppFramework\Db\Entity; /** diff --git a/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php b/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php index d6256929675..8acdfa45aae 100644 --- a/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php +++ b/apps/twofactor_backupcodes/lib/Db/BackupCodeMapper.php @@ -1,5 +1,4 @@ <?php - /** * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @@ -22,6 +21,7 @@ namespace OCA\TwoFactor_BackupCodes\Db; + use OCP\AppFramework\Db\Mapper; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDb; @@ -38,7 +38,7 @@ class BackupCodeMapper extends Mapper { * @return BackupCode[] */ public function getBackupCodes(IUser $user) { - /* @var $qb IQueryBuilder */ + /* @var IQueryBuilder $qb */ $qb = $this->db->getQueryBuilder(); $qb->select('id', 'user_id', 'code', 'used') @@ -55,7 +55,7 @@ class BackupCodeMapper extends Mapper { } public function deleteCodes(IUser $user) { - /* @var $qb IQueryBuilder */ + /* @var IQueryBuilder $qb */ $qb = $this->db->getQueryBuilder(); $qb->delete('twofactor_backup_codes') diff --git a/apps/twofactor_backupcodes/tests/Integration/Db/BackupCodeMapperTest.php b/apps/twofactor_backupcodes/tests/Integration/Db/BackupCodeMapperTest.php index 5d7d71dd17a..bb97f929d7a 100644 --- a/apps/twofactor_backupcodes/tests/Integration/Db/BackupCodeMapperTest.php +++ b/apps/twofactor_backupcodes/tests/Integration/Db/BackupCodeMapperTest.php @@ -22,7 +22,6 @@ namespace OCA\TwoFactor_BackupCodes\Tests\Integration\Db; -use OC; use OCA\TwoFactor_BackupCodes\Db\BackupCode; use OCA\TwoFactor_BackupCodes\Db\BackupCodeMapper; use OCP\IDBConnection; @@ -53,8 +52,8 @@ class BackupCodeMapperTest extends TestCase { protected function setUp() { parent::setUp(); - $this->db = OC::$server->getDatabaseConnection(); - $this->mapper = OC::$server->query(BackupCodeMapper::class); + $this->db = \OC::$server->getDatabaseConnection(); + $this->mapper = \OC::$server->query(BackupCodeMapper::class); $this->resetDB(); } diff --git a/apps/twofactor_backupcodes/tests/Integration/Service/BackupCodeStorageTest.php b/apps/twofactor_backupcodes/tests/Integration/Service/BackupCodeStorageTest.php index 5517af5ce0d..934c44fb0db 100644 --- a/apps/twofactor_backupcodes/tests/Integration/Service/BackupCodeStorageTest.php +++ b/apps/twofactor_backupcodes/tests/Integration/Service/BackupCodeStorageTest.php @@ -22,7 +22,6 @@ namespace OCA\TwoFactor_BackupCodes\Tests\Integration\Service; -use OC; use OCA\TwoFactor_BackupCodes\Service\BackupCodeStorage; use Test\TestCase; @@ -40,7 +39,7 @@ class BackupCodeStorageTest extends TestCase { protected function setUp() { parent::setUp(); - $this->storage = OC::$server->query(BackupCodeStorage::class); + $this->storage = \OC::$server->query(BackupCodeStorage::class); } public function testSimpleWorkFlow() { diff --git a/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php b/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php index 57c262e1940..1ebf445bb0f 100644 --- a/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php +++ b/apps/twofactor_backupcodes/tests/Unit/Service/BackupCodeStorageTest.php @@ -32,13 +32,13 @@ use Test\TestCase; class BackupCodeStorageTest extends TestCase { - /** @var BackupCodeMapper|PHPUnit_Framework_MockObject_MockObject */ + /** @var BackupCodeMapper|\PHPUnit_Framework_MockObject_MockObject */ private $mapper; - /** @var ISecureRandom|PHPUnit_Framework_MockObject_MockObject */ + /** @var ISecureRandom|\PHPUnit_Framework_MockObject_MockObject */ private $random; - /** @var IHasher|PHPUnit_Framework_MockObject_MockObject */ + /** @var IHasher|\PHPUnit_Framework_MockObject_MockObject */ private $hasher; /** @var BackupCodeStorage */ diff --git a/apps/updatenotification/l10n/cs_CZ.js b/apps/updatenotification/l10n/cs_CZ.js index 1380d8eba95..23af7c686d1 100644 --- a/apps/updatenotification/l10n/cs_CZ.js +++ b/apps/updatenotification/l10n/cs_CZ.js @@ -7,6 +7,7 @@ OC.L10N.register( "Nextcloud core" : "Nextcloud Core", "Update for %1$s to version %2$s is available." : "Je dostupná aktualizace pro %1$s na verzi %2$s.", "A new version is available: %s" : "Je dostupná nová verze: %s", + "Download now" : "Stáhnout nyní", "Your version is up to date." : "Používáte nejnovější verzi.", "Checked on %s" : "Zkontrolováno %s", "Update channel:" : "Aktualizovat kanál:", diff --git a/apps/updatenotification/l10n/cs_CZ.json b/apps/updatenotification/l10n/cs_CZ.json index f5137fe6695..95b10919df0 100644 --- a/apps/updatenotification/l10n/cs_CZ.json +++ b/apps/updatenotification/l10n/cs_CZ.json @@ -5,6 +5,7 @@ "Nextcloud core" : "Nextcloud Core", "Update for %1$s to version %2$s is available." : "Je dostupná aktualizace pro %1$s na verzi %2$s.", "A new version is available: %s" : "Je dostupná nová verze: %s", + "Download now" : "Stáhnout nyní", "Your version is up to date." : "Používáte nejnovější verzi.", "Checked on %s" : "Zkontrolováno %s", "Update channel:" : "Aktualizovat kanál:", diff --git a/apps/updatenotification/l10n/de.js b/apps/updatenotification/l10n/de.js index f0eea25d287..90a69f27780 100644 --- a/apps/updatenotification/l10n/de.js +++ b/apps/updatenotification/l10n/de.js @@ -7,6 +7,7 @@ OC.L10N.register( "Nextcloud core" : "Nextcloud Kern", "Update for %1$s to version %2$s is available." : "Ein Update von %1$s auf Version %2$s ist verfügbar.", "A new version is available: %s" : "Eine neue Version ist verfügbar: %s", + "Download now" : "Jetzt herunterladen", "Your version is up to date." : "Deine Version ist aktuell.", "Checked on %s" : "Geprüft am %s", "Update channel:" : "Update-Kanal:", diff --git a/apps/updatenotification/l10n/de.json b/apps/updatenotification/l10n/de.json index 462db15bd32..7215f2daa19 100644 --- a/apps/updatenotification/l10n/de.json +++ b/apps/updatenotification/l10n/de.json @@ -5,6 +5,7 @@ "Nextcloud core" : "Nextcloud Kern", "Update for %1$s to version %2$s is available." : "Ein Update von %1$s auf Version %2$s ist verfügbar.", "A new version is available: %s" : "Eine neue Version ist verfügbar: %s", + "Download now" : "Jetzt herunterladen", "Your version is up to date." : "Deine Version ist aktuell.", "Checked on %s" : "Geprüft am %s", "Update channel:" : "Update-Kanal:", diff --git a/apps/updatenotification/l10n/de_DE.js b/apps/updatenotification/l10n/de_DE.js index 04ad9e9041c..ca7d72f4efe 100644 --- a/apps/updatenotification/l10n/de_DE.js +++ b/apps/updatenotification/l10n/de_DE.js @@ -7,6 +7,7 @@ OC.L10N.register( "Nextcloud core" : "Nextcloud Kern", "Update for %1$s to version %2$s is available." : "Ein Update von %1$s auf Version %2$s ist verfügbar.", "A new version is available: %s" : "Eine neue Version ist verfügbar: %s", + "Download now" : "Jetzt herunterladen", "Your version is up to date." : "Ihre Version ist aktuell.", "Checked on %s" : "Überprüft am %s", "Update channel:" : "Update-Kanal:", diff --git a/apps/updatenotification/l10n/de_DE.json b/apps/updatenotification/l10n/de_DE.json index fbcceda4c2c..32a40d1e3c2 100644 --- a/apps/updatenotification/l10n/de_DE.json +++ b/apps/updatenotification/l10n/de_DE.json @@ -5,6 +5,7 @@ "Nextcloud core" : "Nextcloud Kern", "Update for %1$s to version %2$s is available." : "Ein Update von %1$s auf Version %2$s ist verfügbar.", "A new version is available: %s" : "Eine neue Version ist verfügbar: %s", + "Download now" : "Jetzt herunterladen", "Your version is up to date." : "Ihre Version ist aktuell.", "Checked on %s" : "Überprüft am %s", "Update channel:" : "Update-Kanal:", diff --git a/apps/updatenotification/l10n/fr.js b/apps/updatenotification/l10n/fr.js index 61833cc2089..14f7c8c519f 100644 --- a/apps/updatenotification/l10n/fr.js +++ b/apps/updatenotification/l10n/fr.js @@ -6,6 +6,7 @@ OC.L10N.register( "Nextcloud core" : "Noyau Nextcloud", "Update for %1$s to version %2$s is available." : "Une mise à jour de %1$s vers la version %2$s est disponible.", "A new version is available: %s" : "Une nouvelle version est disponible : %s", + "Download now" : "Télécharger maintenant", "Your version is up to date." : "Votre version est à jour.", "Checked on %s" : "Vérifié le %s", "Update channel:" : "Canal de mise à jour :", diff --git a/apps/updatenotification/l10n/fr.json b/apps/updatenotification/l10n/fr.json index ef53a3c6589..8b9361978ae 100644 --- a/apps/updatenotification/l10n/fr.json +++ b/apps/updatenotification/l10n/fr.json @@ -4,6 +4,7 @@ "Nextcloud core" : "Noyau Nextcloud", "Update for %1$s to version %2$s is available." : "Une mise à jour de %1$s vers la version %2$s est disponible.", "A new version is available: %s" : "Une nouvelle version est disponible : %s", + "Download now" : "Télécharger maintenant", "Your version is up to date." : "Votre version est à jour.", "Checked on %s" : "Vérifié le %s", "Update channel:" : "Canal de mise à jour :", diff --git a/apps/updatenotification/l10n/hu_HU.js b/apps/updatenotification/l10n/hu_HU.js index cce4549f01e..968e8e7274f 100644 --- a/apps/updatenotification/l10n/hu_HU.js +++ b/apps/updatenotification/l10n/hu_HU.js @@ -3,15 +3,15 @@ OC.L10N.register( { "Update notifications" : "Frissítési értesítés", "{version} is available. Get more information on how to update." : "{version} rendelkezésre áll. További információ a frissítéshez.", - "Updated channel" : "Frissített csatorna", - "ownCloud core" : "ownCloud mag", + "Channel updated" : "Csatorna frissítve", + "Nextcloud core" : "Nextcloud mag", "Update for %1$s to version %2$s is available." : "%1$s frissíthető %2$s verzióra.", - "Updater" : "Frissítéskezelő", "A new version is available: %s" : "Új verzió érhető el: %s", - "Open updater" : "Frissítő megnyitása", + "Download now" : "Letöltés most", "Your version is up to date." : "Verzió frissítve.", "Checked on %s" : "Ellenőrizve: %s", "Update channel:" : "Frissítési csatorna:", - "You can always update to a newer version / experimental channel. But you can never downgrade to a more stable channel." : "Mindig frissíthetsz az újabb verzióra vagy kísérleti csatornára, de visszafelé sosem frissíthetsz egy jóval stabilabb verzióra." + "You can always update to a newer version / experimental channel. But you can never downgrade to a more stable channel." : "Mindig frissíthetsz az újabb verzióra vagy kísérleti csatornára, de visszafelé sosem frissíthetsz egy jóval stabilabb verzióra.", + "Updater" : "Frissítéskezelő" }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/updatenotification/l10n/hu_HU.json b/apps/updatenotification/l10n/hu_HU.json index 952b499d52a..6dbc0536a31 100644 --- a/apps/updatenotification/l10n/hu_HU.json +++ b/apps/updatenotification/l10n/hu_HU.json @@ -1,15 +1,15 @@ { "translations": { "Update notifications" : "Frissítési értesítés", "{version} is available. Get more information on how to update." : "{version} rendelkezésre áll. További információ a frissítéshez.", - "Updated channel" : "Frissített csatorna", - "ownCloud core" : "ownCloud mag", + "Channel updated" : "Csatorna frissítve", + "Nextcloud core" : "Nextcloud mag", "Update for %1$s to version %2$s is available." : "%1$s frissíthető %2$s verzióra.", - "Updater" : "Frissítéskezelő", "A new version is available: %s" : "Új verzió érhető el: %s", - "Open updater" : "Frissítő megnyitása", + "Download now" : "Letöltés most", "Your version is up to date." : "Verzió frissítve.", "Checked on %s" : "Ellenőrizve: %s", "Update channel:" : "Frissítési csatorna:", - "You can always update to a newer version / experimental channel. But you can never downgrade to a more stable channel." : "Mindig frissíthetsz az újabb verzióra vagy kísérleti csatornára, de visszafelé sosem frissíthetsz egy jóval stabilabb verzióra." + "You can always update to a newer version / experimental channel. But you can never downgrade to a more stable channel." : "Mindig frissíthetsz az újabb verzióra vagy kísérleti csatornára, de visszafelé sosem frissíthetsz egy jóval stabilabb verzióra.", + "Updater" : "Frissítéskezelő" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/updatenotification/l10n/is.js b/apps/updatenotification/l10n/is.js index 088002b3d0f..321ac5d187d 100644 --- a/apps/updatenotification/l10n/is.js +++ b/apps/updatenotification/l10n/is.js @@ -7,6 +7,7 @@ OC.L10N.register( "Nextcloud core" : "Nextcloud kjarni", "Update for %1$s to version %2$s is available." : "Upfærsla %1$s í útgáfu %2$s er tiltæk.", "A new version is available: %s" : "Ný útgáfa er tiltæk: %s", + "Download now" : "Sækja núna", "Your version is up to date." : "Útgáfan þín er af nýjustu gerð.", "Checked on %s" : "Athugað þann %s", "Update channel:" : "Uppfærslurás:", diff --git a/apps/updatenotification/l10n/is.json b/apps/updatenotification/l10n/is.json index dffe445f297..f556061e97c 100644 --- a/apps/updatenotification/l10n/is.json +++ b/apps/updatenotification/l10n/is.json @@ -5,6 +5,7 @@ "Nextcloud core" : "Nextcloud kjarni", "Update for %1$s to version %2$s is available." : "Upfærsla %1$s í útgáfu %2$s er tiltæk.", "A new version is available: %s" : "Ný útgáfa er tiltæk: %s", + "Download now" : "Sækja núna", "Your version is up to date." : "Útgáfan þín er af nýjustu gerð.", "Checked on %s" : "Athugað þann %s", "Update channel:" : "Uppfærslurás:", diff --git a/apps/updatenotification/l10n/nl.js b/apps/updatenotification/l10n/nl.js index 89ee44bafb4..cc5c1ee3fcd 100644 --- a/apps/updatenotification/l10n/nl.js +++ b/apps/updatenotification/l10n/nl.js @@ -3,9 +3,11 @@ OC.L10N.register( { "Update notifications" : "Bijwerken meldingen", "{version} is available. Get more information on how to update." : "{version} is beschikbaar. Meer informatie over het bijwerken.", + "Channel updated" : "Kanaal bijgewerkt", "Nextcloud core" : "Nextcloud core", "Update for %1$s to version %2$s is available." : "Update voor %1$s naar versie %2$s is beschikbaar.", "A new version is available: %s" : "Er is een nieuwe versie beschikbaar: %s", + "Download now" : "Download nu", "Your version is up to date." : "Je versie is up to date.", "Checked on %s" : "Gecontroleerd op %s", "Update channel:" : "Bijwerkkanaal:", diff --git a/apps/updatenotification/l10n/nl.json b/apps/updatenotification/l10n/nl.json index 3437220cd31..b907300c2e1 100644 --- a/apps/updatenotification/l10n/nl.json +++ b/apps/updatenotification/l10n/nl.json @@ -1,9 +1,11 @@ { "translations": { "Update notifications" : "Bijwerken meldingen", "{version} is available. Get more information on how to update." : "{version} is beschikbaar. Meer informatie over het bijwerken.", + "Channel updated" : "Kanaal bijgewerkt", "Nextcloud core" : "Nextcloud core", "Update for %1$s to version %2$s is available." : "Update voor %1$s naar versie %2$s is beschikbaar.", "A new version is available: %s" : "Er is een nieuwe versie beschikbaar: %s", + "Download now" : "Download nu", "Your version is up to date." : "Je versie is up to date.", "Checked on %s" : "Gecontroleerd op %s", "Update channel:" : "Bijwerkkanaal:", diff --git a/apps/updatenotification/l10n/ru.js b/apps/updatenotification/l10n/ru.js index 7546a3a0cbc..940cf041f6d 100644 --- a/apps/updatenotification/l10n/ru.js +++ b/apps/updatenotification/l10n/ru.js @@ -3,9 +3,11 @@ OC.L10N.register( { "Update notifications" : "Уведомления об обновлениях", "{version} is available. Get more information on how to update." : "Доступна версия {version}. Получить дополнительную информацию о порядке обновления.", + "Channel updated" : "Канал обновлен.", "Nextcloud core" : "Nextcloud core", "Update for %1$s to version %2$s is available." : "Доступно обновление для %1$s до версии %2$s.", "A new version is available: %s" : "Доступна новая версия: %s", + "Download now" : "Скачать сейчас", "Your version is up to date." : "Версия не требует обновления.", "Checked on %s" : "Проверено %s", "Update channel:" : "Канал обновлений:", diff --git a/apps/updatenotification/l10n/ru.json b/apps/updatenotification/l10n/ru.json index 0fb8d3ded66..623e1303a00 100644 --- a/apps/updatenotification/l10n/ru.json +++ b/apps/updatenotification/l10n/ru.json @@ -1,9 +1,11 @@ { "translations": { "Update notifications" : "Уведомления об обновлениях", "{version} is available. Get more information on how to update." : "Доступна версия {version}. Получить дополнительную информацию о порядке обновления.", + "Channel updated" : "Канал обновлен.", "Nextcloud core" : "Nextcloud core", "Update for %1$s to version %2$s is available." : "Доступно обновление для %1$s до версии %2$s.", "A new version is available: %s" : "Доступна новая версия: %s", + "Download now" : "Скачать сейчас", "Your version is up to date." : "Версия не требует обновления.", "Checked on %s" : "Проверено %s", "Update channel:" : "Канал обновлений:", diff --git a/apps/updatenotification/lib/AppInfo/Application.php b/apps/updatenotification/lib/AppInfo/Application.php index aefed9cca5c..5eba176f312 100644 --- a/apps/updatenotification/lib/AppInfo/Application.php +++ b/apps/updatenotification/lib/AppInfo/Application.php @@ -24,7 +24,6 @@ namespace OCA\UpdateNotification\AppInfo; use OC\AppFramework\Utility\TimeFactory; -use OC\Updater; use OCA\UpdateNotification\Controller\AdminController; use OCA\UpdateNotification\UpdateChecker; use OCP\AppFramework\App; diff --git a/apps/user_ldap/lib/Command/CreateEmptyConfig.php b/apps/user_ldap/lib/Command/CreateEmptyConfig.php index 53cc4cbf466..28d3a1d8bff 100644 --- a/apps/user_ldap/lib/Command/CreateEmptyConfig.php +++ b/apps/user_ldap/lib/Command/CreateEmptyConfig.php @@ -25,11 +25,11 @@ namespace OCA\User_LDAP\Command; +use OCA\User_LDAP\Configuration; +use OCA\User_LDAP\Helper; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use \OCA\User_LDAP\Helper; -use \OCA\User_LDAP\Configuration; class CreateEmptyConfig extends Command { /** @var \OCA\User_LDAP\Helper */ diff --git a/apps/user_ldap/lib/Command/DeleteConfig.php b/apps/user_ldap/lib/Command/DeleteConfig.php index a986dd6be77..e39425f3faa 100644 --- a/apps/user_ldap/lib/Command/DeleteConfig.php +++ b/apps/user_ldap/lib/Command/DeleteConfig.php @@ -25,11 +25,12 @@ namespace OCA\User_LDAP\Command; + +use OCA\User_LDAP\Helper; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use \OCA\User_LDAP\Helper; class DeleteConfig extends Command { /** @var \OCA\User_LDAP\Helper */ diff --git a/apps/user_ldap/lib/Jobs/CleanUp.php b/apps/user_ldap/lib/Jobs/CleanUp.php index 21c3ece8662..b91fed14dd6 100644 --- a/apps/user_ldap/lib/Jobs/CleanUp.php +++ b/apps/user_ldap/lib/Jobs/CleanUp.php @@ -24,13 +24,13 @@ namespace OCA\User_LDAP\Jobs; -use \OC\BackgroundJob\TimedJob; -use \OCA\User_LDAP\User_LDAP; -use \OCA\User_LDAP\User_Proxy; -use \OCA\User_LDAP\Helper; -use \OCA\User_LDAP\LDAP; -use \OCA\User_LDAP\User\DeletedUsersIndex; -use \OCA\User_LDAP\Mapping\UserMapping; +use OC\BackgroundJob\TimedJob; +use OCA\User_LDAP\Helper; +use OCA\User_LDAP\LDAP; +use OCA\User_LDAP\Mapping\UserMapping; +use OCA\User_LDAP\User_LDAP; +use OCA\User_LDAP\User_Proxy; +use OCA\User_LDAP\User\DeletedUsersIndex; /** * Class CleanUp diff --git a/apps/user_ldap/lib/LDAPProvider.php b/apps/user_ldap/lib/LDAPProvider.php index 5bd6a0fd08c..bf8691006c6 100644 --- a/apps/user_ldap/lib/LDAPProvider.php +++ b/apps/user_ldap/lib/LDAPProvider.php @@ -22,12 +22,11 @@ namespace OCA\User_LDAP; -use OCP\IUserBackend; + use OCP\LDAP\ILDAPProvider; use OCP\LDAP\IDeletionFlagSupport; use OCP\IServerContainer; use OCA\User_LDAP\User\DeletedUsersIndex; -use OCA\User_LDAP\Mapping\UserMapping; /** * LDAP provider for pulic access to the LDAP backend. diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php index 08e7c9f79f5..f89af2423a9 100644 --- a/apps/user_ldap/tests/AccessTest.php +++ b/apps/user_ldap/tests/AccessTest.php @@ -27,7 +27,6 @@ namespace OCA\User_LDAP\Tests; use OCA\User_LDAP\Access; -use OCA\User_LDAP\Connection; use OCA\User_LDAP\FilesystemHelper; use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\LogWrapper; diff --git a/apps/user_ldap/tests/Group_LDAPTest.php b/apps/user_ldap/tests/Group_LDAPTest.php index 12f7eaa2256..17ed5909bfb 100644 --- a/apps/user_ldap/tests/Group_LDAPTest.php +++ b/apps/user_ldap/tests/Group_LDAPTest.php @@ -29,8 +29,6 @@ namespace OCA\User_LDAP\Tests; use OCA\User_LDAP\Group_LDAP as GroupLDAP; -use OCA\User_LDAP\Access; -use OCA\User_LDAP\Connection; use OCA\User_LDAP\ILDAPWrapper; /** diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php index 0e08998d13b..f5ffb7f9907 100644 --- a/apps/user_ldap/tests/User_LDAPTest.php +++ b/apps/user_ldap/tests/User_LDAPTest.php @@ -32,8 +32,6 @@ use OCA\User_LDAP\FilesystemHelper; use OCA\User_LDAP\ILDAPWrapper; use OCA\User_LDAP\LogWrapper; use OCA\User_LDAP\User_LDAP as UserLDAP; -use \OCA\User_LDAP\Access; -use \OCA\User_LDAP\Connection; use OCP\IAvatarManager; use OCP\IConfig; use OCP\IDBConnection; |