diff options
Diffstat (limited to 'apps')
176 files changed, 2052 insertions, 300 deletions
diff --git a/apps/dav/appinfo/info.xml b/apps/dav/appinfo/info.xml index 38878ec27f2..8f378f5e18d 100644 --- a/apps/dav/appinfo/info.xml +++ b/apps/dav/appinfo/info.xml @@ -5,7 +5,7 @@ <description>ownCloud WebDAV endpoint</description> <licence>AGPL</licence> <author>owncloud.org</author> - <version>0.1</version> + <version>0.1.1</version> <requiremin>9.0</requiremin> <shipped>true</shipped> <standalone/> @@ -16,6 +16,7 @@ <remote> <files>appinfo/v1/webdav.php</files> <webdav>appinfo/v1/webdav.php</webdav> + <dav>appinfo/v2/remote.php</dav> </remote> <public> <webdav>appinfo/v1/publicwebdav.php</webdav> diff --git a/apps/dav/appinfo/v1/webdav.php b/apps/dav/appinfo/v1/webdav.php index 610230fc816..f28736f1f01 100644 --- a/apps/dav/appinfo/v1/webdav.php +++ b/apps/dav/appinfo/v1/webdav.php @@ -44,7 +44,10 @@ $serverFactory = new \OCA\DAV\Connector\Sabre\ServerFactory( ); // Backends -$authBackend = new \OCA\DAV\Connector\Sabre\Auth(); +$authBackend = new \OCA\DAV\Connector\Sabre\Auth( + \OC::$server->getSession(), + \OC::$server->getUserSession() +); $requestUri = \OC::$server->getRequest()->getRequestUri(); $server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, function() { diff --git a/apps/dav/appinfo/v2/remote.php b/apps/dav/appinfo/v2/remote.php new file mode 100644 index 00000000000..02457bd3ccc --- /dev/null +++ b/apps/dav/appinfo/v2/remote.php @@ -0,0 +1,11 @@ +<?php + +// no php execution timeout for webdav +set_time_limit(0); + +// Turn off output buffering to prevent memory problems +\OC_Util::obEnd(); + +$request = \OC::$server->getRequest(); +$server = new \OCA\DAV\Server($request, $baseuri); +$server->exec(); diff --git a/apps/dav/lib/connector/sabre/auth.php b/apps/dav/lib/connector/sabre/auth.php index 2e52a179d29..39a7df31b7f 100644 --- a/apps/dav/lib/connector/sabre/auth.php +++ b/apps/dav/lib/connector/sabre/auth.php @@ -30,6 +30,8 @@ namespace OCA\DAV\Connector\Sabre; use Exception; +use OCP\ISession; +use OCP\IUserSession; use Sabre\DAV\Auth\Backend\AbstractBasic; use Sabre\DAV\Exception\NotAuthenticated; use Sabre\DAV\Exception\ServiceUnavailable; @@ -37,6 +39,21 @@ use Sabre\DAV\Exception\ServiceUnavailable; class Auth extends AbstractBasic { const DAV_AUTHENTICATED = 'AUTHENTICATED_TO_DAV_BACKEND'; + /** @var ISession */ + private $session; + /** @var IUserSession */ + private $userSession; + + /** + * @param ISession $session + * @param IUserSession $userSession + */ + public function __construct(ISession $session, + IUserSession $userSession) { + $this->session = $session; + $this->userSession = $userSession; + } + /** * Whether the user has initially authenticated via DAV * @@ -49,8 +66,8 @@ class Auth extends AbstractBasic { * @return bool */ protected function isDavAuthenticated($username) { - return !is_null(\OC::$server->getSession()->get(self::DAV_AUTHENTICATED)) && - \OC::$server->getSession()->get(self::DAV_AUTHENTICATED) === $username; + return !is_null($this->session->get(self::DAV_AUTHENTICATED)) && + $this->session->get(self::DAV_AUTHENTICATED) === $username; } /** @@ -64,24 +81,21 @@ class Auth extends AbstractBasic { * @return bool */ protected function validateUserPass($username, $password) { - if (\OC_User::isLoggedIn() && - $this->isDavAuthenticated(\OC_User::getUser()) + if ($this->userSession->isLoggedIn() && + $this->isDavAuthenticated($this->userSession->getUser()->getUID()) ) { - \OC_Util::setupFS(\OC_User::getUser()); - \OC::$server->getSession()->close(); + \OC_Util::setupFS($this->userSession->getUser()->getUID()); + $this->session->close(); return true; } else { \OC_Util::setUpFS(); //login hooks may need early access to the filesystem - if(\OC_User::login($username, $password)) { - // make sure we use ownCloud's internal username here - // and not the HTTP auth supplied one, see issue #14048 - $ocUser = \OC_User::getUser(); - \OC_Util::setUpFS($ocUser); - \OC::$server->getSession()->set(self::DAV_AUTHENTICATED, $ocUser); - \OC::$server->getSession()->close(); + if($this->userSession->login($username, $password)) { + \OC_Util::setUpFS($this->userSession->getUser()->getUID()); + $this->session->set(self::DAV_AUTHENTICATED, $this->userSession->getUser()->getUID()); + $this->session->close(); return true; } else { - \OC::$server->getSession()->close(); + $this->session->close(); return false; } } @@ -95,10 +109,15 @@ class Auth extends AbstractBasic { * @return string|null */ public function getCurrentUser() { - $user = \OC_User::getUser(); - if($user && $this->isDavAuthenticated($user)) { + $user = $this->userSession->getUser() ? $this->userSession->getUser()->getUID() : null; + if($user !== null && $this->isDavAuthenticated($user)) { return $user; } + + if($user !== null && is_null($this->session->get(self::DAV_AUTHENTICATED))) { + return $user; + } + return null; } @@ -114,9 +133,9 @@ class Auth extends AbstractBasic { * @param string $realm * @return bool * @throws ServiceUnavailable + * @throws NotAuthenticated */ public function authenticate(\Sabre\DAV\Server $server, $realm) { - try { $result = $this->auth($server, $realm); return $result; @@ -136,12 +155,12 @@ class Auth extends AbstractBasic { */ private function auth(\Sabre\DAV\Server $server, $realm) { if (\OC_User::handleApacheAuth() || - (\OC_User::isLoggedIn() && is_null(\OC::$server->getSession()->get(self::DAV_AUTHENTICATED))) + ($this->userSession->isLoggedIn() && is_null($this->session->get(self::DAV_AUTHENTICATED))) ) { - $user = \OC_User::getUser(); + $user = $this->userSession->getUser()->getUID(); \OC_Util::setupFS($user); $this->currentUser = $user; - \OC::$server->getSession()->close(); + $this->session->close(); return true; } diff --git a/apps/dav/lib/connector/sabre/file.php b/apps/dav/lib/connector/sabre/file.php index 9e515cdc687..961532daf50 100644 --- a/apps/dav/lib/connector/sabre/file.php +++ b/apps/dav/lib/connector/sabre/file.php @@ -349,6 +349,7 @@ class File extends Node implements IFile { if (empty($info)) { throw new NotImplemented('Invalid chunk name'); } + $chunk_handler = new \OC_FileChunking($info); $bytesWritten = $chunk_handler->store($info['index'], $data); @@ -376,15 +377,17 @@ class File extends Node implements IFile { $exists = $this->fileView->file_exists($targetPath); try { - $this->emitPreHooks($exists, $targetPath); + $this->fileView->lockFile($targetPath, ILockingProvider::LOCK_SHARED); - $this->changeLock(ILockingProvider::LOCK_EXCLUSIVE); + $this->emitPreHooks($exists, $targetPath); + $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_EXCLUSIVE); + /** @var \OC\Files\Storage\Storage $targetStorage */ + list($targetStorage, $targetInternalPath) = $this->fileView->resolvePath($targetPath); if ($needsPartFile) { // we first assembly the target file as a part file $partFile = $path . '/' . $info['name'] . '.ocTransferId' . $info['transferid'] . '.part'; - - + /** @var \OC\Files\Storage\Storage $targetStorage */ list($partStorage, $partInternalPath) = $this->fileView->resolvePath($partFile); @@ -392,8 +395,7 @@ class File extends Node implements IFile { // here is the final atomic rename $renameOkay = $targetStorage->moveFromStorage($partStorage, $partInternalPath, $targetInternalPath); - - $fileExists = $this->fileView->file_exists($targetPath); + $fileExists = $targetStorage->file_exists($targetInternalPath); if ($renameOkay === false || $fileExists === false) { \OCP\Util::writeLog('webdav', '\OC\Files\Filesystem::rename() failed', \OCP\Util::ERROR); // only delete if an error occurred and the target file was already created @@ -403,7 +405,7 @@ class File extends Node implements IFile { $partFile = null; $targetStorage->unlink($targetInternalPath); } - $this->changeLock(ILockingProvider::LOCK_SHARED); + $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED); throw new Exception('Could not rename part file assembled from chunks'); } } else { @@ -419,7 +421,7 @@ class File extends Node implements IFile { } } - $this->changeLock(ILockingProvider::LOCK_SHARED); + $this->fileView->changeLock($targetPath, ILockingProvider::LOCK_SHARED); // since we skipped the view we need to scan and emit the hooks ourselves $this->fileView->getUpdater()->update($targetPath); @@ -427,6 +429,9 @@ class File extends Node implements IFile { $this->emitPostHooks($exists, $targetPath); $info = $this->fileView->getFileInfo($targetPath); + + $this->fileView->unlockFile($targetPath, ILockingProvider::LOCK_SHARED); + return $info->getEtag(); } catch (\Exception $e) { if ($partFile !== null) { diff --git a/apps/dav/lib/connector/sabre/filesplugin.php b/apps/dav/lib/connector/sabre/filesplugin.php index c9fc78a795f..61b5360cac1 100644 --- a/apps/dav/lib/connector/sabre/filesplugin.php +++ b/apps/dav/lib/connector/sabre/filesplugin.php @@ -132,6 +132,10 @@ class FilesPlugin extends \Sabre\DAV\ServerPlugin { if ($sourceDir !== $destinationDir) { $sourceFileInfo = $this->fileView->getFileInfo($source); + if ($sourceFileInfo === false) { + throw new \Sabre\DAV\Exception\NotFound($source . ' does not exist'); + } + if (!$sourceFileInfo->isDeletable()) { throw new \Sabre\DAV\Exception\Forbidden($source . " cannot be deleted"); } diff --git a/apps/dav/lib/connector/sabre/lockplugin.php b/apps/dav/lib/connector/sabre/lockplugin.php index c564e066f8e..5840e59854c 100644 --- a/apps/dav/lib/connector/sabre/lockplugin.php +++ b/apps/dav/lib/connector/sabre/lockplugin.php @@ -62,7 +62,7 @@ class LockPlugin extends ServerPlugin { public function getLock(RequestInterface $request) { // we cant listen on 'beforeMethod:PUT' due to order of operations with setting up the tree // so instead we limit ourselves to the PUT method manually - if ($request->getMethod() !== 'PUT') { + if ($request->getMethod() !== 'PUT' || isset($_SERVER['HTTP_OC_CHUNKED'])) { return; } try { @@ -80,7 +80,7 @@ class LockPlugin extends ServerPlugin { } public function releaseLock(RequestInterface $request) { - if ($request->getMethod() !== 'PUT') { + if ($request->getMethod() !== 'PUT' || isset($_SERVER['HTTP_OC_CHUNKED'])) { return; } try { diff --git a/apps/dav/lib/files/custompropertiesbackend.php b/apps/dav/lib/files/custompropertiesbackend.php new file mode 100644 index 00000000000..83776997a52 --- /dev/null +++ b/apps/dav/lib/files/custompropertiesbackend.php @@ -0,0 +1,271 @@ +<?php +/** + * @author Lukas Reschke <lukas@owncloud.com> + * @author Morris Jobke <hey@morrisjobke.de> + * @author Thomas Müller <thomas.mueller@tmit.eu> + * @author Vincent Petry <pvince81@owncloud.com> + * + * @copyright Copyright (c) 2015, 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\Files; + +use OCP\IDBConnection; +use OCP\IUser; +use Sabre\DAV\PropertyStorage\Backend\BackendInterface; +use Sabre\DAV\PropFind; +use Sabre\DAV\PropPatch; +use Sabre\DAV\Tree; + +class CustomPropertiesBackend implements BackendInterface { + + /** + * Ignored properties + * + * @var array + */ + private $ignoredProperties = array( + '{DAV:}getcontentlength', + '{DAV:}getcontenttype', + '{DAV:}getetag', + '{DAV:}quota-used-bytes', + '{DAV:}quota-available-bytes', + '{DAV:}quota-available-bytes', + '{http://owncloud.org/ns}permissions', + '{http://owncloud.org/ns}downloadURL', + '{http://owncloud.org/ns}dDC', + '{http://owncloud.org/ns}size', + ); + + /** + * @var Tree + */ + private $tree; + + /** + * @var IDBConnection + */ + private $connection; + + /** + * @var IUser + */ + private $user; + + /** + * Properties cache + * + * @var array + */ + private $cache = []; + + /** + * @param Tree $tree node tree + * @param IDBConnection $connection database connection + * @param IUser $user owner of the tree and properties + */ + public function __construct( + Tree $tree, + IDBConnection $connection, + IUser $user) { + $this->tree = $tree; + $this->connection = $connection; + $this->user = $user->getUID(); + } + + /** + * Fetches properties for a path. + * + * @param string $path + * @param PropFind $propFind + * @return void + */ + public function propFind($path, PropFind $propFind) { + + $requestedProps = $propFind->get404Properties(); + + // these might appear + $requestedProps = array_diff( + $requestedProps, + $this->ignoredProperties + ); + + if (empty($requestedProps)) { + return; + } + + $props = $this->getProperties($path, $requestedProps); + foreach ($props as $propName => $propValue) { + $propFind->set($propName, $propValue); + } + } + + /** + * Updates properties for a path + * + * @param string $path + * @param PropPatch $propPatch + * + * @return void + */ + public function propPatch($path, PropPatch $propPatch) { + $propPatch->handleRemaining(function($changedProps) use ($path) { + return $this->updateProperties($path, $changedProps); + }); + } + + /** + * This method is called after a node is deleted. + * + * @param string $path path of node for which to delete properties + */ + public function delete($path) { + $statement = $this->connection->prepare( + 'DELETE FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?' + ); + $statement->execute(array($this->user, $path)); + $statement->closeCursor(); + + unset($this->cache[$path]); + } + + /** + * This method is called after a successful MOVE + * + * @param string $source + * @param string $destination + * + * @return void + */ + public function move($source, $destination) { + $statement = $this->connection->prepare( + 'UPDATE `*PREFIX*properties` SET `propertypath` = ?' . + ' WHERE `userid` = ? AND `propertypath` = ?' + ); + $statement->execute(array($destination, $this->user, $source)); + $statement->closeCursor(); + } + + /** + * Returns a list of properties for this nodes.; + * @param string $path + * @param array $requestedProperties requested properties or empty array for "all" + * @return array + * @note The properties list is a list of propertynames the client + * requested, encoded as xmlnamespace#tagName, for example: + * http://www.example.org/namespace#author If the array is empty, all + * properties should be returned + */ + private function getProperties($path, array $requestedProperties) { + if (isset($this->cache[$path])) { + return $this->cache[$path]; + } + + // TODO: chunking if more than 1000 properties + $sql = 'SELECT * FROM `*PREFIX*properties` WHERE `userid` = ? AND `propertypath` = ?'; + + $whereValues = array($this->user, $path); + $whereTypes = array(null, null); + + if (!empty($requestedProperties)) { + // request only a subset + $sql .= ' AND `propertyname` in (?)'; + $whereValues[] = $requestedProperties; + $whereTypes[] = \Doctrine\DBAL\Connection::PARAM_STR_ARRAY; + } + + $result = $this->connection->executeQuery( + $sql, + $whereValues, + $whereTypes + ); + + $props = []; + while ($row = $result->fetch()) { + $props[$row['propertyname']] = $row['propertyvalue']; + } + + $result->closeCursor(); + + $this->cache[$path] = $props; + return $props; + } + + /** + * Update properties + * + * @param string $path node for which to update properties + * @param array $properties array of properties to update + * + * @return bool + */ + private function updateProperties($path, $properties) { + + $deleteStatement = 'DELETE FROM `*PREFIX*properties`' . + ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?'; + + $insertStatement = 'INSERT INTO `*PREFIX*properties`' . + ' (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)'; + + $updateStatement = 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ?' . + ' WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?'; + + // TODO: use "insert or update" strategy ? + $existing = $this->getProperties($path, array()); + $this->connection->beginTransaction(); + foreach ($properties as $propertyName => $propertyValue) { + // If it was null, we need to delete the property + if (is_null($propertyValue)) { + if (array_key_exists($propertyName, $existing)) { + $this->connection->executeUpdate($deleteStatement, + array( + $this->user, + $path, + $propertyName + ) + ); + } + } else { + if (!array_key_exists($propertyName, $existing)) { + $this->connection->executeUpdate($insertStatement, + array( + $this->user, + $path, + $propertyName, + $propertyValue + ) + ); + } else { + $this->connection->executeUpdate($updateStatement, + array( + $propertyValue, + $this->user, + $path, + $propertyName + ) + ); + } + } + } + + $this->connection->commit(); + unset($this->cache[$path]); + + return true; + } + +} diff --git a/apps/dav/lib/files/fileshome.php b/apps/dav/lib/files/fileshome.php new file mode 100644 index 00000000000..5e145a2b002 --- /dev/null +++ b/apps/dav/lib/files/fileshome.php @@ -0,0 +1,80 @@ +<?php + +namespace OCA\DAV\Files; + +use OCA\DAV\Connector\Sabre\Directory; +use Sabre\DAV\Exception\Forbidden; +use Sabre\DAV\ICollection; +use Sabre\DAV\SimpleCollection; +use Sabre\HTTP\URLUtil; + +class FilesHome implements ICollection { + + /** + * FilesHome constructor. + * + * @param array $principalInfo + */ + public function __construct($principalInfo) { + $this->principalInfo = $principalInfo; + } + + function createFile($name, $data = null) { + return $this->impl()->createFile($name, $data); + } + + function createDirectory($name) { + $this->impl()->createDirectory($name); + } + + function getChild($name) { + return $this->impl()->getChild($name); + } + + function getChildren() { + return $this->impl()->getChildren(); + } + + function childExists($name) { + return $this->impl()->childExists($name); + } + + function delete() { + $this->impl()->delete(); + } + + function getName() { + list(,$name) = URLUtil::splitPath($this->principalInfo['uri']); + return $name; + } + + function setName($name) { + throw new Forbidden('Permission denied to rename this folder'); + } + + /** + * Returns the last modification time, as a unix timestamp + * + * @return int + */ + function getLastModified() { + return $this->impl()->getLastModified(); + } + + /** + * @return Directory + */ + private function impl() { + // + // TODO: we need to mount filesystem of the give user + // + $user = \OC::$server->getUserSession()->getUser(); + if ($this->getName() !== $user->getUID()) { + return new SimpleCollection($this->getName()); + } + $view = \OC\Files\Filesystem::getView(); + $rootInfo = $view->getFileInfo(''); + $impl = new Directory($view, $rootInfo); + return $impl; + } +} diff --git a/apps/dav/lib/files/rootcollection.php b/apps/dav/lib/files/rootcollection.php new file mode 100644 index 00000000000..bbe3c784a53 --- /dev/null +++ b/apps/dav/lib/files/rootcollection.php @@ -0,0 +1,28 @@ +<?php + +namespace OCA\DAV\Files; + +use Sabre\DAVACL\AbstractPrincipalCollection; +use Sabre\DAVACL\IPrincipal; + +class RootCollection extends AbstractPrincipalCollection { + + /** + * This method returns a node for a principal. + * + * The passed array contains principal information, and is guaranteed to + * at least contain a uri item. Other properties may or may not be + * supplied by the authentication backend. + * + * @param array $principalInfo + * @return IPrincipal + */ + function getChildForPrincipal(array $principalInfo) { + return new FilesHome($principalInfo); + } + + function getName() { + return 'files'; + } + +} diff --git a/apps/dav/lib/rootcollection.php b/apps/dav/lib/rootcollection.php new file mode 100644 index 00000000000..7de2c2aabe3 --- /dev/null +++ b/apps/dav/lib/rootcollection.php @@ -0,0 +1,34 @@ +<?php + +namespace OCA\DAV; + +use OCA\DAV\Connector\Sabre\Principal; +use Sabre\CalDAV\Principal\Collection; +use Sabre\DAV\SimpleCollection; + +class RootCollection extends SimpleCollection { + + public function __construct() { + $config = \OC::$server->getConfig(); + $principalBackend = new Principal( + $config, + \OC::$server->getUserManager() + ); + // as soon as debug mode is enabled we allow listing of principals + $disableListing = !$config->getSystemValue('debug', false); + + // setup the first level of the dav tree + $principalCollection = new Collection($principalBackend); + $principalCollection->disableListing = $disableListing; + $filesCollection = new Files\RootCollection($principalBackend); + $filesCollection->disableListing = $disableListing; + + $children = [ + $principalCollection, + $filesCollection, + ]; + + parent::__construct('root', $children); + } + +} diff --git a/apps/dav/lib/server.php b/apps/dav/lib/server.php new file mode 100644 index 00000000000..055c5a5fc2c --- /dev/null +++ b/apps/dav/lib/server.php @@ -0,0 +1,57 @@ +<?php + +namespace OCA\DAV; + +use OCA\DAV\Connector\Sabre\Auth; +use OCA\DAV\Connector\Sabre\BlockLegacyClientPlugin; +use OCA\DAV\Files\CustomPropertiesBackend; +use OCP\IRequest; +use Sabre\DAV\Auth\Plugin; +use Sabre\HTTP\Util; + +class Server { + + /** @var IRequest */ + private $request; + + public function __construct(IRequest $request, $baseUri) { + $this->request = $request; + $this->baseUri = $baseUri; + $root = new RootCollection(); + $this->server = new \OCA\DAV\Connector\Sabre\Server($root); + + // Backends + $authBackend = new Auth( + \OC::$server->getSession(), + \OC::$server->getUserSession() + ); + + // Set URL explicitly due to reverse-proxy situations + $this->server->httpRequest->setUrl($this->request->getRequestUri()); + $this->server->setBaseUri($this->baseUri); + + $this->server->addPlugin(new BlockLegacyClientPlugin(\OC::$server->getConfig())); + $this->server->addPlugin(new Plugin($authBackend, 'ownCloud')); + + // wait with registering these until auth is handled and the filesystem is setup + $this->server->on('beforeMethod', function () { + // custom properties plugin must be the last one + $user = \OC::$server->getUserSession()->getUser(); + if (!is_null($user)) { + $this->server->addPlugin( + new \Sabre\DAV\PropertyStorage\Plugin( + new CustomPropertiesBackend( + $this->server->tree, + \OC::$server->getDatabaseConnection(), + \OC::$server->getUserSession()->getUser() + ) + ) + ); + } + }); + } + + public function exec() { + $this->server->exec(); + } +} diff --git a/apps/dav/tests/travis/litmus-v1.sh b/apps/dav/tests/travis/litmus-v1.sh new file mode 100644 index 00000000000..ab0690f392e --- /dev/null +++ b/apps/dav/tests/travis/litmus-v1.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +SCRIPT=`realpath $0` +SCRIPTPATH=`dirname $SCRIPT` + + +# start the server +php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../.." & + + +# 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 + +# run the tests +cd /tmp/litmus/litmus-0.13 +make URL=http://127.0.0.1:8888/remote.php/webdav CREDS="admin admin" TESTS="basic copymove props locks" check diff --git a/apps/dav/tests/travis/litmus-v2.sh b/apps/dav/tests/travis/litmus-v2.sh new file mode 100644 index 00000000000..892ad327d3b --- /dev/null +++ b/apps/dav/tests/travis/litmus-v2.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +SCRIPT=`realpath $0` +SCRIPTPATH=`dirname $SCRIPT` + + +# start the server +php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../.." & + + +# 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 + +# run the tests +cd /tmp/litmus/litmus-0.13 +make URL=http://127.0.0.1:8888/remote.php/dav/files/admin CREDS="admin admin" TESTS="basic copymove props locks" check diff --git a/apps/dav/tests/unit/connector/sabre/auth.php b/apps/dav/tests/unit/connector/sabre/auth.php new file mode 100644 index 00000000000..0466f3aab77 --- /dev/null +++ b/apps/dav/tests/unit/connector/sabre/auth.php @@ -0,0 +1,356 @@ +<?php +/** + * @author Lukas Reschke <lukas@owncloud.com> + * + * @copyright Copyright (c) 2015, 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 Tests\Connector\Sabre; + +use Test\TestCase; +use OCP\ISession; +use OCP\IUserSession; + +/** + * Class Auth + * + * @package OCA\DAV\Connector\Sabre + */ +class Auth extends TestCase { + /** @var ISession */ + private $session; + /** @var \OCA\DAV\Connector\Sabre\Auth */ + private $auth; + /** @var IUserSession */ + private $userSession; + + public function setUp() { + parent::setUp(); + $this->session = $this->getMockBuilder('\OCP\ISession') + ->disableOriginalConstructor()->getMock(); + $this->userSession = $this->getMockBuilder('\OCP\IUserSession') + ->disableOriginalConstructor()->getMock(); + $this->auth = new \OCA\DAV\Connector\Sabre\Auth($this->session, $this->userSession); + } + + public function testIsDavAuthenticatedWithoutDavSession() { + $this->session + ->expects($this->once()) + ->method('get') + ->with('AUTHENTICATED_TO_DAV_BACKEND') + ->will($this->returnValue(null)); + + $this->assertFalse($this->invokePrivate($this->auth, 'isDavAuthenticated', ['MyTestUser'])); + } + + public function testIsDavAuthenticatedWithWrongDavSession() { + $this->session + ->expects($this->exactly(2)) + ->method('get') + ->with('AUTHENTICATED_TO_DAV_BACKEND') + ->will($this->returnValue('AnotherUser')); + + $this->assertFalse($this->invokePrivate($this->auth, 'isDavAuthenticated', ['MyTestUser'])); + } + + public function testIsDavAuthenticatedWithCorrectDavSession() { + $this->session + ->expects($this->exactly(2)) + ->method('get') + ->with('AUTHENTICATED_TO_DAV_BACKEND') + ->will($this->returnValue('MyTestUser')); + + $this->assertTrue($this->invokePrivate($this->auth, 'isDavAuthenticated', ['MyTestUser'])); + } + + public function testValidateUserPassOfAlreadyDAVAuthenticatedUser() { + $user = $this->getMockBuilder('\OCP\IUser') + ->disableOriginalConstructor() + ->getMock(); + $user->expects($this->exactly(2)) + ->method('getUID') + ->will($this->returnValue('MyTestUser')); + $this->userSession + ->expects($this->once()) + ->method('isLoggedIn') + ->will($this->returnValue(true)); + $this->userSession + ->expects($this->exactly(2)) + ->method('getUser') + ->will($this->returnValue($user)); + $this->session + ->expects($this->exactly(2)) + ->method('get') + ->with('AUTHENTICATED_TO_DAV_BACKEND') + ->will($this->returnValue('MyTestUser')); + $this->session + ->expects($this->once()) + ->method('close'); + + $this->assertTrue($this->invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); + } + + public function testValidateUserPassOfInvalidDAVAuthenticatedUser() { + $user = $this->getMockBuilder('\OCP\IUser') + ->disableOriginalConstructor() + ->getMock(); + $user->expects($this->once()) + ->method('getUID') + ->will($this->returnValue('MyTestUser')); + $this->userSession + ->expects($this->once()) + ->method('isLoggedIn') + ->will($this->returnValue(true)); + $this->userSession + ->expects($this->once()) + ->method('getUser') + ->will($this->returnValue($user)); + $this->session + ->expects($this->exactly(2)) + ->method('get') + ->with('AUTHENTICATED_TO_DAV_BACKEND') + ->will($this->returnValue('AnotherUser')); + $this->session + ->expects($this->once()) + ->method('close'); + + $this->assertFalse($this->invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); + } + + public function testValidateUserPassOfInvalidDAVAuthenticatedUserWithValidPassword() { + $user = $this->getMockBuilder('\OCP\IUser') + ->disableOriginalConstructor() + ->getMock(); + $user->expects($this->exactly(3)) + ->method('getUID') + ->will($this->returnValue('MyTestUser')); + $this->userSession + ->expects($this->once()) + ->method('isLoggedIn') + ->will($this->returnValue(true)); + $this->userSession + ->expects($this->exactly(3)) + ->method('getUser') + ->will($this->returnValue($user)); + $this->session + ->expects($this->exactly(2)) + ->method('get') + ->with('AUTHENTICATED_TO_DAV_BACKEND') + ->will($this->returnValue('AnotherUser')); + $this->userSession + ->expects($this->once()) + ->method('login') + ->with('MyTestUser', 'MyTestPassword') + ->will($this->returnValue(true)); + $this->session + ->expects($this->once()) + ->method('set') + ->with('AUTHENTICATED_TO_DAV_BACKEND', 'MyTestUser'); + $this->session + ->expects($this->once()) + ->method('close'); + + $this->assertTrue($this->invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); + } + + public function testValidateUserPassWithInvalidPassword() { + $this->userSession + ->expects($this->once()) + ->method('isLoggedIn') + ->will($this->returnValue(false)); + $this->userSession + ->expects($this->once()) + ->method('login') + ->with('MyTestUser', 'MyTestPassword') + ->will($this->returnValue(false)); + $this->session + ->expects($this->once()) + ->method('close'); + + $this->assertFalse($this->invokePrivate($this->auth, 'validateUserPass', ['MyTestUser', 'MyTestPassword'])); + } + + public function testGetCurrentUserWithoutBeingLoggedIn() { + $this->assertSame(null, $this->auth->getCurrentUser()); + } + + public function testGetCurrentUserWithValidDAVLogin() { + $user = $this->getMockBuilder('\OCP\IUser') + ->disableOriginalConstructor() + ->getMock(); + $user->expects($this->once()) + ->method('getUID') + ->will($this->returnValue('MyTestUser')); + $this->userSession + ->expects($this->exactly(2)) + ->method('getUser') + ->will($this->returnValue($user)); + $this->session + ->expects($this->exactly(2)) + ->method('get') + ->with('AUTHENTICATED_TO_DAV_BACKEND') + ->will($this->returnValue('MyTestUser')); + + $this->assertSame('MyTestUser', $this->auth->getCurrentUser()); + } + + public function testGetCurrentUserWithoutAnyDAVLogin() { + $user = $this->getMockBuilder('\OCP\IUser') + ->disableOriginalConstructor() + ->getMock(); + $user->expects($this->once()) + ->method('getUID') + ->will($this->returnValue('MyTestUser')); + $this->userSession + ->expects($this->exactly(2)) + ->method('getUser') + ->will($this->returnValue($user)); + $this->session + ->expects($this->exactly(2)) + ->method('get') + ->with('AUTHENTICATED_TO_DAV_BACKEND') + ->will($this->returnValue(null)); + + $this->assertSame('MyTestUser', $this->auth->getCurrentUser()); + } + + public function testGetCurrentUserWithWrongDAVUser() { + $user = $this->getMockBuilder('\OCP\IUser') + ->disableOriginalConstructor() + ->getMock(); + $user->expects($this->once()) + ->method('getUID') + ->will($this->returnValue('MyWrongDavUser')); + $this->userSession + ->expects($this->exactly(2)) + ->method('getUser') + ->will($this->returnValue($user)); + $this->session + ->expects($this->exactly(3)) + ->method('get') + ->with('AUTHENTICATED_TO_DAV_BACKEND') + ->will($this->returnValue('AnotherUser')); + + $this->assertSame(null, $this->auth->getCurrentUser()); + } + + public function testAuthenticateAlreadyLoggedIn() { + $server = $this->getMockBuilder('\Sabre\DAV\Server') + ->disableOriginalConstructor() + ->getMock(); + $this->userSession + ->expects($this->once()) + ->method('isLoggedIn') + ->will($this->returnValue(true)); + $this->session + ->expects($this->once()) + ->method('get') + ->with('AUTHENTICATED_TO_DAV_BACKEND') + ->will($this->returnValue(null)); + $user = $this->getMockBuilder('\OCP\IUser') + ->disableOriginalConstructor() + ->getMock(); + $user->expects($this->once()) + ->method('getUID') + ->will($this->returnValue('MyWrongDavUser')); + $this->userSession + ->expects($this->once()) + ->method('getUser') + ->will($this->returnValue($user)); + $this->session + ->expects($this->once()) + ->method('close'); + + $this->assertTrue($this->auth->authenticate($server, 'TestRealm')); + } + + /** + * @expectedException \Sabre\DAV\Exception\NotAuthenticated + * @expectedExceptionMessage No basic authentication headers were found + */ + public function testAuthenticateNoBasicAuthenticateHeadersProvided() { + $server = $this->getMockBuilder('\Sabre\DAV\Server') + ->disableOriginalConstructor() + ->getMock(); + $server->httpRequest = $this->getMockBuilder('\Sabre\HTTP\RequestInterface') + ->disableOriginalConstructor() + ->getMock(); + $server->httpResponse = $this->getMockBuilder('\Sabre\HTTP\ResponseInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->auth->authenticate($server, 'TestRealm'); + } + + public function testAuthenticateValidCredentials() { + $server = $this->getMockBuilder('\Sabre\DAV\Server') + ->disableOriginalConstructor() + ->getMock(); + $server->httpRequest = $this->getMockBuilder('\Sabre\HTTP\RequestInterface') + ->disableOriginalConstructor() + ->getMock(); + $server->httpRequest + ->expects($this->once()) + ->method('getHeader') + ->with('Authorization') + ->will($this->returnValue('basic dXNlcm5hbWU6cGFzc3dvcmQ=')); + $server->httpResponse = $this->getMockBuilder('\Sabre\HTTP\ResponseInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->userSession + ->expects($this->once()) + ->method('login') + ->with('username', 'password') + ->will($this->returnValue(true)); + $user = $this->getMockBuilder('\OCP\IUser') + ->disableOriginalConstructor() + ->getMock(); + $user->expects($this->exactly(2)) + ->method('getUID') + ->will($this->returnValue('MyTestUser')); + $this->userSession + ->expects($this->exactly(2)) + ->method('getUser') + ->will($this->returnValue($user)); + $this->assertTrue($this->auth->authenticate($server, 'TestRealm')); + } + + /** + * @expectedException \Sabre\DAV\Exception\NotAuthenticated + * @expectedExceptionMessage Username or password does not match + */ + public function testAuthenticateInvalidCredentials() { + $server = $this->getMockBuilder('\Sabre\DAV\Server') + ->disableOriginalConstructor() + ->getMock(); + $server->httpRequest = $this->getMockBuilder('\Sabre\HTTP\RequestInterface') + ->disableOriginalConstructor() + ->getMock(); + $server->httpRequest + ->expects($this->once()) + ->method('getHeader') + ->with('Authorization') + ->will($this->returnValue('basic dXNlcm5hbWU6cGFzc3dvcmQ=')); + $server->httpResponse = $this->getMockBuilder('\Sabre\HTTP\ResponseInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->userSession + ->expects($this->once()) + ->method('login') + ->with('username', 'password') + ->will($this->returnValue(false)); + $this->auth->authenticate($server, 'TestRealm'); + } +} diff --git a/apps/dav/tests/unit/connector/sabre/file.php b/apps/dav/tests/unit/connector/sabre/file.php index 9171fc3b786..d874b7f33c2 100644 --- a/apps/dav/tests/unit/connector/sabre/file.php +++ b/apps/dav/tests/unit/connector/sabre/file.php @@ -200,7 +200,9 @@ class File extends \Test\TestCase { $file = new \OCA\DAV\Connector\Sabre\File($view, $info); // put first chunk + $file->acquireLock(ILockingProvider::LOCK_SHARED); $this->assertNull($file->put('test data one')); + $file->releaseLock(ILockingProvider::LOCK_SHARED); $info = new \OC\Files\FileInfo('/test.txt-chunking-12345-2-1', null, null, [ 'permissions' => \OCP\Constants::PERMISSION_ALL @@ -443,12 +445,12 @@ class File extends \Test\TestCase { $thrown = false; try { // beforeMethod locks - $view->lockFile('/test.txt', ILockingProvider::LOCK_SHARED); + $file->acquireLock(ILockingProvider::LOCK_SHARED); $file->put($this->getStream('test data')); // afterMethod unlocks - $view->unlockFile('/test.txt', ILockingProvider::LOCK_SHARED); + $file->releaseLock(ILockingProvider::LOCK_SHARED); } catch (\Sabre\DAV\Exception\BadRequest $e) { $thrown = true; } @@ -505,7 +507,9 @@ class File extends \Test\TestCase { 'permissions' => \OCP\Constants::PERMISSION_ALL ], null); $file = new \OCA\DAV\Connector\Sabre\File($view, $info); + $file->acquireLock(ILockingProvider::LOCK_SHARED); $this->assertNull($file->put('test data one')); + $file->releaseLock(ILockingProvider::LOCK_SHARED); $info = new \OC\Files\FileInfo('/' . $this->user . '/files/test.txt-chunking-12345-2-1', null, null, [ 'permissions' => \OCP\Constants::PERMISSION_ALL @@ -515,7 +519,9 @@ class File extends \Test\TestCase { // action $thrown = false; try { + $file->acquireLock(ILockingProvider::LOCK_SHARED); $file->put($this->getStream('test data')); + $file->releaseLock(ILockingProvider::LOCK_SHARED); } catch (\OCA\DAV\Connector\Sabre\Exception\FileLocked $e) { $thrown = true; } diff --git a/apps/dav/tests/unit/connector/sabre/filesplugin.php b/apps/dav/tests/unit/connector/sabre/filesplugin.php index a91ca7a4ff7..db3bbabefd0 100644 --- a/apps/dav/tests/unit/connector/sabre/filesplugin.php +++ b/apps/dav/tests/unit/connector/sabre/filesplugin.php @@ -251,4 +251,17 @@ class FilesPlugin extends \Test\TestCase { $this->plugin->checkMove('FolderA/test.txt', 'test.txt'); } + + /** + * @expectedException \Sabre\DAV\Exception\NotFound + * @expectedExceptionMessage FolderA/test.txt does not exist + */ + public function testMoveSrcNotExist() { + $this->view->expects($this->once()) + ->method('getFileInfo') + ->with('FolderA/test.txt') + ->willReturn(false); + + $this->plugin->checkMove('FolderA/test.txt', 'test.txt'); + } } diff --git a/apps/dav/tests/unit/connector/sabre/requesttest/uploadtest.php b/apps/dav/tests/unit/connector/sabre/requesttest/uploadtest.php index 9a067f230a3..a2a8326f4ff 100644 --- a/apps/dav/tests/unit/connector/sabre/requesttest/uploadtest.php +++ b/apps/dav/tests/unit/connector/sabre/requesttest/uploadtest.php @@ -8,7 +8,9 @@ namespace OCA\DAV\Tests\Unit\Connector\Sabre\RequestTest; -use OC\AppFramework\Http; +use OC\Connector\Sabre\Exception\FileLocked; +use OCP\AppFramework\Http; +use OCP\Lock\ILockingProvider; class UploadTest extends RequestTest { public function testBasicUpload() { @@ -43,6 +45,34 @@ class UploadTest extends RequestTest { $this->assertEquals(3, $info->getSize()); } + /** + * @expectedException \OCA\DAV\Connector\Sabre\Exception\FileLocked + */ + public function testUploadOverWriteReadLocked() { + $user = $this->getUniqueID(); + $view = $this->setupUser($user, 'pass'); + + $view->file_put_contents('foo.txt', 'bar'); + + $view->lockFile('/foo.txt', ILockingProvider::LOCK_SHARED); + + $this->request($view, $user, 'pass', 'PUT', '/foo.txt', 'asd'); + } + + /** + * @expectedException \OCA\DAV\Connector\Sabre\Exception\FileLocked + */ + public function testUploadOverWriteWriteLocked() { + $user = $this->getUniqueID(); + $view = $this->setupUser($user, 'pass'); + + $view->file_put_contents('foo.txt', 'bar'); + + $view->lockFile('/foo.txt', ILockingProvider::LOCK_EXCLUSIVE); + + $this->request($view, $user, 'pass', 'PUT', '/foo.txt', 'asd'); + } + public function testChunkedUpload() { $user = $this->getUniqueID(); $view = $this->setupUser($user, 'pass'); @@ -107,4 +137,54 @@ class UploadTest extends RequestTest { $this->assertInstanceOf('\OC\Files\FileInfo', $info); $this->assertEquals(6, $info->getSize()); } + + /** + * @expectedException \OCA\DAV\Connector\Sabre\Exception\FileLocked + */ + public function testChunkedUploadOutOfOrderReadLocked() { + $user = $this->getUniqueID(); + $view = $this->setupUser($user, 'pass'); + + $this->assertFalse($view->file_exists('foo.txt')); + + $view->lockFile('/foo.txt', ILockingProvider::LOCK_SHARED); + + try { + $response = $this->request($view, $user, 'pass', 'PUT', '/foo.txt-chunking-123-2-1', 'bar', ['OC-Chunked' => '1']); + } catch (\OCA\DAV\Connector\Sabre\Exception\FileLocked $e) { + $this->fail('Didn\'t expect locked error for the first chunk on read lock'); + return; + } + + $this->assertEquals(Http::STATUS_CREATED, $response->getStatus()); + $this->assertFalse($view->file_exists('foo.txt')); + + // last chunk should trigger the locked error since it tries to assemble + $this->request($view, $user, 'pass', 'PUT', '/foo.txt-chunking-123-2-0', 'asd', ['OC-Chunked' => '1']); + } + + /** + * @expectedException \OCA\DAV\Connector\Sabre\Exception\FileLocked + */ + public function testChunkedUploadOutOfOrderWriteLocked() { + $user = $this->getUniqueID(); + $view = $this->setupUser($user, 'pass'); + + $this->assertFalse($view->file_exists('foo.txt')); + + $view->lockFile('/foo.txt', ILockingProvider::LOCK_EXCLUSIVE); + + try { + $response = $this->request($view, $user, 'pass', 'PUT', '/foo.txt-chunking-123-2-1', 'bar', ['OC-Chunked' => '1']); + } catch (\OCA\DAV\Connector\Sabre\Exception\FileLocked $e) { + $this->fail('Didn\'t expect locked error for the first chunk on write lock'); // maybe forbid this in the future for write locks only? + return; + } + + $this->assertEquals(Http::STATUS_CREATED, $response->getStatus()); + $this->assertFalse($view->file_exists('foo.txt')); + + // last chunk should trigger the locked error since it tries to assemble + $this->request($view, $user, 'pass', 'PUT', '/foo.txt-chunking-123-2-0', 'asd', ['OC-Chunked' => '1']); + } } diff --git a/apps/encryption/appinfo/application.php b/apps/encryption/appinfo/application.php index 812f1042a8f..6275047252e 100644 --- a/apps/encryption/appinfo/application.php +++ b/apps/encryption/appinfo/application.php @@ -201,7 +201,8 @@ class Application extends \OCP\AppFramework\App { $c->query('KeyManager'), $c->query('Crypt'), $c->query('Session'), - $server->getSession() + $server->getSession(), + $c->query('Util') ); }); diff --git a/apps/encryption/appinfo/routes.php b/apps/encryption/appinfo/routes.php index 8fa163d0751..260337361e8 100644 --- a/apps/encryption/appinfo/routes.php +++ b/apps/encryption/appinfo/routes.php @@ -36,6 +36,11 @@ namespace OCA\Encryption\AppInfo; 'verb' => 'POST' ], [ + 'name' => 'Settings#setEncryptHomeStorage', + 'url' => '/ajax/setEncryptHomeStorage', + 'verb' => 'POST' + ], + [ 'name' => 'Recovery#changeRecoveryPassword', 'url' => '/ajax/changeRecoveryPassword', 'verb' => 'POST' diff --git a/apps/encryption/controller/settingscontroller.php b/apps/encryption/controller/settingscontroller.php index e5bb79a1d40..59e23087b3a 100644 --- a/apps/encryption/controller/settingscontroller.php +++ b/apps/encryption/controller/settingscontroller.php @@ -25,6 +25,7 @@ namespace OCA\Encryption\Controller; use OCA\Encryption\Crypto\Crypt; use OCA\Encryption\KeyManager; use OCA\Encryption\Session; +use OCA\Encryption\Util; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; @@ -57,6 +58,9 @@ class SettingsController extends Controller { /** @var ISession */ private $ocSession; + /** @var Util */ + private $util; + /** * @param string $AppName * @param IRequest $request @@ -67,6 +71,7 @@ class SettingsController extends Controller { * @param Crypt $crypt * @param Session $session * @param ISession $ocSession + * @param Util $util */ public function __construct($AppName, IRequest $request, @@ -76,7 +81,9 @@ class SettingsController extends Controller { KeyManager $keyManager, Crypt $crypt, Session $session, - ISession $ocSession) { + ISession $ocSession, + Util $util +) { parent::__construct($AppName, $request); $this->l = $l10n; $this->userSession = $userSession; @@ -85,6 +92,7 @@ class SettingsController extends Controller { $this->crypt = $crypt; $this->session = $session; $this->ocSession = $ocSession; + $this->util = $util; } @@ -143,4 +151,15 @@ class SettingsController extends Controller { } } + + /** + * @UseSession + * + * @param bool $encryptHomeStorage + * @return DataResponse + */ + public function setEncryptHomeStorage($encryptHomeStorage) { + $this->util->setEncryptHomeStorage($encryptHomeStorage); + return new DataResponse(); + } } diff --git a/apps/encryption/js/settings-admin.js b/apps/encryption/js/settings-admin.js index 39923718c21..9b00a4ec627 100644 --- a/apps/encryption/js/settings-admin.js +++ b/apps/encryption/js/settings-admin.js @@ -76,4 +76,13 @@ $(document).ready(function () { }); }); + $('#encryptHomeStorage').change(function() { + $.post( + OC.generateUrl('/apps/encryption/ajax/setEncryptHomeStorage'), + { + encryptHomeStorage: this.checked + } + ); + }); + }); diff --git a/apps/encryption/l10n/fr.js b/apps/encryption/l10n/fr.js index f6016cc3ce6..59a36a73d7b 100644 --- a/apps/encryption/l10n/fr.js +++ b/apps/encryption/l10n/fr.js @@ -32,6 +32,8 @@ OC.L10N.register( "The share will expire on %s." : "Le partage expirera le %s.", "Cheers!" : "À bientôt !", "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Bonjour,\n<br><br>\nL'administrateur a activé le chiffrement sur le serveur. Vos fichiers ont été chiffrés avec le mot de passe suivant :\n\n<p style=\"font-family: monospace;\"><b>%s</b></p>\n\n<p>\nVeuillez suivre ces instructions :\n<ol>\n<li>Connectez-vous à l'interface web et trouvez la section <em>\"Module de chiffrement de base d'ownCloud\"</em> dans vos paramètres personnels;</li>\n<li>Entrez le mot de passe fourni ci-dessus dans le champ <em>\"Ancien mot de passe de connexion\"</em>;</li>\n<li>Entrez le mot de passe que vous utilisez actuellement pour vous connecter dans le champ <em>\"Actuel mot de passe de connexion\"</em>;</li>\n<li>Validez en cliquant sur le bouton <em>\"Mettre à jour le mot de passe de votre clef privée\"</em>.</li>\n</ol>\n</p>", + "Encrypt the home storage" : "Chiffrer l'espace de stockage principal", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "L'activation de cette option chiffre tous les fichiers du stockage principal, sinon seuls les espaces de stockage externes seront chiffrés", "Enable recovery key" : "Activer la clé de récupération", "Disable recovery key" : "Désactiver la clé de récupération", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "La clé de récupération est une clé supplémentaire utilisée pour chiffrer les fichiers. Elle permet de récupérer les fichiers des utilisateurs s'ils oublient leur mot de passe.", diff --git a/apps/encryption/l10n/fr.json b/apps/encryption/l10n/fr.json index 54a7431db30..b1fcfb35b27 100644 --- a/apps/encryption/l10n/fr.json +++ b/apps/encryption/l10n/fr.json @@ -30,6 +30,8 @@ "The share will expire on %s." : "Le partage expirera le %s.", "Cheers!" : "À bientôt !", "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Bonjour,\n<br><br>\nL'administrateur a activé le chiffrement sur le serveur. Vos fichiers ont été chiffrés avec le mot de passe suivant :\n\n<p style=\"font-family: monospace;\"><b>%s</b></p>\n\n<p>\nVeuillez suivre ces instructions :\n<ol>\n<li>Connectez-vous à l'interface web et trouvez la section <em>\"Module de chiffrement de base d'ownCloud\"</em> dans vos paramètres personnels;</li>\n<li>Entrez le mot de passe fourni ci-dessus dans le champ <em>\"Ancien mot de passe de connexion\"</em>;</li>\n<li>Entrez le mot de passe que vous utilisez actuellement pour vous connecter dans le champ <em>\"Actuel mot de passe de connexion\"</em>;</li>\n<li>Validez en cliquant sur le bouton <em>\"Mettre à jour le mot de passe de votre clef privée\"</em>.</li>\n</ol>\n</p>", + "Encrypt the home storage" : "Chiffrer l'espace de stockage principal", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "L'activation de cette option chiffre tous les fichiers du stockage principal, sinon seuls les espaces de stockage externes seront chiffrés", "Enable recovery key" : "Activer la clé de récupération", "Disable recovery key" : "Désactiver la clé de récupération", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "La clé de récupération est une clé supplémentaire utilisée pour chiffrer les fichiers. Elle permet de récupérer les fichiers des utilisateurs s'ils oublient leur mot de passe.", diff --git a/apps/encryption/l10n/it.js b/apps/encryption/l10n/it.js index 9f94b409f57..699e4babd01 100644 --- a/apps/encryption/l10n/it.js +++ b/apps/encryption/l10n/it.js @@ -32,6 +32,8 @@ OC.L10N.register( "The share will expire on %s." : "La condivisione scadrà il %s.", "Cheers!" : "Saluti!", "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Ciao,<br><br>l'amministratore ha abilitato la cifratura lato server. I tuoi file sono stati cifrati utilizzando la password <strong>%s</strong>.<br><br>Accedi all'interfaccia web, vai alla sezione \"modulo di cifratura base di ownCloud\" dalle nelle tue impostazioni personali e aggiorna la tua password di cifratura digitando la password nel campo \"vecchia password di accesso\" e la tua nuova password.", + "Encrypt the home storage" : "Cifra l'archiviazione principale", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "L'abilitazione di questa opzione cifra tutti i file memorizzati sull'archiviazione principale, altrimenti saranno cifrati solo i file sull'archiviazione esterna.", "Enable recovery key" : "Abilita chiave di ripristino", "Disable recovery key" : "Disabilita chiave di ripristino", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "La chiave di ripristino è una chiave di cifratura aggiuntiva utilizzata per cifrare i file. Consente di ripristinare i file di un utente se l'utente dimentica la propria password.", diff --git a/apps/encryption/l10n/it.json b/apps/encryption/l10n/it.json index a117af8a317..b86893303c2 100644 --- a/apps/encryption/l10n/it.json +++ b/apps/encryption/l10n/it.json @@ -30,6 +30,8 @@ "The share will expire on %s." : "La condivisione scadrà il %s.", "Cheers!" : "Saluti!", "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Ciao,<br><br>l'amministratore ha abilitato la cifratura lato server. I tuoi file sono stati cifrati utilizzando la password <strong>%s</strong>.<br><br>Accedi all'interfaccia web, vai alla sezione \"modulo di cifratura base di ownCloud\" dalle nelle tue impostazioni personali e aggiorna la tua password di cifratura digitando la password nel campo \"vecchia password di accesso\" e la tua nuova password.", + "Encrypt the home storage" : "Cifra l'archiviazione principale", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "L'abilitazione di questa opzione cifra tutti i file memorizzati sull'archiviazione principale, altrimenti saranno cifrati solo i file sull'archiviazione esterna.", "Enable recovery key" : "Abilita chiave di ripristino", "Disable recovery key" : "Disabilita chiave di ripristino", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "La chiave di ripristino è una chiave di cifratura aggiuntiva utilizzata per cifrare i file. Consente di ripristinare i file di un utente se l'utente dimentica la propria password.", diff --git a/apps/encryption/l10n/ja.js b/apps/encryption/l10n/ja.js index 5c4f470def8..6babac76b2f 100644 --- a/apps/encryption/l10n/ja.js +++ b/apps/encryption/l10n/ja.js @@ -25,10 +25,13 @@ OC.L10N.register( "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." : "暗号化アプリの無効なプライベートキーです。あなたの暗号化されたファイルへアクセスするために、個人設定からプライベートキーのパスワードを更新してください。", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "暗号化アプリは有効ですが、あなたの暗号化キーは初期化されていません。ログアウトした後に、再度ログインしてください", "Encryption App is enabled and ready" : "暗号化アプリは有効になっており、準備が整いました", + "one-time password for server-side-encryption" : "サーバーサイド暗号化のワンタイムパスワード", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "このファイルを復号化できません、共有ファイルの可能性があります。ファイルの所有者にお願いして、ファイルを共有しなおしてもらってください。", "Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "このファイルを読み取ることができません、共有ファイルの可能性があります。ファイルの所有者にお願いして、ファイルを共有しなおしてもらってください。", + "Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'ownCloud basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "こんにちは、\n\n管理者がサーバーサイド暗号化を有効にしました。'%s'というパスワードであなたのファイルが暗号化されました。\n\nWeb画面からログインして、個人設定画面の'ownCloud 基本暗号化モジュール' セクションにいき、暗号化パスワードの更新をお願いします。 '旧ログインパスワード'部分に上記パスワードを入力し、現在のログインパスワードで更新します。\n", "The share will expire on %s." : "共有は %s で有効期限が切れます。", "Cheers!" : "それでは!", + "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "こんにちは、<br><br>管理者がサーバーサイド暗号化を有効にしました。<strong>%s</strong>というパスワードであなたのファイルが暗号化されました。<br><br>Web画面からログインして、個人設定画面の\"ownCloud 基本暗号化モジュール\"のセクションにいき、暗号化パスワードの更新をお願いします。 \"旧ログインパスワード”部分に上記パスワードを入力し、現在のログインパスワードで更新します。<br><br>", "Enable recovery key" : "復旧キーを有効にする", "Disable recovery key" : "復旧キーを無効にする", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "復旧キーは、ファイルの暗号化に使う特別な暗号化キーです。ユーザがパスワードを忘れてしまった場合には、リカバリキーを使ってユーザのファイルを復元することができます。", diff --git a/apps/encryption/l10n/ja.json b/apps/encryption/l10n/ja.json index 9e04dd87f83..9ae46a8d9c2 100644 --- a/apps/encryption/l10n/ja.json +++ b/apps/encryption/l10n/ja.json @@ -23,10 +23,13 @@ "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." : "暗号化アプリの無効なプライベートキーです。あなたの暗号化されたファイルへアクセスするために、個人設定からプライベートキーのパスワードを更新してください。", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "暗号化アプリは有効ですが、あなたの暗号化キーは初期化されていません。ログアウトした後に、再度ログインしてください", "Encryption App is enabled and ready" : "暗号化アプリは有効になっており、準備が整いました", + "one-time password for server-side-encryption" : "サーバーサイド暗号化のワンタイムパスワード", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "このファイルを復号化できません、共有ファイルの可能性があります。ファイルの所有者にお願いして、ファイルを共有しなおしてもらってください。", "Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "このファイルを読み取ることができません、共有ファイルの可能性があります。ファイルの所有者にお願いして、ファイルを共有しなおしてもらってください。", + "Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'ownCloud basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "こんにちは、\n\n管理者がサーバーサイド暗号化を有効にしました。'%s'というパスワードであなたのファイルが暗号化されました。\n\nWeb画面からログインして、個人設定画面の'ownCloud 基本暗号化モジュール' セクションにいき、暗号化パスワードの更新をお願いします。 '旧ログインパスワード'部分に上記パスワードを入力し、現在のログインパスワードで更新します。\n", "The share will expire on %s." : "共有は %s で有効期限が切れます。", "Cheers!" : "それでは!", + "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "こんにちは、<br><br>管理者がサーバーサイド暗号化を有効にしました。<strong>%s</strong>というパスワードであなたのファイルが暗号化されました。<br><br>Web画面からログインして、個人設定画面の\"ownCloud 基本暗号化モジュール\"のセクションにいき、暗号化パスワードの更新をお願いします。 \"旧ログインパスワード”部分に上記パスワードを入力し、現在のログインパスワードで更新します。<br><br>", "Enable recovery key" : "復旧キーを有効にする", "Disable recovery key" : "復旧キーを無効にする", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "復旧キーは、ファイルの暗号化に使う特別な暗号化キーです。ユーザがパスワードを忘れてしまった場合には、リカバリキーを使ってユーザのファイルを復元することができます。", diff --git a/apps/encryption/l10n/lt_LT.js b/apps/encryption/l10n/lt_LT.js index 627be83860b..a27747055dd 100644 --- a/apps/encryption/l10n/lt_LT.js +++ b/apps/encryption/l10n/lt_LT.js @@ -1,21 +1,46 @@ OC.L10N.register( "encryption", { + "Missing recovery key password" : "Nėra atstatymo rakto slaptažodžio", + "Please repeat the recovery key password" : "Pakartokite atstatymo rakto slaptažodį", + "Repeated recovery key password does not match the provided recovery key password" : "Pakartotas atstatymo rakto slaptažodis nesutampa su atstatymo rakto slaptažodžiu", "Recovery key successfully enabled" : "Atkūrimo raktas sėkmingai įjungtas", "Could not enable recovery key. Please check your recovery key password!" : "Neišėjo įjungti jūsų atkūrimo rakto. Prašome jį patikrinti!", "Recovery key successfully disabled" : "Atkūrimo raktas sėkmingai išjungtas", "Could not disable recovery key. Please check your recovery key password!" : "Neišėjo išjungti jūsų atkūrimo rakto. Prašome jį patikrinti!", + "Missing parameters" : "Trūksta parametrų", + "Please provide the old recovery password" : "Įveskite seną atstatymo slaptažodį", + "Please provide a new recovery password" : "Įveskite naują atstatymo slaptažodį", + "Please repeat the new recovery password" : "Pakartokite naują atstatymo slaptažodį", "Password successfully changed." : "Slaptažodis sėkmingai pakeistas", "Could not change the password. Maybe the old password was not correct." : "Slaptažodis nebuvo pakeistas. Gali būti, kad buvo neteisingai suvestas senasis.", + "Recovery Key disabled" : "Atstatymo raktas išjungtas", + "Recovery Key enabled" : "Atstatymo raktas įjungtas", + "Could not enable the recovery key, please try again or contact your administrator" : "Nepavyko įjungti atstatymo rakto, bandykite dar kartą arba susisiekite su administratoriumi", + "Could not update the private key password." : "Nepavyko atnaujinti privataus rakto slaptažodžio.", + "The old password was not correct, please try again." : "Neteisingas senas slaptažodis, pakartokite.", + "The current log-in password was not correct, please try again." : "Esamas prisijungimo slaptažodis neteisingas, bandykite dar kartą.", "Private key password successfully updated." : "Privataus rakto slaptažodis buvo sėkmingai atnaujintas.", + "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please run 'occ encryption:migrate' or contact your administrator" : "Reikalinga šifravimo raktų migracija iš senos versijos ( ownCloud <= 8.0) į naują. Įvykdykite komanda 'occ encryption:migrate' arba susisiekite su adminstratoriumi", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." : "Netinkamas privatus raktas Šifravimo programai. Prašome atnaujinti savo privataus rakto slaptažodį asmeniniuose nustatymuose, kad atkurti prieigą prie šifruotų failų.", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Šifravimo programa įjungta, bet Jūsų raktai nėra pritaikyti. Prašome atsijungti ir vėl prisijungti", + "Encryption App is enabled and ready" : "Šifravimo programėlė įjungta ir veikia", + "one-time password for server-side-encryption" : "Vienkartinis slaptažodis šifravimui serverio pusėje", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Failo iššifruoti nepavyko, gali būti jog jis yra pasidalintas su jumis. Paprašykite failo savininko, kad jums iš naujo pateiktų šį failą.", "The share will expire on %s." : "Bendrinimo laikas baigsis %s.", "Cheers!" : "Sveikinimai!", + "Enable recovery key" : "Įjungti atstatymo raktą", + "Disable recovery key" : "Išjungti atstatymo raktą", "Recovery key password" : "Atkūrimo rakto slaptažodis", + "Repeat recovery key password" : "Pakartokite atstatymo rakto slaptažodį", "Change recovery key password:" : "Pakeisti atkūrimo rakto slaptažodį:", + "Old recovery key password" : "Senas atstatymo rakto slaptažodis", + "New recovery key password" : "Naujas atstatymo rakto slaptažodis", + "Repeat new recovery key password" : "Pakartokite naują atstatymo rakto slaptažodį", "Change Password" : "Pakeisti slaptažodį", + "ownCloud basic encryption module" : "ownCloud bazinis šifravimo modulis", + "Your private key password no longer matches your log-in password." : "Privataus rakto slaptažodis nebe sutampa su prisijungimo slaptažodžiu.", + "Set your old private key password to your current log-in password:" : "Nustatyti Jūsų privataus rakto slaptažodį į Jūsų dabartinį slaptažodį.", " If you don't remember your old password you can ask your administrator to recover your files." : "Jei nepamenate savo seno slaptažodžio, galite paprašyti administratoriaus atkurti Jūsų failus.", "Old log-in password" : "Senas prisijungimo slaptažodis", "Current log-in password" : "Dabartinis prisijungimo slaptažodis", diff --git a/apps/encryption/l10n/lt_LT.json b/apps/encryption/l10n/lt_LT.json index 7a38dca5a97..b063eba7539 100644 --- a/apps/encryption/l10n/lt_LT.json +++ b/apps/encryption/l10n/lt_LT.json @@ -1,19 +1,44 @@ { "translations": { + "Missing recovery key password" : "Nėra atstatymo rakto slaptažodžio", + "Please repeat the recovery key password" : "Pakartokite atstatymo rakto slaptažodį", + "Repeated recovery key password does not match the provided recovery key password" : "Pakartotas atstatymo rakto slaptažodis nesutampa su atstatymo rakto slaptažodžiu", "Recovery key successfully enabled" : "Atkūrimo raktas sėkmingai įjungtas", "Could not enable recovery key. Please check your recovery key password!" : "Neišėjo įjungti jūsų atkūrimo rakto. Prašome jį patikrinti!", "Recovery key successfully disabled" : "Atkūrimo raktas sėkmingai išjungtas", "Could not disable recovery key. Please check your recovery key password!" : "Neišėjo išjungti jūsų atkūrimo rakto. Prašome jį patikrinti!", + "Missing parameters" : "Trūksta parametrų", + "Please provide the old recovery password" : "Įveskite seną atstatymo slaptažodį", + "Please provide a new recovery password" : "Įveskite naują atstatymo slaptažodį", + "Please repeat the new recovery password" : "Pakartokite naują atstatymo slaptažodį", "Password successfully changed." : "Slaptažodis sėkmingai pakeistas", "Could not change the password. Maybe the old password was not correct." : "Slaptažodis nebuvo pakeistas. Gali būti, kad buvo neteisingai suvestas senasis.", + "Recovery Key disabled" : "Atstatymo raktas išjungtas", + "Recovery Key enabled" : "Atstatymo raktas įjungtas", + "Could not enable the recovery key, please try again or contact your administrator" : "Nepavyko įjungti atstatymo rakto, bandykite dar kartą arba susisiekite su administratoriumi", + "Could not update the private key password." : "Nepavyko atnaujinti privataus rakto slaptažodžio.", + "The old password was not correct, please try again." : "Neteisingas senas slaptažodis, pakartokite.", + "The current log-in password was not correct, please try again." : "Esamas prisijungimo slaptažodis neteisingas, bandykite dar kartą.", "Private key password successfully updated." : "Privataus rakto slaptažodis buvo sėkmingai atnaujintas.", + "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please run 'occ encryption:migrate' or contact your administrator" : "Reikalinga šifravimo raktų migracija iš senos versijos ( ownCloud <= 8.0) į naują. Įvykdykite komanda 'occ encryption:migrate' arba susisiekite su adminstratoriumi", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." : "Netinkamas privatus raktas Šifravimo programai. Prašome atnaujinti savo privataus rakto slaptažodį asmeniniuose nustatymuose, kad atkurti prieigą prie šifruotų failų.", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "Šifravimo programa įjungta, bet Jūsų raktai nėra pritaikyti. Prašome atsijungti ir vėl prisijungti", + "Encryption App is enabled and ready" : "Šifravimo programėlė įjungta ir veikia", + "one-time password for server-side-encryption" : "Vienkartinis slaptažodis šifravimui serverio pusėje", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "Failo iššifruoti nepavyko, gali būti jog jis yra pasidalintas su jumis. Paprašykite failo savininko, kad jums iš naujo pateiktų šį failą.", "The share will expire on %s." : "Bendrinimo laikas baigsis %s.", "Cheers!" : "Sveikinimai!", + "Enable recovery key" : "Įjungti atstatymo raktą", + "Disable recovery key" : "Išjungti atstatymo raktą", "Recovery key password" : "Atkūrimo rakto slaptažodis", + "Repeat recovery key password" : "Pakartokite atstatymo rakto slaptažodį", "Change recovery key password:" : "Pakeisti atkūrimo rakto slaptažodį:", + "Old recovery key password" : "Senas atstatymo rakto slaptažodis", + "New recovery key password" : "Naujas atstatymo rakto slaptažodis", + "Repeat new recovery key password" : "Pakartokite naują atstatymo rakto slaptažodį", "Change Password" : "Pakeisti slaptažodį", + "ownCloud basic encryption module" : "ownCloud bazinis šifravimo modulis", + "Your private key password no longer matches your log-in password." : "Privataus rakto slaptažodis nebe sutampa su prisijungimo slaptažodžiu.", + "Set your old private key password to your current log-in password:" : "Nustatyti Jūsų privataus rakto slaptažodį į Jūsų dabartinį slaptažodį.", " If you don't remember your old password you can ask your administrator to recover your files." : "Jei nepamenate savo seno slaptažodžio, galite paprašyti administratoriaus atkurti Jūsų failus.", "Old log-in password" : "Senas prisijungimo slaptažodis", "Current log-in password" : "Dabartinis prisijungimo slaptažodis", diff --git a/apps/encryption/l10n/pt_BR.js b/apps/encryption/l10n/pt_BR.js index 09ed1910c1a..334bbf05282 100644 --- a/apps/encryption/l10n/pt_BR.js +++ b/apps/encryption/l10n/pt_BR.js @@ -32,6 +32,8 @@ OC.L10N.register( "The share will expire on %s." : "O compartilhamento irá expirar em %s.", "Cheers!" : "Saúde!", "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Olá,<br><br>o administrador habilitou criptografia-lado-servidor. Os seus arquivos foram criptografados usando a senha <strong>%s</strong>.<br><br>Por favor faça o login para a interface da Web, vá para a seção 'ownCloud módulo de criptografia básico' das suas definições pessoais e atualize sua senha de criptografia, inserindo esta senha no campo 'senha antiga de log-in' e sua atual senha-de-login..<br><br>", + "Encrypt the home storage" : "Criptografar a pasta de armazenamento home", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Ativar essa opção de criptografia para todos os arquivos armazenados no armazenamento principal, caso contrário, apenas arquivos no armazenamento externo serão criptografados", "Enable recovery key" : "Habilitar recuperação de chave", "Disable recovery key" : "Dasabilitar chave de recuperação", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "A chave de recuperação é uma chave de encriptação extra que é utilizada para encriptar arquivos. Ela permite a recuperação de arquivos de um usuário esquecer sua senha.", diff --git a/apps/encryption/l10n/pt_BR.json b/apps/encryption/l10n/pt_BR.json index 1682ec44b28..794eb478c74 100644 --- a/apps/encryption/l10n/pt_BR.json +++ b/apps/encryption/l10n/pt_BR.json @@ -30,6 +30,8 @@ "The share will expire on %s." : "O compartilhamento irá expirar em %s.", "Cheers!" : "Saúde!", "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Olá,<br><br>o administrador habilitou criptografia-lado-servidor. Os seus arquivos foram criptografados usando a senha <strong>%s</strong>.<br><br>Por favor faça o login para a interface da Web, vá para a seção 'ownCloud módulo de criptografia básico' das suas definições pessoais e atualize sua senha de criptografia, inserindo esta senha no campo 'senha antiga de log-in' e sua atual senha-de-login..<br><br>", + "Encrypt the home storage" : "Criptografar a pasta de armazenamento home", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Ativar essa opção de criptografia para todos os arquivos armazenados no armazenamento principal, caso contrário, apenas arquivos no armazenamento externo serão criptografados", "Enable recovery key" : "Habilitar recuperação de chave", "Disable recovery key" : "Dasabilitar chave de recuperação", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "A chave de recuperação é uma chave de encriptação extra que é utilizada para encriptar arquivos. Ela permite a recuperação de arquivos de um usuário esquecer sua senha.", diff --git a/apps/encryption/l10n/ru.js b/apps/encryption/l10n/ru.js index b326b71456d..ae2c1d1f4e0 100644 --- a/apps/encryption/l10n/ru.js +++ b/apps/encryption/l10n/ru.js @@ -32,6 +32,8 @@ OC.L10N.register( "The share will expire on %s." : "Доступ будет закрыт %s", "Cheers!" : "Всего наилучшего!", "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Привет,<br><br>администратор включил шифрование на стороне сервера. Ваши файлы были зашифрованы с помощью пароля <strong>%s</strong>.<br><br>Пожалуйста войдите в веб-приложение, в разделе \"ownCloud простой модуль шифрования\" в личных настройках вам нужно обновить пароль шифрования.<br><br>", + "Encrypt the home storage" : "Зашифровать домашнюю директорию", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Данный параметр позволяет зашифровать все файлы, хранящиеся в главном хранилище, иначе только файлы на внешних хранилищах будут зашифрованы", "Enable recovery key" : "Включить ключ восстановления", "Disable recovery key" : "Отключить ключ восстановления", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "Ключ восстановления это дополнительный ключ, который используется для шифрования файлов. Он позволяет восстановить пользовательские файлы в случае утери пароля.", diff --git a/apps/encryption/l10n/ru.json b/apps/encryption/l10n/ru.json index f4a14cb841f..87cb27d1e4a 100644 --- a/apps/encryption/l10n/ru.json +++ b/apps/encryption/l10n/ru.json @@ -30,6 +30,8 @@ "The share will expire on %s." : "Доступ будет закрыт %s", "Cheers!" : "Всего наилучшего!", "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Привет,<br><br>администратор включил шифрование на стороне сервера. Ваши файлы были зашифрованы с помощью пароля <strong>%s</strong>.<br><br>Пожалуйста войдите в веб-приложение, в разделе \"ownCloud простой модуль шифрования\" в личных настройках вам нужно обновить пароль шифрования.<br><br>", + "Encrypt the home storage" : "Зашифровать домашнюю директорию", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Данный параметр позволяет зашифровать все файлы, хранящиеся в главном хранилище, иначе только файлы на внешних хранилищах будут зашифрованы", "Enable recovery key" : "Включить ключ восстановления", "Disable recovery key" : "Отключить ключ восстановления", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "Ключ восстановления это дополнительный ключ, который используется для шифрования файлов. Он позволяет восстановить пользовательские файлы в случае утери пароля.", diff --git a/apps/encryption/l10n/sq.js b/apps/encryption/l10n/sq.js index d18e8bcbbfd..e608fb368f8 100644 --- a/apps/encryption/l10n/sq.js +++ b/apps/encryption/l10n/sq.js @@ -32,6 +32,8 @@ OC.L10N.register( "The share will expire on %s." : "Ndarja do të skadojë më %s.", "Cheers!" : "Gëzuar!", "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Njatjeta,<br><br>përgjegjësi aktivizoi fshehtëzim më anë shërbyesi. Kartelat tuaja qenë fshehtëzuar duke përdorur fjalëkalimin <strong>%s</strong>.<br><br>Ju lutemi, bëni hyrjen te ndërfaqja web, kaloni te ndarja \"modul i thjeshtë ownCloud për fshehtëzime\" e rregullimeve tuaja personale dhe përditësoni fjalëkalimin tuaj për fshehtëzime duke dhënë këtë fjalëkalim te fusha \"old log-in password\" dhe fjalëkalimin tuaj të tanishëm për hyrjet.<br><br>", + "Encrypt the home storage" : "Fshehtëzo depozitën bazë", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Aktivizimi i kësaj mundësie fshehtëzon krejt kartelat e depozituara në depon bazë, përndryshe do të fshehtëzohen vetëm kartelat në depozitën e jashtme", "Enable recovery key" : "Aktivizo kyç rimarrjesh", "Disable recovery key" : "Çaktivizo kyç rimarrjesh", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "Kyçi i rimarrjeve është një kyç ekstra fshehtëzimesh që përdoret për të fshehtëzuar kartela. Ai lejon rimarrjen e një kartele të përdoruesit, nëse përdoruesi harron fjalëkalimin e vet.", diff --git a/apps/encryption/l10n/sq.json b/apps/encryption/l10n/sq.json index 7415195f955..2319f03ae4f 100644 --- a/apps/encryption/l10n/sq.json +++ b/apps/encryption/l10n/sq.json @@ -30,6 +30,8 @@ "The share will expire on %s." : "Ndarja do të skadojë më %s.", "Cheers!" : "Gëzuar!", "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "Njatjeta,<br><br>përgjegjësi aktivizoi fshehtëzim më anë shërbyesi. Kartelat tuaja qenë fshehtëzuar duke përdorur fjalëkalimin <strong>%s</strong>.<br><br>Ju lutemi, bëni hyrjen te ndërfaqja web, kaloni te ndarja \"modul i thjeshtë ownCloud për fshehtëzime\" e rregullimeve tuaja personale dhe përditësoni fjalëkalimin tuaj për fshehtëzime duke dhënë këtë fjalëkalim te fusha \"old log-in password\" dhe fjalëkalimin tuaj të tanishëm për hyrjet.<br><br>", + "Encrypt the home storage" : "Fshehtëzo depozitën bazë", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "Aktivizimi i kësaj mundësie fshehtëzon krejt kartelat e depozituara në depon bazë, përndryshe do të fshehtëzohen vetëm kartelat në depozitën e jashtme", "Enable recovery key" : "Aktivizo kyç rimarrjesh", "Disable recovery key" : "Çaktivizo kyç rimarrjesh", "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "Kyçi i rimarrjeve është një kyç ekstra fshehtëzimesh që përdoret për të fshehtëzuar kartela. Ai lejon rimarrjen e një kartele të përdoruesit, nëse përdoruesi harron fjalëkalimin e vet.", diff --git a/apps/encryption/l10n/zh_TW.js b/apps/encryption/l10n/zh_TW.js index 17893b44b67..d0c1e3dfee8 100644 --- a/apps/encryption/l10n/zh_TW.js +++ b/apps/encryption/l10n/zh_TW.js @@ -1,21 +1,52 @@ OC.L10N.register( "encryption", { + "Missing recovery key password" : "遺失還原金鑰密碼", + "Please repeat the recovery key password" : "請您再輸入新的還原金鑰密碼一次", + "Repeated recovery key password does not match the provided recovery key password" : "輸入的還原金鑰密碼與設定的並不相符", "Recovery key successfully enabled" : "還原金鑰已成功開啟", "Could not enable recovery key. Please check your recovery key password!" : "無法啟用還原金鑰。請檢查您的還原金鑰密碼!", "Recovery key successfully disabled" : "還原金鑰已成功停用", "Could not disable recovery key. Please check your recovery key password!" : "無法停用還原金鑰。請檢查您的還原金鑰密碼!", + "Missing parameters" : "遺失參數", + "Please provide the old recovery password" : "請提供舊的還原密碼", + "Please provide a new recovery password" : "請提供新的還原密碼", + "Please repeat the new recovery password" : "請您再輸入新的還原密碼", "Password successfully changed." : "成功變更密碼。", "Could not change the password. Maybe the old password was not correct." : "無法變更密碼,或許是輸入的舊密碼不正確。", + "Recovery Key disabled" : "還原金鑰停用", + "Recovery Key enabled" : "還原金鑰啟用", + "Could not enable the recovery key, please try again or contact your administrator" : "無法啟用還原金鑰功能,請重試或聯絡系統管理員", + "Could not update the private key password." : "無法更新私人金鑰密碼", + "The old password was not correct, please try again." : "舊密碼不正確,請再試一次", + "The current log-in password was not correct, please try again." : "目前登入的密碼不正確,請再試一次", "Private key password successfully updated." : "私人金鑰密碼已成功更新。", + "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please run 'occ encryption:migrate' or contact your administrator" : "您需要搬移您的加密鑰匙從舊版的加密 (ownCloud <= 8.0) 到新版,請執行 'occ encryption:migrate' 或是聯絡系統管理員", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." : "無效的檔案加密私鑰,請在個人設定中更新您的私鑰密語以存取加密的檔案。", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "檔案加密已啓用,但是您的金鑰尚未初始化,請重新登入一次", + "Encryption App is enabled and ready" : "加密應用程式已經被啟用", + "one-time password for server-side-encryption" : "一次性密碼用於伺服器端的加密", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "無法解密這個檔案,也許這是分享的檔案。請詢問檔案所有人重新分享檔案給您。", + "Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "無法檢視這個檔案,或許這是分享的檔案,請詢問這個檔案的擁有者並請他重新分享給您。", + "Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'ownCloud basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "嗨,請看這裡,\n\n系管理員啟用了伺服器端的加密功能,您的檔案將會使用密碼 '%s' 加密\n\n請從網頁登入,到 'ownCloud basic encryption module' 設置您的個人設定並透過更新加密密碼,將這個組密碼設定在 'old log-in password' 以及您的目前登入密碼\n", "The share will expire on %s." : "這個分享將會於 %s 過期", "Cheers!" : "太棒了!", + "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "嗨,請看這裡,<br><br>系管理員啟用了伺服器端的加密功能,您的檔案將會使用密碼<strong> '%s' </strong>加密,請從網頁登入,到 'ownCloud basic encryption module' 設置您的個人設定並透過更新加密密碼,將這個組密碼設定在 'old log-in password' 以及您的目前登入密碼<br><br>", + "Encrypt the home storage" : "加密家目錄空間", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "請啟用這個功能以用來加密主要儲存空間的檔案,否則只有再外部儲存的檔案會加密", + "Enable recovery key" : "啟用還原金鑰", + "Disable recovery key" : "關閉還原金鑰", + "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "加密金鑰是另一種加密檔案方式,當使用者忘記密碼時,可以用還原金鑰來還原檔案", "Recovery key password" : "還原金鑰密碼", + "Repeat recovery key password" : "再輸入還原金鑰密碼一次", "Change recovery key password:" : "變更還原金鑰密碼:", + "Old recovery key password" : "舊的還原金鑰密碼", + "New recovery key password" : "新的還原金鑰密碼", + "Repeat new recovery key password" : "再輸入新的還原金鑰密碼一次", "Change Password" : "變更密碼", + "ownCloud basic encryption module" : "ownCloud 基本加密模組", + "Your private key password no longer matches your log-in password." : "您的私人金鑰密碼不符合您的登入密碼", + "Set your old private key password to your current log-in password:" : "設定您的舊私人金鑰密碼到您現在的登入密碼:", " If you don't remember your old password you can ask your administrator to recover your files." : "如果您忘記舊密碼,可以請求管理員協助取回檔案。", "Old log-in password" : "舊登入密碼", "Current log-in password" : "目前的登入密碼", diff --git a/apps/encryption/l10n/zh_TW.json b/apps/encryption/l10n/zh_TW.json index ce2e07228fc..feee736980f 100644 --- a/apps/encryption/l10n/zh_TW.json +++ b/apps/encryption/l10n/zh_TW.json @@ -1,19 +1,50 @@ { "translations": { + "Missing recovery key password" : "遺失還原金鑰密碼", + "Please repeat the recovery key password" : "請您再輸入新的還原金鑰密碼一次", + "Repeated recovery key password does not match the provided recovery key password" : "輸入的還原金鑰密碼與設定的並不相符", "Recovery key successfully enabled" : "還原金鑰已成功開啟", "Could not enable recovery key. Please check your recovery key password!" : "無法啟用還原金鑰。請檢查您的還原金鑰密碼!", "Recovery key successfully disabled" : "還原金鑰已成功停用", "Could not disable recovery key. Please check your recovery key password!" : "無法停用還原金鑰。請檢查您的還原金鑰密碼!", + "Missing parameters" : "遺失參數", + "Please provide the old recovery password" : "請提供舊的還原密碼", + "Please provide a new recovery password" : "請提供新的還原密碼", + "Please repeat the new recovery password" : "請您再輸入新的還原密碼", "Password successfully changed." : "成功變更密碼。", "Could not change the password. Maybe the old password was not correct." : "無法變更密碼,或許是輸入的舊密碼不正確。", + "Recovery Key disabled" : "還原金鑰停用", + "Recovery Key enabled" : "還原金鑰啟用", + "Could not enable the recovery key, please try again or contact your administrator" : "無法啟用還原金鑰功能,請重試或聯絡系統管理員", + "Could not update the private key password." : "無法更新私人金鑰密碼", + "The old password was not correct, please try again." : "舊密碼不正確,請再試一次", + "The current log-in password was not correct, please try again." : "目前登入的密碼不正確,請再試一次", "Private key password successfully updated." : "私人金鑰密碼已成功更新。", + "You need to migrate your encryption keys from the old encryption (ownCloud <= 8.0) to the new one. Please run 'occ encryption:migrate' or contact your administrator" : "您需要搬移您的加密鑰匙從舊版的加密 (ownCloud <= 8.0) 到新版,請執行 'occ encryption:migrate' 或是聯絡系統管理員", "Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files." : "無效的檔案加密私鑰,請在個人設定中更新您的私鑰密語以存取加密的檔案。", "Encryption App is enabled but your keys are not initialized, please log-out and log-in again" : "檔案加密已啓用,但是您的金鑰尚未初始化,請重新登入一次", + "Encryption App is enabled and ready" : "加密應用程式已經被啟用", + "one-time password for server-side-encryption" : "一次性密碼用於伺服器端的加密", "Can not decrypt this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "無法解密這個檔案,也許這是分享的檔案。請詢問檔案所有人重新分享檔案給您。", + "Can not read this file, probably this is a shared file. Please ask the file owner to reshare the file with you." : "無法檢視這個檔案,或許這是分享的檔案,請詢問這個檔案的擁有者並請他重新分享給您。", + "Hey there,\n\nthe admin enabled server-side-encryption. Your files were encrypted using the password '%s'.\n\nPlease login to the web interface, go to the section 'ownCloud basic encryption module' of your personal settings and update your encryption password by entering this password into the 'old log-in password' field and your current login-password.\n\n" : "嗨,請看這裡,\n\n系管理員啟用了伺服器端的加密功能,您的檔案將會使用密碼 '%s' 加密\n\n請從網頁登入,到 'ownCloud basic encryption module' 設置您的個人設定並透過更新加密密碼,將這個組密碼設定在 'old log-in password' 以及您的目前登入密碼\n", "The share will expire on %s." : "這個分享將會於 %s 過期", "Cheers!" : "太棒了!", + "Hey there,<br><br>the admin enabled server-side-encryption. Your files were encrypted using the password <strong>%s</strong>.<br><br>Please login to the web interface, go to the section \"ownCloud basic encryption module\" of your personal settings and update your encryption password by entering this password into the \"old log-in password\" field and your current login-password.<br><br>" : "嗨,請看這裡,<br><br>系管理員啟用了伺服器端的加密功能,您的檔案將會使用密碼<strong> '%s' </strong>加密,請從網頁登入,到 'ownCloud basic encryption module' 設置您的個人設定並透過更新加密密碼,將這個組密碼設定在 'old log-in password' 以及您的目前登入密碼<br><br>", + "Encrypt the home storage" : "加密家目錄空間", + "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" : "請啟用這個功能以用來加密主要儲存空間的檔案,否則只有再外部儲存的檔案會加密", + "Enable recovery key" : "啟用還原金鑰", + "Disable recovery key" : "關閉還原金鑰", + "The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password." : "加密金鑰是另一種加密檔案方式,當使用者忘記密碼時,可以用還原金鑰來還原檔案", "Recovery key password" : "還原金鑰密碼", + "Repeat recovery key password" : "再輸入還原金鑰密碼一次", "Change recovery key password:" : "變更還原金鑰密碼:", + "Old recovery key password" : "舊的還原金鑰密碼", + "New recovery key password" : "新的還原金鑰密碼", + "Repeat new recovery key password" : "再輸入新的還原金鑰密碼一次", "Change Password" : "變更密碼", + "ownCloud basic encryption module" : "ownCloud 基本加密模組", + "Your private key password no longer matches your log-in password." : "您的私人金鑰密碼不符合您的登入密碼", + "Set your old private key password to your current log-in password:" : "設定您的舊私人金鑰密碼到您現在的登入密碼:", " If you don't remember your old password you can ask your administrator to recover your files." : "如果您忘記舊密碼,可以請求管理員協助取回檔案。", "Old log-in password" : "舊登入密碼", "Current log-in password" : "目前的登入密碼", diff --git a/apps/encryption/lib/crypto/crypt.php b/apps/encryption/lib/crypto/crypt.php index 53a78c216a3..c0dcc936bdf 100644 --- a/apps/encryption/lib/crypto/crypt.php +++ b/apps/encryption/lib/crypto/crypt.php @@ -2,6 +2,7 @@ /** * @author Björn Schießle <schiessle@owncloud.com> * @author Clark Tomlinson <fallen013@gmail.com> + * @author Joas Schilling <nickvergessen@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * diff --git a/apps/encryption/lib/crypto/encryption.php b/apps/encryption/lib/crypto/encryption.php index 1a05277e20d..d1140ce7cde 100644 --- a/apps/encryption/lib/crypto/encryption.php +++ b/apps/encryption/lib/crypto/encryption.php @@ -378,6 +378,12 @@ class Encryption implements IEncryptionModule { * @return boolean */ public function shouldEncrypt($path) { + if ($this->util->shouldEncryptHomeStorage() === false) { + $storage = $this->util->getStorage($path); + if ($storage->instanceOfStorage('\OCP\Files\IHomeStorage')) { + return false; + } + } $parts = explode('/', $path); if (count($parts) < 4) { return false; diff --git a/apps/encryption/lib/util.php b/apps/encryption/lib/util.php index a162dcde305..62c9dc6dc5f 100644 --- a/apps/encryption/lib/util.php +++ b/apps/encryption/lib/util.php @@ -94,12 +94,41 @@ class Util { $recoveryMode = $this->config->getUserValue($uid, 'encryption', 'recoveryEnabled', - 0); + '0'); return ($recoveryMode === '1'); } /** + * check if the home storage should be encrypted + * + * @return bool + */ + public function shouldEncryptHomeStorage() { + $encryptHomeStorage = $this->config->getAppValue( + 'encryption', + 'encryptHomeStorage', + '1' + ); + + return ($encryptHomeStorage === '1'); + } + + /** + * check if the home storage should be encrypted + * + * @param bool $encryptHomeStorage + */ + public function setEncryptHomeStorage($encryptHomeStorage) { + $value = $encryptHomeStorage ? '1' : '0'; + $this->config->setAppValue( + 'encryption', + 'encryptHomeStorage', + $value + ); + } + + /** * check if master key is enabled * * @return bool @@ -157,4 +186,15 @@ class Util { return $owner; } + /** + * get storage of path + * + * @param string $path + * @return \OC\Files\Storage\Storage + */ + public function getStorage($path) { + $storage = $this->files->getMount($path)->getStorage(); + return $storage; + } + } diff --git a/apps/encryption/settings/settings-admin.php b/apps/encryption/settings/settings-admin.php index c7ac8c09c6b..8d55d587fed 100644 --- a/apps/encryption/settings/settings-admin.php +++ b/apps/encryption/settings/settings-admin.php @@ -25,12 +25,27 @@ $tmpl = new OCP\Template('encryption', 'settings-admin'); +$crypt = new \OCA\Encryption\Crypto\Crypt( + \OC::$server->getLogger(), + \OC::$server->getUserSession(), + \OC::$server->getConfig()); + +$util = new \OCA\Encryption\Util( + new \OC\Files\View(), + $crypt, + \OC::$server->getLogger(), + \OC::$server->getUserSession(), + \OC::$server->getConfig(), + \OC::$server->getUserManager()); + // Check if an adminRecovery account is enabled for recovering files after lost pwd $recoveryAdminEnabled = \OC::$server->getConfig()->getAppValue('encryption', 'recoveryAdminEnabled', '0'); $session = new \OCA\Encryption\Session(\OC::$server->getSession()); +$encryptHomeStorage = $util->shouldEncryptHomeStorage($user); $tmpl->assign('recoveryEnabled', $recoveryAdminEnabled); $tmpl->assign('initStatus', $session->getStatus()); +$tmpl->assign('encryptHomeStorage', $encryptHomeStorage); return $tmpl->fetchPage(); diff --git a/apps/encryption/templates/settings-admin.php b/apps/encryption/templates/settings-admin.php index 81c7f0607d8..e55aba6757c 100644 --- a/apps/encryption/templates/settings-admin.php +++ b/apps/encryption/templates/settings-admin.php @@ -9,56 +9,63 @@ style('encryption', 'settings-admin'); <?php if(!$_["initStatus"]): ?> <?php p($l->t("Encryption App is enabled but your keys are not initialized, please log-out and log-in again")); ?> <?php else: ?> - <p id="encryptionSetRecoveryKey"> - <?php $_["recoveryEnabled"] === '0' ? p($l->t("Enable recovery key")) : p($l->t("Disable recovery key")); ?> - <span class="msg"></span> - <br/> - <em> - <?php p($l->t("The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password.")) ?> - </em> - <br/> - <input type="password" - name="encryptionRecoveryPassword" - id="encryptionRecoveryPassword" - placeholder="<?php p($l->t("Recovery key password")); ?>"/> - <input type="password" - name="encryptionRecoveryPassword" - id="repeatEncryptionRecoveryPassword" - placeholder="<?php p($l->t("Repeat recovery key password")); ?>"/> - <input type="button" - name="enableRecoveryKey" - id="enableRecoveryKey" - status="<?php p($_["recoveryEnabled"]) ?>" - value="<?php $_["recoveryEnabled"] === '0' ? p($l->t("Enable recovery key")) : p($l->t("Disable recovery key")); ?>"/> - </p> - <br/><br/> - - <p name="changeRecoveryPasswordBlock" id="encryptionChangeRecoveryKey" <?php if($_['recoveryEnabled'] === '0') print_unescaped('class="hidden"');?>> - <?php p($l->t("Change recovery key password:")); ?> - <span class="msg"></span> - <br/> - <input - type="password" - name="changeRecoveryPassword" - id="oldEncryptionRecoveryPassword" - placeholder="<?php p($l->t("Old recovery key password")); ?>"/> + <p id="encryptHomeStorageSetting"> + <input type="checkbox" class="checkbox" name="encrypt_home_storage" id="encryptHomeStorage" + value="1" <?php if ($_['encryptHomeStorage']) print_unescaped('checked="checked"'); ?> /> + <label for="encryptHomeStorage"><?php p($l->t('Encrypt the home storage'));?></label></br> + <em><?php p( $l->t( "Enabling this option encrypts all files stored on the main storage, otherwise only files on external storage will be encrypted" ) ); ?></em> + </p> <br /> - <input - type="password" - name="changeRecoveryPassword" - id="newEncryptionRecoveryPassword" - placeholder="<?php p($l->t("New recovery key password")); ?>"/> - <input - type="password" - name="changeRecoveryPassword" - id="repeatedNewEncryptionRecoveryPassword" - placeholder="<?php p($l->t("Repeat new recovery key password")); ?>"/> + <p id="encryptionSetRecoveryKey"> + <?php $_["recoveryEnabled"] === '0' ? p($l->t("Enable recovery key")) : p($l->t("Disable recovery key")); ?> + <span class="msg"></span> + <br/> + <em> + <?php p($l->t("The recovery key is an extra encryption key that is used to encrypt files. It allows recovery of a user's files if the user forgets his or her password.")) ?> + </em> + <br/> + <input type="password" + name="encryptionRecoveryPassword" + id="encryptionRecoveryPassword" + placeholder="<?php p($l->t("Recovery key password")); ?>"/> + <input type="password" + name="encryptionRecoveryPassword" + id="repeatEncryptionRecoveryPassword" + placeholder="<?php p($l->t("Repeat recovery key password")); ?>"/> + <input type="button" + name="enableRecoveryKey" + id="enableRecoveryKey" + status="<?php p($_["recoveryEnabled"]) ?>" + value="<?php $_["recoveryEnabled"] === '0' ? p($l->t("Enable recovery key")) : p($l->t("Disable recovery key")); ?>"/> + </p> + <br/><br/> + + <p name="changeRecoveryPasswordBlock" id="encryptionChangeRecoveryKey" <?php if($_['recoveryEnabled'] === '0') print_unescaped('class="hidden"');?>> + <?php p($l->t("Change recovery key password:")); ?> + <span class="msg"></span> + <br/> + <input + type="password" + name="changeRecoveryPassword" + id="oldEncryptionRecoveryPassword" + placeholder="<?php p($l->t("Old recovery key password")); ?>"/> + <br /> + <input + type="password" + name="changeRecoveryPassword" + id="newEncryptionRecoveryPassword" + placeholder="<?php p($l->t("New recovery key password")); ?>"/> + <input + type="password" + name="changeRecoveryPassword" + id="repeatedNewEncryptionRecoveryPassword" + placeholder="<?php p($l->t("Repeat new recovery key password")); ?>"/> - <button - type="button" - name="submitChangeRecoveryKey"> + <button + type="button" + name="submitChangeRecoveryKey"> <?php p($l->t("Change Password")); ?> - </button> - </p> + </button> + </p> <?php endif; ?> </form> diff --git a/apps/encryption/tests/controller/SettingsControllerTest.php b/apps/encryption/tests/controller/SettingsControllerTest.php index 724a01522af..3b30e61a45b 100644 --- a/apps/encryption/tests/controller/SettingsControllerTest.php +++ b/apps/encryption/tests/controller/SettingsControllerTest.php @@ -56,6 +56,9 @@ class SettingsControllerTest extends TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject */ private $ocSessionMock; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + private $utilMock; + protected function setUp() { parent::setUp(); @@ -106,6 +109,10 @@ class SettingsControllerTest extends TestCase { $this->sessionMock = $this->getMockBuilder('OCA\Encryption\Session') ->disableOriginalConstructor()->getMock(); + $this->utilMock = $this->getMockBuilder('OCA\Encryption\Util') + ->disableOriginalConstructor() + ->getMock(); + $this->controller = new SettingsController( 'encryption', $this->requestMock, @@ -115,7 +122,8 @@ class SettingsControllerTest extends TestCase { $this->keyManagerMock, $this->cryptMock, $this->sessionMock, - $this->ocSessionMock + $this->ocSessionMock, + $this->utilMock ); } @@ -234,4 +242,10 @@ class SettingsControllerTest extends TestCase { $data['message']); } + function testSetEncryptHomeStorage() { + $value = true; + $this->utilMock->expects($this->once())->method('setEncryptHomeStorage')->with($value); + $this->controller->setEncryptHomeStorage($value); + } + } diff --git a/apps/encryption/tests/lib/MigrationTest.php b/apps/encryption/tests/lib/MigrationTest.php index be37020660c..65fefa262a7 100644 --- a/apps/encryption/tests/lib/MigrationTest.php +++ b/apps/encryption/tests/lib/MigrationTest.php @@ -2,6 +2,7 @@ /** * @author Björn Schießle <schiessle@owncloud.com> * @author Joas Schilling <nickvergessen@owncloud.com> + * @author Robin Appelman <icewind@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/encryption/tests/lib/UtilTest.php b/apps/encryption/tests/lib/UtilTest.php index 723cc9fb910..d55b6b50b3e 100644 --- a/apps/encryption/tests/lib/UtilTest.php +++ b/apps/encryption/tests/lib/UtilTest.php @@ -39,6 +39,9 @@ class UtilTest extends TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject */ private $userManagerMock; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + private $mountMock; + /** @var Util */ private $instance; @@ -65,6 +68,7 @@ class UtilTest extends TestCase { protected function setUp() { parent::setUp(); + $this->mountMock = $this->getMock('\OCP\Files\Mount\IMountPoint'); $this->filesMock = $this->getMock('OC\Files\View'); $this->userManagerMock = $this->getMock('\OCP\IUserManager'); @@ -151,4 +155,52 @@ class UtilTest extends TestCase { ]; } + /** + * @dataProvider dataTestShouldEncryptHomeStorage + * @param $returnValue return value from getAppValue() + * @param $expected + */ + public function testShouldEncryptHomeStorage($returnValue, $expected) { + $this->configMock->expects($this->once())->method('getAppValue') + ->with('encryption', 'encryptHomeStorage', '1') + ->willReturn($returnValue); + + $this->assertSame($expected, + $this->instance->shouldEncryptHomeStorage()); + } + + public function dataTestShouldEncryptHomeStorage() { + return [ + ['1', true], + ['0', false] + ]; + } + + /** + * @dataProvider dataTestSetEncryptHomeStorage + * @param $value + * @param $expected + */ + public function testSetEncryptHomeStorage($value, $expected) { + $this->configMock->expects($this->once())->method('setAppValue') + ->with('encryption', 'encryptHomeStorage', $expected); + $this->instance->setEncryptHomeStorage($value); + } + + public function dataTestSetEncryptHomeStorage() { + return [ + [true, '1'], + [false, '0'] + ]; + } + + public function testGetStorage() { + $path = '/foo/bar.txt'; + $this->filesMock->expects($this->once())->method('getMount')->with($path) + ->willReturn($this->mountMock); + $this->mountMock->expects($this->once())->method('getStorage')->willReturn(true); + + $this->assertTrue($this->instance->getStorage($path)); + } + } diff --git a/apps/encryption/tests/lib/crypto/encryptionTest.php b/apps/encryption/tests/lib/crypto/encryptionTest.php index f76bdfb6d61..138c1bc9446 100644 --- a/apps/encryption/tests/lib/crypto/encryptionTest.php +++ b/apps/encryption/tests/lib/crypto/encryptionTest.php @@ -55,9 +55,14 @@ class EncryptionTest extends TestCase { /** @var \PHPUnit_Framework_MockObject_MockObject */ private $l10nMock; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + private $storageMock; + public function setUp() { parent::setUp(); + $this->storageMock = $this->getMockBuilder('OCP\Files\Storage') + ->disableOriginalConstructor()->getMock(); $this->cryptMock = $this->getMockBuilder('OCA\Encryption\Crypto\Crypt') ->disableOriginalConstructor() ->getMock(); @@ -312,7 +317,17 @@ class EncryptionTest extends TestCase { * * @dataProvider dataTestShouldEncrypt */ - public function testShouldEncrypt($path, $expected) { + public function testShouldEncrypt($path, $shouldEncryptHomeStorage, $isHomeStorage, $expected) { + $this->utilMock->expects($this->once())->method('shouldEncryptHomeStorage') + ->willReturn($shouldEncryptHomeStorage); + + if ($shouldEncryptHomeStorage === false) { + $this->storageMock->expects($this->once())->method('instanceOfStorage') + ->with('\OCP\Files\IHomeStorage')->willReturn($isHomeStorage); + $this->utilMock->expects($this->once())->method('getStorage')->with($path) + ->willReturn($this->storageMock); + } + $this->assertSame($expected, $this->instance->shouldEncrypt($path) ); @@ -320,14 +335,17 @@ class EncryptionTest extends TestCase { public function dataTestShouldEncrypt() { return array( - array('/user1/files/foo.txt', true), - array('/user1/files_versions/foo.txt', true), - array('/user1/files_trashbin/foo.txt', true), - array('/user1/some_folder/foo.txt', false), - array('/user1/foo.txt', false), - array('/user1/files', false), - array('/user1/files_trashbin', false), - array('/user1/files_versions', false), + array('/user1/files/foo.txt', true, true, true), + array('/user1/files_versions/foo.txt', true, true, true), + array('/user1/files_trashbin/foo.txt', true, true, true), + array('/user1/some_folder/foo.txt', true, true, false), + array('/user1/foo.txt', true, true, false), + array('/user1/files', true, true, false), + array('/user1/files_trashbin', true, true, false), + array('/user1/files_versions', true, true, false), + // test if shouldEncryptHomeStorage is set to false + array('/user1/files/foo.txt', false, true, false), + array('/user1/files_versions/foo.txt', false, false, true), ); } diff --git a/apps/files/appinfo/application.php b/apps/files/appinfo/application.php index 6ba77e09556..6aff517e17f 100644 --- a/apps/files/appinfo/application.php +++ b/apps/files/appinfo/application.php @@ -1,6 +1,6 @@ <?php /** - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Tobias Kaminsky <tobias@kaminsky.me> * @author Vincent Petry <pvince81@owncloud.com> * diff --git a/apps/files/appinfo/routes.php b/apps/files/appinfo/routes.php index 41aeec6a152..d52dfaab21c 100644 --- a/apps/files/appinfo/routes.php +++ b/apps/files/appinfo/routes.php @@ -2,7 +2,7 @@ /** * @author Bart Visscher <bartv@thisnet.nl> * @author Lukas Reschke <lukas@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Tobias Kaminsky <tobias@kaminsky.me> * @author Tom Needham <tom@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> diff --git a/apps/files/controller/apicontroller.php b/apps/files/controller/apicontroller.php index ea5ee81a9f6..1ecd5294c66 100644 --- a/apps/files/controller/apicontroller.php +++ b/apps/files/controller/apicontroller.php @@ -3,7 +3,7 @@ * @author Joas Schilling <nickvergessen@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Tobias Kaminsky <tobias@kaminsky.me> * @author Vincent Petry <pvince81@owncloud.com> diff --git a/apps/files/js/favoritesfilelist.js b/apps/files/js/favoritesfilelist.js index 4e7db9f17ba..e6532ab188c 100644 --- a/apps/files/js/favoritesfilelist.js +++ b/apps/files/js/favoritesfilelist.js @@ -71,6 +71,10 @@ $(document).ready(function() { if (this._reloadCall) { this._reloadCall.abort(); } + + // there is only root + this._setCurrentDir('/', false); + this._reloadCall = $.ajax({ url: OC.generateUrl('/apps/files/api/v1/tags/{tagName}/files', {tagName: tagName}), type: 'GET', @@ -86,10 +90,9 @@ $(document).ready(function() { if (result.files) { this.setFiles(result.files.sort(this._sortComparator)); + return true; } - else { - // TODO: error handling - } + return false; } }); diff --git a/apps/files/l10n/ja.js b/apps/files/l10n/ja.js index 28e0b124a0a..052562d13ee 100644 --- a/apps/files/l10n/ja.js +++ b/apps/files/l10n/ja.js @@ -96,6 +96,9 @@ OC.L10N.register( "%2$s deleted %1$s" : "%2$s は %1$s を削除しました", "You restored %1$s" : "%1$s を復元しました", "%2$s restored %1$s" : "%2$s は、 %1$s を復元しました", + "Changed by %2$s" : "%2$s により更新", + "Deleted by %2$s" : "%2$s により削除", + "Restored by %2$s" : "%2$s により復元", "%s could not be renamed as it has been deleted" : "%s は削除されたため、ファイル名を変更できません", "%s could not be renamed" : "%sの名前を変更できませんでした", "Upload (max. %s)" : "アップロード ( 最大 %s )", diff --git a/apps/files/l10n/ja.json b/apps/files/l10n/ja.json index 46265c531b9..4534e787e0f 100644 --- a/apps/files/l10n/ja.json +++ b/apps/files/l10n/ja.json @@ -94,6 +94,9 @@ "%2$s deleted %1$s" : "%2$s は %1$s を削除しました", "You restored %1$s" : "%1$s を復元しました", "%2$s restored %1$s" : "%2$s は、 %1$s を復元しました", + "Changed by %2$s" : "%2$s により更新", + "Deleted by %2$s" : "%2$s により削除", + "Restored by %2$s" : "%2$s により復元", "%s could not be renamed as it has been deleted" : "%s は削除されたため、ファイル名を変更できません", "%s could not be renamed" : "%sの名前を変更できませんでした", "Upload (max. %s)" : "アップロード ( 最大 %s )", diff --git a/apps/files/l10n/lv.js b/apps/files/l10n/lv.js index fa5ddf4f402..f0d5b4212b0 100644 --- a/apps/files/l10n/lv.js +++ b/apps/files/l10n/lv.js @@ -30,10 +30,10 @@ OC.L10N.register( "Favorites" : "Iecienītie", "Home" : "Mājas", "Close" : "Aizvērt", + "Upload cancelled." : "Augšupielāde ir atcelta.", "Unable to upload {filename} as it is a directory or has 0 bytes" : "Neizdodas augšupielādēt {filename}, jo tā ir vai nu mape vai 0 baitu saturošs fails.", "Total file size {size1} exceeds upload limit {size2}" : "Kopējais faila izmērs {size1} pārsniedz augšupielādes ierobežojumu {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" : "Nav pietiekami daudz brīvas vietas. Tiek augšupielādēti {size1}, bet pieejami tikai {size2}", - "Upload cancelled." : "Augšupielāde ir atcelta.", "Could not get result from server." : "Nevar saņemt rezultātus no servera", "File upload is in progress. Leaving the page now will cancel the upload." : "Notiek augšupielāde. Pametot lapu tagad, tiks atcelta augšupielāde.", "Actions" : "Darbības", diff --git a/apps/files/l10n/lv.json b/apps/files/l10n/lv.json index b164c88e381..14d0b4093df 100644 --- a/apps/files/l10n/lv.json +++ b/apps/files/l10n/lv.json @@ -28,10 +28,10 @@ "Favorites" : "Iecienītie", "Home" : "Mājas", "Close" : "Aizvērt", + "Upload cancelled." : "Augšupielāde ir atcelta.", "Unable to upload {filename} as it is a directory or has 0 bytes" : "Neizdodas augšupielādēt {filename}, jo tā ir vai nu mape vai 0 baitu saturošs fails.", "Total file size {size1} exceeds upload limit {size2}" : "Kopējais faila izmērs {size1} pārsniedz augšupielādes ierobežojumu {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" : "Nav pietiekami daudz brīvas vietas. Tiek augšupielādēti {size1}, bet pieejami tikai {size2}", - "Upload cancelled." : "Augšupielāde ir atcelta.", "Could not get result from server." : "Nevar saņemt rezultātus no servera", "File upload is in progress. Leaving the page now will cancel the upload." : "Notiek augšupielāde. Pametot lapu tagad, tiks atcelta augšupielāde.", "Actions" : "Darbības", diff --git a/apps/files/l10n/nb_NO.js b/apps/files/l10n/nb_NO.js index 3d27173708d..7fe475a6a22 100644 --- a/apps/files/l10n/nb_NO.js +++ b/apps/files/l10n/nb_NO.js @@ -30,10 +30,10 @@ OC.L10N.register( "Favorites" : "Favoritter", "Home" : "Hjem", "Close" : "Lukk", + "Upload cancelled." : "Opplasting avbrutt.", "Unable to upload {filename} as it is a directory or has 0 bytes" : "Kan ikke laste opp {filename} fordi det er en mappe eller har 0 bytes", "Total file size {size1} exceeds upload limit {size2}" : "Total filstørrelse {size1} overstiger grense for opplasting {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" : "Ikke nok ledig plass. Du laster opp size1} men bare {size2} er ledig", - "Upload cancelled." : "Opplasting avbrutt.", "Could not get result from server." : "Fikk ikke resultat fra serveren.", "File upload is in progress. Leaving the page now will cancel the upload." : "Filopplasting pågår. Forlater du siden nå avbrytes opplastingen.", "Actions" : "Handlinger", @@ -96,6 +96,9 @@ OC.L10N.register( "%2$s deleted %1$s" : "%2$s slettet %1$s", "You restored %1$s" : "Du gjenopprettet %1$s", "%2$s restored %1$s" : "%2$s gjenopprettet %1$s", + "Changed by %2$s" : "Endret av %2$s", + "Deleted by %2$s" : "Slettet av %2$s", + "Restored by %2$s" : "Gjenopprettet av %2$s", "%s could not be renamed as it has been deleted" : "%s kunne ikke gis nytt navn da den er blitt slettet", "%s could not be renamed" : "Kunne ikke gi nytt navn til %s", "Upload (max. %s)" : "Opplasting (maks. %s)", diff --git a/apps/files/l10n/nb_NO.json b/apps/files/l10n/nb_NO.json index a7e0cf33b83..69e8ca742aa 100644 --- a/apps/files/l10n/nb_NO.json +++ b/apps/files/l10n/nb_NO.json @@ -28,10 +28,10 @@ "Favorites" : "Favoritter", "Home" : "Hjem", "Close" : "Lukk", + "Upload cancelled." : "Opplasting avbrutt.", "Unable to upload {filename} as it is a directory or has 0 bytes" : "Kan ikke laste opp {filename} fordi det er en mappe eller har 0 bytes", "Total file size {size1} exceeds upload limit {size2}" : "Total filstørrelse {size1} overstiger grense for opplasting {size2}", "Not enough free space, you are uploading {size1} but only {size2} is left" : "Ikke nok ledig plass. Du laster opp size1} men bare {size2} er ledig", - "Upload cancelled." : "Opplasting avbrutt.", "Could not get result from server." : "Fikk ikke resultat fra serveren.", "File upload is in progress. Leaving the page now will cancel the upload." : "Filopplasting pågår. Forlater du siden nå avbrytes opplastingen.", "Actions" : "Handlinger", @@ -94,6 +94,9 @@ "%2$s deleted %1$s" : "%2$s slettet %1$s", "You restored %1$s" : "Du gjenopprettet %1$s", "%2$s restored %1$s" : "%2$s gjenopprettet %1$s", + "Changed by %2$s" : "Endret av %2$s", + "Deleted by %2$s" : "Slettet av %2$s", + "Restored by %2$s" : "Gjenopprettet av %2$s", "%s could not be renamed as it has been deleted" : "%s kunne ikke gis nytt navn da den er blitt slettet", "%s could not be renamed" : "Kunne ikke gi nytt navn til %s", "Upload (max. %s)" : "Opplasting (maks. %s)", diff --git a/apps/files/l10n/oc.js b/apps/files/l10n/oc.js index 4e1c7e0a011..6a0a05c782a 100644 --- a/apps/files/l10n/oc.js +++ b/apps/files/l10n/oc.js @@ -44,6 +44,8 @@ OC.L10N.register( "Select" : "Seleccionar", "Pending" : "En espèra", "Unable to determine date" : "Impossible de determinar la data", + "This operation is forbidden" : "L'operacion es interdicha", + "This directory is unavailable, please check the logs or contact the administrator" : "Aqueste repertòri es pas disponible. Consultatz los logs o contactatz vòstre administrator", "Error moving file." : "Error al moment del desplaçament del fichièr.", "Error moving file" : "Error al moment del desplaçament del fichièr", "Error" : "Error", @@ -64,11 +66,16 @@ OC.L10N.register( "New" : "Novèl", "\"{name}\" is an invalid file name." : "\"{name}\" es pas un nom de fichièr valid.", "File name cannot be empty." : "Lo nom de fichièr pòt pas èsser void.", + "Storage of {owner} is full, files can not be updated or synced anymore!" : "L'espaci d'emmagazinatge de {owner} es plen. Los fichièrs pòdon pas mai èsser meses a jorn o sincronizats !", "Your storage is full, files can not be updated or synced anymore!" : "Vòstre espaci d'emmagazinatge es plen, los fichièrs pòdon pas mai èsser aponduts o sincronizats !", + "Storage of {owner} is almost full ({usedSpacePercent}%)" : "L'espaci d'emmagazinatge de {owner} es gaireben plen ({usedSpacePercent}%)", "Your storage is almost full ({usedSpacePercent}%)" : "Vòstre espace d'emmagazinatge es gaireben plen ({usedSpacePercent}%)", "_matches '{filter}'_::_match '{filter}'_" : ["correspond a '{filter}'","correspondon a '{filter}'"], + "Path" : "Camin", + "_%n byte_::_%n bytes_" : ["%n octet","%n octets"], "Favorited" : "Marcat coma favorit", "Favorite" : "Favorit", + "{newname} already exists" : "{new_name} existís ja", "Upload" : "Cargament", "Text file" : "Fichièr tèxte", "New text file.txt" : "Novèl fichièr tèxte .txt", @@ -89,12 +96,16 @@ OC.L10N.register( "%2$s deleted %1$s" : "%2$s a suprimit %1$s", "You restored %1$s" : "Avètz restablit %1$s", "%2$s restored %1$s" : "%2$s a restablit %1$s", + "Changed by %2$s" : "Modificat per %2$s", + "Deleted by %2$s" : "Suprimit per %2$s", + "Restored by %2$s" : "Restablit per %2$s", "%s could not be renamed as it has been deleted" : "%s pòt pas èsser renomenat perque es estat suprimit ", "%s could not be renamed" : "%s pòt pas èsser renomenat", "Upload (max. %s)" : "Mandadís (max. %s)", "File handling" : "Gestion de fichièrs", "Maximum upload size" : "Talha max. de mandadís", "max. possible: " : "Max. possible :", + "With PHP-FPM this value may take up to 5 minutes to take effect after saving." : "Amb PHP-FPM, se pòdon passar fins a 5 minutas abans qu'aquesta valor siá aplicada.", "Save" : "Salvar", "Can not be edited from here due to insufficient permissions." : "Pòt pas èsser modificat aicí a causa de permissions insufisentas.", "Settings" : "Paramètres", diff --git a/apps/files/l10n/oc.json b/apps/files/l10n/oc.json index 108bc5d9de9..0577b75076a 100644 --- a/apps/files/l10n/oc.json +++ b/apps/files/l10n/oc.json @@ -42,6 +42,8 @@ "Select" : "Seleccionar", "Pending" : "En espèra", "Unable to determine date" : "Impossible de determinar la data", + "This operation is forbidden" : "L'operacion es interdicha", + "This directory is unavailable, please check the logs or contact the administrator" : "Aqueste repertòri es pas disponible. Consultatz los logs o contactatz vòstre administrator", "Error moving file." : "Error al moment del desplaçament del fichièr.", "Error moving file" : "Error al moment del desplaçament del fichièr", "Error" : "Error", @@ -62,11 +64,16 @@ "New" : "Novèl", "\"{name}\" is an invalid file name." : "\"{name}\" es pas un nom de fichièr valid.", "File name cannot be empty." : "Lo nom de fichièr pòt pas èsser void.", + "Storage of {owner} is full, files can not be updated or synced anymore!" : "L'espaci d'emmagazinatge de {owner} es plen. Los fichièrs pòdon pas mai èsser meses a jorn o sincronizats !", "Your storage is full, files can not be updated or synced anymore!" : "Vòstre espaci d'emmagazinatge es plen, los fichièrs pòdon pas mai èsser aponduts o sincronizats !", + "Storage of {owner} is almost full ({usedSpacePercent}%)" : "L'espaci d'emmagazinatge de {owner} es gaireben plen ({usedSpacePercent}%)", "Your storage is almost full ({usedSpacePercent}%)" : "Vòstre espace d'emmagazinatge es gaireben plen ({usedSpacePercent}%)", "_matches '{filter}'_::_match '{filter}'_" : ["correspond a '{filter}'","correspondon a '{filter}'"], + "Path" : "Camin", + "_%n byte_::_%n bytes_" : ["%n octet","%n octets"], "Favorited" : "Marcat coma favorit", "Favorite" : "Favorit", + "{newname} already exists" : "{new_name} existís ja", "Upload" : "Cargament", "Text file" : "Fichièr tèxte", "New text file.txt" : "Novèl fichièr tèxte .txt", @@ -87,12 +94,16 @@ "%2$s deleted %1$s" : "%2$s a suprimit %1$s", "You restored %1$s" : "Avètz restablit %1$s", "%2$s restored %1$s" : "%2$s a restablit %1$s", + "Changed by %2$s" : "Modificat per %2$s", + "Deleted by %2$s" : "Suprimit per %2$s", + "Restored by %2$s" : "Restablit per %2$s", "%s could not be renamed as it has been deleted" : "%s pòt pas èsser renomenat perque es estat suprimit ", "%s could not be renamed" : "%s pòt pas èsser renomenat", "Upload (max. %s)" : "Mandadís (max. %s)", "File handling" : "Gestion de fichièrs", "Maximum upload size" : "Talha max. de mandadís", "max. possible: " : "Max. possible :", + "With PHP-FPM this value may take up to 5 minutes to take effect after saving." : "Amb PHP-FPM, se pòdon passar fins a 5 minutas abans qu'aquesta valor siá aplicada.", "Save" : "Salvar", "Can not be edited from here due to insufficient permissions." : "Pòt pas èsser modificat aicí a causa de permissions insufisentas.", "Settings" : "Paramètres", diff --git a/apps/files/lib/capabilities.php b/apps/files/lib/capabilities.php index 2e19283e4d6..14fb07a9d86 100644 --- a/apps/files/lib/capabilities.php +++ b/apps/files/lib/capabilities.php @@ -1,7 +1,7 @@ <?php /** * @author Christopher Schäpers <kondou@ts.unde.re> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Tom Needham <tom@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files/tests/ajax_rename.php b/apps/files/tests/ajax_rename.php index 00a62fa002d..859c7042b89 100644 --- a/apps/files/tests/ajax_rename.php +++ b/apps/files/tests/ajax_rename.php @@ -5,7 +5,6 @@ * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> - * @author tbartenstein <tbartenstein@users.noreply.github.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Vincent Petry <pvince81@owncloud.com> * diff --git a/apps/files/tests/command/deleteorphanedfilestest.php b/apps/files/tests/command/deleteorphanedfilestest.php index 3a1a541d8f1..a667dba99fc 100644 --- a/apps/files/tests/command/deleteorphanedfilestest.php +++ b/apps/files/tests/command/deleteorphanedfilestest.php @@ -1,6 +1,7 @@ <?php /** * @author Morris Jobke <hey@morrisjobke.de> + * @author Robin Appelman <icewind@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files/tests/controller/apicontrollertest.php b/apps/files/tests/controller/apicontrollertest.php index 7f34c0a5642..fb728d5eff0 100644 --- a/apps/files/tests/controller/apicontrollertest.php +++ b/apps/files/tests/controller/apicontrollertest.php @@ -1,9 +1,8 @@ <?php /** - * @author Joas Schilling <nickvergessen@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_external/3rdparty/composer.json b/apps/files_external/3rdparty/composer.json index ad007df23de..4ae2b7d0113 100644 --- a/apps/files_external/3rdparty/composer.json +++ b/apps/files_external/3rdparty/composer.json @@ -3,7 +3,9 @@ "description": "3rdparty components for files_external", "license": "MIT", "config": { - "vendor-dir": "." + "vendor-dir": ".", + "optimize-autoloader": true, + "classmap-authoritative": true }, "require": { "icewind/smb": "1.0.4", diff --git a/apps/files_external/3rdparty/composer/autoload_classmap.php b/apps/files_external/3rdparty/composer/autoload_classmap.php index 1bd6482f9ea..d5b0d51e82d 100644 --- a/apps/files_external/3rdparty/composer/autoload_classmap.php +++ b/apps/files_external/3rdparty/composer/autoload_classmap.php @@ -6,4 +6,49 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = $vendorDir; return array( + 'Icewind\\SMB\\AbstractShare' => $vendorDir . '/icewind/smb/src/AbstractShare.php', + 'Icewind\\SMB\\Connection' => $vendorDir . '/icewind/smb/src/Connection.php', + 'Icewind\\SMB\\ErrorCodes' => $vendorDir . '/icewind/smb/src/ErrorCodes.php', + 'Icewind\\SMB\\Exception\\AccessDeniedException' => $vendorDir . '/icewind/smb/src/Exception/AccessDeniedException.php', + 'Icewind\\SMB\\Exception\\AlreadyExistsException' => $vendorDir . '/icewind/smb/src/Exception/AlreadyExistsException.php', + 'Icewind\\SMB\\Exception\\AuthenticationException' => $vendorDir . '/icewind/smb/src/Exception/AuthenticationException.php', + 'Icewind\\SMB\\Exception\\ConnectException' => $vendorDir . '/icewind/smb/src/Exception/ConnectException.php', + 'Icewind\\SMB\\Exception\\ConnectionException' => $vendorDir . '/icewind/smb/src/Exception/ConnectionException.php', + 'Icewind\\SMB\\Exception\\ConnectionRefusedException' => $vendorDir . '/icewind/smb/src/Exception/ConnectionRefusedException.php', + 'Icewind\\SMB\\Exception\\Exception' => $vendorDir . '/icewind/smb/src/Exception/Exception.php', + 'Icewind\\SMB\\Exception\\FileInUseException' => $vendorDir . '/icewind/smb/src/Exception/FileInUseException.php', + 'Icewind\\SMB\\Exception\\ForbiddenException' => $vendorDir . '/icewind/smb/src/Exception/ForbiddenException.php', + 'Icewind\\SMB\\Exception\\HostDownException' => $vendorDir . '/icewind/smb/src/Exception/HostDownException.php', + 'Icewind\\SMB\\Exception\\InvalidHostException' => $vendorDir . '/icewind/smb/src/Exception/InvalidHostException.php', + 'Icewind\\SMB\\Exception\\InvalidPathException' => $vendorDir . '/icewind/smb/src/Exception/InvalidPathException.php', + 'Icewind\\SMB\\Exception\\InvalidRequestException' => $vendorDir . '/icewind/smb/src/Exception/InvalidRequestException.php', + 'Icewind\\SMB\\Exception\\InvalidTypeException' => $vendorDir . '/icewind/smb/src/Exception/InvalidTypeException.php', + 'Icewind\\SMB\\Exception\\NoLoginServerException' => $vendorDir . '/icewind/smb/src/Exception/NoLoginServerException.php', + 'Icewind\\SMB\\Exception\\NoRouteToHostException' => $vendorDir . '/icewind/smb/src/Exception/NoRouteToHostException.php', + 'Icewind\\SMB\\Exception\\NotEmptyException' => $vendorDir . '/icewind/smb/src/Exception/NotEmptyException.php', + 'Icewind\\SMB\\Exception\\NotFoundException' => $vendorDir . '/icewind/smb/src/Exception/NotFoundException.php', + 'Icewind\\SMB\\Exception\\TimedOutException' => $vendorDir . '/icewind/smb/src/Exception/TimedOutException.php', + 'Icewind\\SMB\\FileInfo' => $vendorDir . '/icewind/smb/src/FileInfo.php', + 'Icewind\\SMB\\IFileInfo' => $vendorDir . '/icewind/smb/src/IFileInfo.php', + 'Icewind\\SMB\\IShare' => $vendorDir . '/icewind/smb/src/IShare.php', + 'Icewind\\SMB\\NativeFileInfo' => $vendorDir . '/icewind/smb/src/NativeFileInfo.php', + 'Icewind\\SMB\\NativeServer' => $vendorDir . '/icewind/smb/src/NativeServer.php', + 'Icewind\\SMB\\NativeShare' => $vendorDir . '/icewind/smb/src/NativeShare.php', + 'Icewind\\SMB\\NativeState' => $vendorDir . '/icewind/smb/src/NativeState.php', + 'Icewind\\SMB\\NativeStream' => $vendorDir . '/icewind/smb/src/NativeStream.php', + 'Icewind\\SMB\\Parser' => $vendorDir . '/icewind/smb/src/Parser.php', + 'Icewind\\SMB\\RawConnection' => $vendorDir . '/icewind/smb/src/RawConnection.php', + 'Icewind\\SMB\\Server' => $vendorDir . '/icewind/smb/src/Server.php', + 'Icewind\\SMB\\Share' => $vendorDir . '/icewind/smb/src/Share.php', + 'Icewind\\SMB\\TimeZoneProvider' => $vendorDir . '/icewind/smb/src/TimeZoneProvider.php', + 'Icewind\\Streams\\CallbackWrapper' => $vendorDir . '/icewind/streams/src/CallbackWrapper.php', + 'Icewind\\Streams\\Directory' => $vendorDir . '/icewind/streams/src/Directory.php', + 'Icewind\\Streams\\File' => $vendorDir . '/icewind/streams/src/File.php', + 'Icewind\\Streams\\IteratorDirectory' => $vendorDir . '/icewind/streams/src/IteratorDirectory.php', + 'Icewind\\Streams\\NullWrapper' => $vendorDir . '/icewind/streams/src/NullWrapper.php', + 'Icewind\\Streams\\Tests\\CallbackWrapper' => $vendorDir . '/icewind/streams/tests/CallbackWrapper.php', + 'Icewind\\Streams\\Tests\\IteratorDirectory' => $vendorDir . '/icewind/streams/tests/IteratorDirectory.php', + 'Icewind\\Streams\\Tests\\NullWrapper' => $vendorDir . '/icewind/streams/tests/NullWrapper.php', + 'Icewind\\Streams\\Tests\\Wrapper' => $vendorDir . '/icewind/streams/tests/Wrapper.php', + 'Icewind\\Streams\\Wrapper' => $vendorDir . '/icewind/streams/src/Wrapper.php', ); diff --git a/apps/files_external/3rdparty/composer/autoload_real.php b/apps/files_external/3rdparty/composer/autoload_real.php index 3391b322be0..9e8b3b558e5 100644 --- a/apps/files_external/3rdparty/composer/autoload_real.php +++ b/apps/files_external/3rdparty/composer/autoload_real.php @@ -38,6 +38,7 @@ class ComposerAutoloaderInit98fe9b281934250b3a93f69a5ce843b3 $loader->addClassMap($classMap); } + $loader->setClassMapAuthoritative(true); $loader->register(true); return $loader; diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php index aa39d79a85e..a7d8f4f668d 100644 --- a/apps/files_external/appinfo/app.php +++ b/apps/files_external/appinfo/app.php @@ -1,8 +1,8 @@ <?php /** * @author Christian Berendt <berendt@b1-systems.de> - * @author Jan-Christoph Borchardt <hey@jancborchardt.net> * @author j-ed <juergen@eisfair.org> + * @author Jan-Christoph Borchardt <hey@jancborchardt.net> * @author Michael Gapczynski <GapczynskiM@gmail.com> * @author Robin Appelman <icewind@owncloud.com> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> diff --git a/apps/files_external/appinfo/application.php b/apps/files_external/appinfo/application.php index c7deaaf270e..1d6e0d03400 100644 --- a/apps/files_external/appinfo/application.php +++ b/apps/files_external/appinfo/application.php @@ -2,7 +2,7 @@ /** * @author Morris Jobke <hey@morrisjobke.de> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Ross Nicoll <jrn@jrn.me.uk> * @author Vincent Petry <pvince81@owncloud.com> * diff --git a/apps/files_external/appinfo/routes.php b/apps/files_external/appinfo/routes.php index a98a63c711d..39ded1dc2ec 100644 --- a/apps/files_external/appinfo/routes.php +++ b/apps/files_external/appinfo/routes.php @@ -4,7 +4,7 @@ * @author Jörn Friedrich Dreyer <jfd@butonic.de> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Ross Nicoll <jrn@jrn.me.uk> * @author Vincent Petry <pvince81@owncloud.com> * diff --git a/apps/files_external/js/mountsfilelist.js b/apps/files_external/js/mountsfilelist.js index c45faafd9bf..35aef751fef 100644 --- a/apps/files_external/js/mountsfilelist.js +++ b/apps/files_external/js/mountsfilelist.js @@ -86,6 +86,10 @@ if (this._reloadCall) { this._reloadCall.abort(); } + + // there is only root + this._setCurrentDir('/', false); + this._reloadCall = $.ajax({ url: OC.linkToOCS('apps/files_external/api/v1') + 'mounts', data: { @@ -106,10 +110,9 @@ if (result.ocs && result.ocs.data) { this.setFiles(this._makeFiles(result.ocs.data)); + return true; } - else { - // TODO: error handling - } + return false; }, /** diff --git a/apps/files_external/l10n/es.js b/apps/files_external/l10n/es.js index 5415e8963cd..cb31cd7c53f 100644 --- a/apps/files_external/l10n/es.js +++ b/apps/files_external/l10n/es.js @@ -88,6 +88,7 @@ OC.L10N.register( "Advanced settings" : "Configuración avanzada", "Delete" : "Eliminar", "Add storage" : "Añadir almacenamiento", + "Allow users to mount external storages" : "Permitir a los usuarios montar almacenamientos externos", "Allow users to mount the following external storage" : "Permitir a los usuarios montar el siguiente almacenamiento externo" }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/files_external/l10n/es.json b/apps/files_external/l10n/es.json index 10cbf0c974a..d71effbd84a 100644 --- a/apps/files_external/l10n/es.json +++ b/apps/files_external/l10n/es.json @@ -86,6 +86,7 @@ "Advanced settings" : "Configuración avanzada", "Delete" : "Eliminar", "Add storage" : "Añadir almacenamiento", + "Allow users to mount external storages" : "Permitir a los usuarios montar almacenamientos externos", "Allow users to mount the following external storage" : "Permitir a los usuarios montar el siguiente almacenamiento externo" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/files_external/l10n/fr.js b/apps/files_external/l10n/fr.js index 2ca3c2d2219..12738d841e4 100644 --- a/apps/files_external/l10n/fr.js +++ b/apps/files_external/l10n/fr.js @@ -83,7 +83,7 @@ OC.L10N.register( "Username as share" : "Nom d'utilisateur comme nom de partage", "OpenStack Object Storage" : "OpenStack Object Storage", "Service name" : "Nom du service", - "Request timeout (seconds)" : "Timeout des requêtes (en secondes)", + "Request timeout (seconds)" : "Délai d'expiration des requêtes (en secondes)", "<b>Note:</b> " : "<b>Attention :</b>", "<b>Note:</b> The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>Attention :</b> La prise en charge de cURL par PHP n'est pas activée ou installée. Le montage de %s n'est pas possible. Contactez votre administrateur système pour l'installer.", "<b>Note:</b> The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>Attention : </b> La prise en charge du FTP par PHP n'est pas activée ou installée. Le montage de %s n'est pas possible. Contactez votre administrateur système pour l'installer.", diff --git a/apps/files_external/l10n/fr.json b/apps/files_external/l10n/fr.json index 5b36ff92741..425413b7e8d 100644 --- a/apps/files_external/l10n/fr.json +++ b/apps/files_external/l10n/fr.json @@ -81,7 +81,7 @@ "Username as share" : "Nom d'utilisateur comme nom de partage", "OpenStack Object Storage" : "OpenStack Object Storage", "Service name" : "Nom du service", - "Request timeout (seconds)" : "Timeout des requêtes (en secondes)", + "Request timeout (seconds)" : "Délai d'expiration des requêtes (en secondes)", "<b>Note:</b> " : "<b>Attention :</b>", "<b>Note:</b> The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>Attention :</b> La prise en charge de cURL par PHP n'est pas activée ou installée. Le montage de %s n'est pas possible. Contactez votre administrateur système pour l'installer.", "<b>Note:</b> The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>Attention : </b> La prise en charge du FTP par PHP n'est pas activée ou installée. Le montage de %s n'est pas possible. Contactez votre administrateur système pour l'installer.", diff --git a/apps/files_external/l10n/ja.js b/apps/files_external/l10n/ja.js index 358a362e506..ac5d1bfe6f8 100644 --- a/apps/files_external/l10n/ja.js +++ b/apps/files_external/l10n/ja.js @@ -8,6 +8,8 @@ OC.L10N.register( "Storage with id \"%i\" not found" : "ストレージID \"%i\" が見つかりません", "Invalid mount point" : "無効なマウントポイント", "Invalid storage backend \"%s\"" : "\"%s\" のストレージバックエンドが不正", + "Not permitted to use backend \"%s\"" : "バックエンド %s を使うための権限がありません", + "Unsatisfied authentication mechanism parameters" : "認証のためのパラメータが不十分です", "Personal" : "個人", "System" : "システム", "Grant access" : "アクセスを許可", @@ -37,6 +39,7 @@ OC.L10N.register( "Password" : "パスワード", "Rackspace" : "Rackspace", "API key" : "APIキー", + "Username and password" : "ユーザー名とパスワード", "RSA public key" : "RSA公開鍵", "Public key" : "公開鍵", "Amazon S3" : "Amazon S3", @@ -68,6 +71,7 @@ OC.L10N.register( "Username as share" : "共有名", "OpenStack Object Storage" : "OpenStack ObjectStorage", "Service name" : "サービス名", + "Request timeout (seconds)" : "リクエストがタイムアウトするまでの秒数", "<b>Note:</b> " : "<b>注意:</b> ", "<b>Note:</b> The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>注意:</b> PHPにcURLのエクステンションが入っていないか、有効ではありません。%s をマウントすることができません。このシステムの管理者にインストールをお願いしてください。", "<b>Note:</b> The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>注意:</b> PHPにFTPのエクステンションが入っていないか、有効ではありません。%s をマウントすることができません。このシステムの管理者にインストールをお願いしてください。", diff --git a/apps/files_external/l10n/ja.json b/apps/files_external/l10n/ja.json index 8af4ce97ced..6664b3d97db 100644 --- a/apps/files_external/l10n/ja.json +++ b/apps/files_external/l10n/ja.json @@ -6,6 +6,8 @@ "Storage with id \"%i\" not found" : "ストレージID \"%i\" が見つかりません", "Invalid mount point" : "無効なマウントポイント", "Invalid storage backend \"%s\"" : "\"%s\" のストレージバックエンドが不正", + "Not permitted to use backend \"%s\"" : "バックエンド %s を使うための権限がありません", + "Unsatisfied authentication mechanism parameters" : "認証のためのパラメータが不十分です", "Personal" : "個人", "System" : "システム", "Grant access" : "アクセスを許可", @@ -35,6 +37,7 @@ "Password" : "パスワード", "Rackspace" : "Rackspace", "API key" : "APIキー", + "Username and password" : "ユーザー名とパスワード", "RSA public key" : "RSA公開鍵", "Public key" : "公開鍵", "Amazon S3" : "Amazon S3", @@ -66,6 +69,7 @@ "Username as share" : "共有名", "OpenStack Object Storage" : "OpenStack ObjectStorage", "Service name" : "サービス名", + "Request timeout (seconds)" : "リクエストがタイムアウトするまでの秒数", "<b>Note:</b> " : "<b>注意:</b> ", "<b>Note:</b> The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>注意:</b> PHPにcURLのエクステンションが入っていないか、有効ではありません。%s をマウントすることができません。このシステムの管理者にインストールをお願いしてください。", "<b>Note:</b> The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>注意:</b> PHPにFTPのエクステンションが入っていないか、有効ではありません。%s をマウントすることができません。このシステムの管理者にインストールをお願いしてください。", diff --git a/apps/files_external/l10n/lv.js b/apps/files_external/l10n/lv.js index 7b4d94be6c7..6590706fa2a 100644 --- a/apps/files_external/l10n/lv.js +++ b/apps/files_external/l10n/lv.js @@ -5,6 +5,7 @@ OC.L10N.register( "Personal" : "Personīgi", "Grant access" : "Piešķirt pieeju", "Access granted" : "Piešķirta pieeja", + "Enable encryption" : "Ieslēgt šifrēšanu", "Saved" : "Saglabāts", "None" : "Nav", "Username" : "Lietotājvārds", diff --git a/apps/files_external/l10n/lv.json b/apps/files_external/l10n/lv.json index 7ad68595d73..4e27db77737 100644 --- a/apps/files_external/l10n/lv.json +++ b/apps/files_external/l10n/lv.json @@ -3,6 +3,7 @@ "Personal" : "Personīgi", "Grant access" : "Piešķirt pieeju", "Access granted" : "Piešķirta pieeja", + "Enable encryption" : "Ieslēgt šifrēšanu", "Saved" : "Saglabāts", "None" : "Nav", "Username" : "Lietotājvārds", diff --git a/apps/files_external/l10n/nb_NO.js b/apps/files_external/l10n/nb_NO.js index ecafac048c0..1859d5a7267 100644 --- a/apps/files_external/l10n/nb_NO.js +++ b/apps/files_external/l10n/nb_NO.js @@ -101,6 +101,7 @@ OC.L10N.register( "Advanced settings" : "Avanserte innstillinger", "Delete" : "Slett", "Add storage" : "Legg til lagringsplass", + "Allow users to mount external storages" : "Tillat at brukere kobler opp eksterne lagre", "Allow users to mount the following external storage" : "Tillat brukere å koble opp følgende eksterne lagring" }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/files_external/l10n/nb_NO.json b/apps/files_external/l10n/nb_NO.json index 9a7a2ae6287..669751aa00f 100644 --- a/apps/files_external/l10n/nb_NO.json +++ b/apps/files_external/l10n/nb_NO.json @@ -99,6 +99,7 @@ "Advanced settings" : "Avanserte innstillinger", "Delete" : "Slett", "Add storage" : "Legg til lagringsplass", + "Allow users to mount external storages" : "Tillat at brukere kobler opp eksterne lagre", "Allow users to mount the following external storage" : "Tillat brukere å koble opp følgende eksterne lagring" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/files_external/l10n/nl.js b/apps/files_external/l10n/nl.js index 50e2f785da7..bfcf493ee04 100644 --- a/apps/files_external/l10n/nl.js +++ b/apps/files_external/l10n/nl.js @@ -101,6 +101,7 @@ OC.L10N.register( "Advanced settings" : "Geavanceerde instellingen", "Delete" : "Verwijder", "Add storage" : "Toevoegen opslag", + "Allow users to mount external storages" : "Sta gebruikers toe om een externe opslag aan te koppelen.", "Allow users to mount the following external storage" : "Sta gebruikers toe de volgende externe opslag aan te koppelen" }, "nplurals=2; plural=(n != 1);"); diff --git a/apps/files_external/l10n/nl.json b/apps/files_external/l10n/nl.json index a17e8e0e1eb..e3ff8826ef5 100644 --- a/apps/files_external/l10n/nl.json +++ b/apps/files_external/l10n/nl.json @@ -99,6 +99,7 @@ "Advanced settings" : "Geavanceerde instellingen", "Delete" : "Verwijder", "Add storage" : "Toevoegen opslag", + "Allow users to mount external storages" : "Sta gebruikers toe om een externe opslag aan te koppelen.", "Allow users to mount the following external storage" : "Sta gebruikers toe de volgende externe opslag aan te koppelen" },"pluralForm" :"nplurals=2; plural=(n != 1);" }
\ No newline at end of file diff --git a/apps/files_external/l10n/ru.js b/apps/files_external/l10n/ru.js index 5550ea780ab..dd8f5c9bdf5 100644 --- a/apps/files_external/l10n/ru.js +++ b/apps/files_external/l10n/ru.js @@ -101,6 +101,7 @@ OC.L10N.register( "Advanced settings" : "Расширенные настройки", "Delete" : "Удалить", "Add storage" : "Добавить хранилище", + "Allow users to mount external storages" : "Разрешить пользователям подключать внешние хранилища", "Allow users to mount the following external storage" : "Разрешить пользователям монтировать следующие сервисы хранения данных" }, "nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);"); diff --git a/apps/files_external/l10n/ru.json b/apps/files_external/l10n/ru.json index 52792a3f09a..04044274379 100644 --- a/apps/files_external/l10n/ru.json +++ b/apps/files_external/l10n/ru.json @@ -99,6 +99,7 @@ "Advanced settings" : "Расширенные настройки", "Delete" : "Удалить", "Add storage" : "Добавить хранилище", + "Allow users to mount external storages" : "Разрешить пользователям подключать внешние хранилища", "Allow users to mount the following external storage" : "Разрешить пользователям монтировать следующие сервисы хранения данных" },"pluralForm" :"nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);" }
\ No newline at end of file diff --git a/apps/files_external/l10n/zh_TW.js b/apps/files_external/l10n/zh_TW.js index d272f82f094..db7bf975017 100644 --- a/apps/files_external/l10n/zh_TW.js +++ b/apps/files_external/l10n/zh_TW.js @@ -1,38 +1,101 @@ OC.L10N.register( "files_external", { + "Fetching request tokens failed. Verify that your app key and secret are correct." : "請求失敗,請驗證您的應用程式金鑰及密碼是否正確", + "Fetching access tokens failed. Verify that your app key and secret are correct." : "存取失敗,請驗證您的應用程式金鑰及密碼是否正確", + "Please provide a valid app key and secret." : "請提供有效的應用程式金鑰及密碼", + "Step 1 failed. Exception: %s" : "步驟 1 失敗,出現異常: %s", + "Step 2 failed. Exception: %s" : "步驟 2 失敗,出現異常: %s", "External storage" : "外部儲存", + "Storage with id \"%i\" not found" : "沒有找到編號 \"%i\" 的儲存空間 ", + "Invalid backend or authentication mechanism class" : "無效的後端處理或是驗證方式", + "Invalid mount point" : "無效的掛載點", + "Objectstore forbidden" : "物件儲存禁止存取", + "Invalid storage backend \"%s\"" : "無效的後端儲存 \"%s\"", + "Not permitted to use backend \"%s\"" : "不被允許使用後端儲存 \"%s\"", + "Not permitted to use authentication mechanism \"%s\"" : "不被允許使用驗證機制 \"%s\"", + "Unsatisfied backend parameters" : "無法滿足後端所需的參數條件", + "Unsatisfied authentication mechanism parameters" : "無法滿足驗證機制所需的參數條件", "Personal" : "個人", "System" : "系統", "Grant access" : "允許存取", "Access granted" : "允許存取", + "Error configuring OAuth1" : "設定 OAuth1 時發生錯誤", + "Error configuring OAuth2" : "設定 OAuth2 時發生錯誤", + "Generate keys" : "產生金鑰", + "Error generating key pair" : "產生金鑰對錯誤", + "Enable encryption" : "啟用加密", + "Enable previews" : "啟動預覽", + "Check for changes" : "檢查變動", + "Never" : "絕不", + "Every time the filesystem is used" : "每當檔案系統使用時", + "All users. Type to select user or group." : "所有人都可以使用,或者選擇特定使用者、群組", + "(group)" : "(群組)", "Saved" : "已儲存", + "Access key" : "存取金鑰", + "Secret key" : "私密金鑰", "None" : "無", + "App key" : "App 金鑰", + "App secret" : "App 密碼", + "Client ID" : "客戶端ID", + "Client secret" : "客戶端密碼", + "OpenStack" : "OpenStack", "Username" : "使用者名稱", "Password" : "密碼", + "Tenant name" : "租戶/專案名稱", + "Identity endpoint URL" : "身份識別終端點 URL", + "Rackspace" : "Rackspace", "API key" : "API金鑰", + "Username and password" : "使用者帳號和密碼", + "RSA public key" : "RSA 公開金鑰", + "Public key" : "公開金鑰", "Amazon S3" : "Amazon S3", + "Bucket" : "Bucket", + "Hostname" : "主機名稱", "Port" : "連接埠", "Region" : "地區", "Enable SSL" : "啟用 SSL", + "Enable Path Style" : "啟用路徑格式", "WebDAV" : "WebDAV", "URL" : "URL", + "Remote subfolder" : "遠端子資料夾", + "Secure https://" : "安全 https://", + "Dropbox" : "Dropbox", + "FTP" : "檔案傳輸協定-FTP", "Host" : "主機", + "Secure ftps://" : "安全 ftps://", + "Google Drive" : "Google 雲端硬碟", "Local" : "本地", "Location" : "地點", "ownCloud" : "ownCloud", + "SFTP" : "安全檔案傳輸協定-SFTP", + "SFTP with secret key login" : "以密碼金鑰登入SFTP", + "SMB / CIFS" : "伺服器訊息區塊-SMB/網路文件共享系統 (CIFS)", "Share" : "分享", + "Domain" : "網域名稱", + "SMB / CIFS using OC login" : "SMB / CIFS 使用 OC 登入", + "Username as share" : "以使用者名稱分享", + "OpenStack Object Storage" : "OpenStack 物件儲存", + "Service name" : "服務名稱", + "Request timeout (seconds)" : "請求超時 (秒)", "<b>Note:</b> " : "<b>警告:</b> ", "<b>Note:</b> The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>警告:</b> PHP 並未啓用 Curl 的支援,因此無法掛載 %s 。請洽您的系統管理員將其安裝並啓用。", "<b>Note:</b> The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>警告</b>:PHP 並未啓用 FTP 的支援,因此無法掛載 %s,請洽您的系統管理員將其安裝並啓用。", "<b>Note:</b> \"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>警告</b>並未安裝 \"%s\",因此無法掛載 %s。請洽您的系統管理員將其安裝並啓用。", + "No external storage configured" : "目前尚未配置任何外部儲存", + "You can add external storages in the personal settings" : "在個人設定裡您可以自行加入外部儲存設定", "Name" : "名稱", + "Storage type" : "儲存類型", + "Scope" : "範圍", "External Storage" : "外部儲存", "Folder name" : "資料夾名稱", + "Authentication" : "驗證", "Configuration" : "設定", "Available for" : "可用的", + "Advanced settings" : "進階設定", "Delete" : "刪除", "Add storage" : "增加儲存區", + "Allow users to mount external storages" : "允許使用者能自行掛載外部儲存", "Allow users to mount the following external storage" : "允許使用者自行掛載以下的外部儲存" }, "nplurals=1; plural=0;"); diff --git a/apps/files_external/l10n/zh_TW.json b/apps/files_external/l10n/zh_TW.json index 3efd2fa691f..760ff7f5841 100644 --- a/apps/files_external/l10n/zh_TW.json +++ b/apps/files_external/l10n/zh_TW.json @@ -1,36 +1,99 @@ { "translations": { + "Fetching request tokens failed. Verify that your app key and secret are correct." : "請求失敗,請驗證您的應用程式金鑰及密碼是否正確", + "Fetching access tokens failed. Verify that your app key and secret are correct." : "存取失敗,請驗證您的應用程式金鑰及密碼是否正確", + "Please provide a valid app key and secret." : "請提供有效的應用程式金鑰及密碼", + "Step 1 failed. Exception: %s" : "步驟 1 失敗,出現異常: %s", + "Step 2 failed. Exception: %s" : "步驟 2 失敗,出現異常: %s", "External storage" : "外部儲存", + "Storage with id \"%i\" not found" : "沒有找到編號 \"%i\" 的儲存空間 ", + "Invalid backend or authentication mechanism class" : "無效的後端處理或是驗證方式", + "Invalid mount point" : "無效的掛載點", + "Objectstore forbidden" : "物件儲存禁止存取", + "Invalid storage backend \"%s\"" : "無效的後端儲存 \"%s\"", + "Not permitted to use backend \"%s\"" : "不被允許使用後端儲存 \"%s\"", + "Not permitted to use authentication mechanism \"%s\"" : "不被允許使用驗證機制 \"%s\"", + "Unsatisfied backend parameters" : "無法滿足後端所需的參數條件", + "Unsatisfied authentication mechanism parameters" : "無法滿足驗證機制所需的參數條件", "Personal" : "個人", "System" : "系統", "Grant access" : "允許存取", "Access granted" : "允許存取", + "Error configuring OAuth1" : "設定 OAuth1 時發生錯誤", + "Error configuring OAuth2" : "設定 OAuth2 時發生錯誤", + "Generate keys" : "產生金鑰", + "Error generating key pair" : "產生金鑰對錯誤", + "Enable encryption" : "啟用加密", + "Enable previews" : "啟動預覽", + "Check for changes" : "檢查變動", + "Never" : "絕不", + "Every time the filesystem is used" : "每當檔案系統使用時", + "All users. Type to select user or group." : "所有人都可以使用,或者選擇特定使用者、群組", + "(group)" : "(群組)", "Saved" : "已儲存", + "Access key" : "存取金鑰", + "Secret key" : "私密金鑰", "None" : "無", + "App key" : "App 金鑰", + "App secret" : "App 密碼", + "Client ID" : "客戶端ID", + "Client secret" : "客戶端密碼", + "OpenStack" : "OpenStack", "Username" : "使用者名稱", "Password" : "密碼", + "Tenant name" : "租戶/專案名稱", + "Identity endpoint URL" : "身份識別終端點 URL", + "Rackspace" : "Rackspace", "API key" : "API金鑰", + "Username and password" : "使用者帳號和密碼", + "RSA public key" : "RSA 公開金鑰", + "Public key" : "公開金鑰", "Amazon S3" : "Amazon S3", + "Bucket" : "Bucket", + "Hostname" : "主機名稱", "Port" : "連接埠", "Region" : "地區", "Enable SSL" : "啟用 SSL", + "Enable Path Style" : "啟用路徑格式", "WebDAV" : "WebDAV", "URL" : "URL", + "Remote subfolder" : "遠端子資料夾", + "Secure https://" : "安全 https://", + "Dropbox" : "Dropbox", + "FTP" : "檔案傳輸協定-FTP", "Host" : "主機", + "Secure ftps://" : "安全 ftps://", + "Google Drive" : "Google 雲端硬碟", "Local" : "本地", "Location" : "地點", "ownCloud" : "ownCloud", + "SFTP" : "安全檔案傳輸協定-SFTP", + "SFTP with secret key login" : "以密碼金鑰登入SFTP", + "SMB / CIFS" : "伺服器訊息區塊-SMB/網路文件共享系統 (CIFS)", "Share" : "分享", + "Domain" : "網域名稱", + "SMB / CIFS using OC login" : "SMB / CIFS 使用 OC 登入", + "Username as share" : "以使用者名稱分享", + "OpenStack Object Storage" : "OpenStack 物件儲存", + "Service name" : "服務名稱", + "Request timeout (seconds)" : "請求超時 (秒)", "<b>Note:</b> " : "<b>警告:</b> ", "<b>Note:</b> The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>警告:</b> PHP 並未啓用 Curl 的支援,因此無法掛載 %s 。請洽您的系統管理員將其安裝並啓用。", "<b>Note:</b> The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>警告</b>:PHP 並未啓用 FTP 的支援,因此無法掛載 %s,請洽您的系統管理員將其安裝並啓用。", "<b>Note:</b> \"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>警告</b>並未安裝 \"%s\",因此無法掛載 %s。請洽您的系統管理員將其安裝並啓用。", + "No external storage configured" : "目前尚未配置任何外部儲存", + "You can add external storages in the personal settings" : "在個人設定裡您可以自行加入外部儲存設定", "Name" : "名稱", + "Storage type" : "儲存類型", + "Scope" : "範圍", "External Storage" : "外部儲存", "Folder name" : "資料夾名稱", + "Authentication" : "驗證", "Configuration" : "設定", "Available for" : "可用的", + "Advanced settings" : "進階設定", "Delete" : "刪除", "Add storage" : "增加儲存區", + "Allow users to mount external storages" : "允許使用者能自行掛載外部儲存", "Allow users to mount the following external storage" : "允許使用者自行掛載以下的外部儲存" },"pluralForm" :"nplurals=1; plural=0;" }
\ No newline at end of file diff --git a/apps/files_external/lib/amazons3.php b/apps/files_external/lib/amazons3.php index 00915140bab..4b867c005a7 100644 --- a/apps/files_external/lib/amazons3.php +++ b/apps/files_external/lib/amazons3.php @@ -418,27 +418,6 @@ class AmazonS3 extends \OC\Files\Storage\Common { return false; } - public function getMimeType($path) { - $path = $this->normalizePath($path); - - if ($this->is_dir($path)) { - return 'httpd/unix-directory'; - } else if ($this->file_exists($path)) { - try { - $result = $this->getConnection()->headObject(array( - 'Bucket' => $this->bucket, - 'Key' => $path - )); - } catch (S3Exception $e) { - \OCP\Util::logException('files_external', $e); - return false; - } - - return $result['ContentType']; - } - return false; - } - public function touch($path, $mtime = null) { $path = $this->normalizePath($path); diff --git a/apps/files_external/lib/dropbox.php b/apps/files_external/lib/dropbox.php index 3b353b7777a..df8a0255134 100644 --- a/apps/files_external/lib/dropbox.php +++ b/apps/files_external/lib/dropbox.php @@ -299,18 +299,6 @@ class Dropbox extends \OC\Files\Storage\Common { } } - public function getMimeType($path) { - if ($this->filetype($path) == 'dir') { - return 'httpd/unix-directory'; - } else { - $metaData = $this->getDropBoxMetaData($path); - if ($metaData) { - return $metaData['mime_type']; - } - } - return false; - } - public function free_space($path) { try { $info = $this->dropbox->getAccountInfo(); diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index b9454b8d671..beb47ce0bce 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -361,18 +361,6 @@ class Swift extends \OC\Files\Storage\Common { } } - public function getMimeType($path) { - $path = $this->normalizePath($path); - - if ($this->is_dir($path)) { - return 'httpd/unix-directory'; - } else if ($this->file_exists($path)) { - $object = $this->getContainer()->getPartialObject($path); - return $object->getContentType(); - } - return false; - } - public function touch($path, $mtime = null) { $path = $this->normalizePath($path); if (is_null($mtime)) { diff --git a/apps/files_external/tests/service/userglobalstoragesservicetest.php b/apps/files_external/tests/service/userglobalstoragesservicetest.php index 1b902b6eee5..e88764d0f78 100644 --- a/apps/files_external/tests/service/userglobalstoragesservicetest.php +++ b/apps/files_external/tests/service/userglobalstoragesservicetest.php @@ -1,6 +1,7 @@ <?php /** * @author Robin McCorkell <rmccorkell@karoshi.org.uk> + * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/ajax/external.php b/apps/files_sharing/ajax/external.php index c80f0e0b288..0f8a3d56cf0 100644 --- a/apps/files_sharing/ajax/external.php +++ b/apps/files_sharing/ajax/external.php @@ -5,7 +5,7 @@ * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_sharing/ajax/list.php b/apps/files_sharing/ajax/list.php index 9819048b881..c7f0bde5d4a 100644 --- a/apps/files_sharing/ajax/list.php +++ b/apps/files_sharing/ajax/list.php @@ -3,7 +3,7 @@ * @author Joas Schilling <nickvergessen@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Vincent Petry <pvince81@owncloud.com> * diff --git a/apps/files_sharing/ajax/publicpreview.php b/apps/files_sharing/ajax/publicpreview.php index 62157e0ac0e..2902969b21f 100644 --- a/apps/files_sharing/ajax/publicpreview.php +++ b/apps/files_sharing/ajax/publicpreview.php @@ -4,7 +4,7 @@ * @author Georg Ehrke <georg@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_sharing/api/local.php b/apps/files_sharing/api/local.php index 42e77570f95..bb5136a0c99 100644 --- a/apps/files_sharing/api/local.php +++ b/apps/files_sharing/api/local.php @@ -4,7 +4,7 @@ * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Vincent Petry <pvince81@owncloud.com> * diff --git a/apps/files_sharing/api/remote.php b/apps/files_sharing/api/remote.php index d67920c3521..41ebb6e2eab 100644 --- a/apps/files_sharing/api/remote.php +++ b/apps/files_sharing/api/remote.php @@ -1,7 +1,7 @@ <?php /** * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php index 2e0468039b4..93998ad774e 100644 --- a/apps/files_sharing/api/server2server.php +++ b/apps/files_sharing/api/server2server.php @@ -3,6 +3,7 @@ * @author Arthur Schiwon <blizzz@owncloud.com> * @author Björn Schießle <schiessle@owncloud.com> * @author Joas Schilling <nickvergessen@owncloud.com> + * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * * @copyright Copyright (c) 2015, ownCloud, Inc. @@ -25,6 +26,7 @@ namespace OCA\Files_Sharing\API; use OCA\Files_Sharing\Activity; +use OCP\Files\NotFoundException; class Server2Server { @@ -264,7 +266,11 @@ class Server2Server { private function getFile($user, $fileSource) { \OC_Util::setupFS($user); - $file = \OC\Files\Filesystem::getPath($fileSource); + try { + $file = \OC\Files\Filesystem::getPath($fileSource); + } catch (NotFoundException $e) { + $file = null; + } $args = \OC\Files\Filesystem::is_dir($file) ? array('dir' => $file) : array('dir' => dirname($file), 'scrollto' => $file); $link = \OCP\Util::linkToAbsolute('files', 'index.php', $args); diff --git a/apps/files_sharing/api/sharees.php b/apps/files_sharing/api/sharees.php index b34aef72163..21f68d9b253 100644 --- a/apps/files_sharing/api/sharees.php +++ b/apps/files_sharing/api/sharees.php @@ -1,7 +1,7 @@ <?php /** * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/appinfo/application.php b/apps/files_sharing/appinfo/application.php index 9dc0e0618b5..545a9425083 100644 --- a/apps/files_sharing/appinfo/application.php +++ b/apps/files_sharing/appinfo/application.php @@ -3,7 +3,8 @@ * @author Joas Schilling <nickvergessen@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> + * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/appinfo/install.php b/apps/files_sharing/appinfo/install.php index 607e990346a..5185ae883f3 100644 --- a/apps/files_sharing/appinfo/install.php +++ b/apps/files_sharing/appinfo/install.php @@ -1,6 +1,7 @@ <?php /** * @author Joas Schilling <nickvergessen@owncloud.com> + * @author Morris Jobke <hey@morrisjobke.de> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/appinfo/routes.php b/apps/files_sharing/appinfo/routes.php index a466c4fc6cc..db7aa126c4e 100644 --- a/apps/files_sharing/appinfo/routes.php +++ b/apps/files_sharing/appinfo/routes.php @@ -5,7 +5,7 @@ * @author Joas Schilling <nickvergessen@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_sharing/appinfo/update.php b/apps/files_sharing/appinfo/update.php index 03fb78a05af..8bff20cc442 100644 --- a/apps/files_sharing/appinfo/update.php +++ b/apps/files_sharing/appinfo/update.php @@ -2,6 +2,7 @@ /** * @author Björn Schießle <schiessle@owncloud.com> * @author Joas Schilling <nickvergessen@owncloud.com> + * @author Morris Jobke <hey@morrisjobke.de> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js index 2e798a92578..edf138b97ae 100644 --- a/apps/files_sharing/js/sharedfilelist.js +++ b/apps/files_sharing/js/sharedfilelist.js @@ -123,6 +123,9 @@ this._reloadCall.abort(); } + // there is only root + this._setCurrentDir('/', false); + var promises = []; var shares = $.ajax({ url: OC.linkToOCS('apps/files_sharing/api/v1') + 'shares', @@ -173,17 +176,14 @@ if (shares[0].ocs && shares[0].ocs.data) { files = files.concat(this._makeFilesFromShares(shares[0].ocs.data)); - } else { - // TODO: error handling } if (remoteShares && remoteShares[0].ocs && remoteShares[0].ocs.data) { files = files.concat(this._makeFilesFromRemoteShares(remoteShares[0].ocs.data)); - } else { - // TODO: error handling } this.setFiles(files); + return true; }, _makeFilesFromRemoteShares: function(data) { diff --git a/apps/files_sharing/l10n/ja.js b/apps/files_sharing/l10n/ja.js index d2e3bc9b263..b80be0c3315 100644 --- a/apps/files_sharing/l10n/ja.js +++ b/apps/files_sharing/l10n/ja.js @@ -38,10 +38,23 @@ OC.L10N.register( "Public shared file %1$s was downloaded" : "公開共有ファイル %1$s がダウンロードされました", "You shared %1$s with %2$s" : "あなたは %1$s を %2$s と共有しました", "You shared %1$s with group %2$s" : "あなたは %1$s をグループ %2$s と共有しました", + "%2$s shared %1$s with %3$s" : "%2$s は %1$s を %3$s と共有しました", + "%2$s shared %1$s with group %3$s" : "%2$s は %1$s をグループ %3$s と共有しました", + "%2$s shared %1$s via link" : "%2$s はリンク経由で %1$s を共有しました", "%2$s shared %1$s with you" : "%2$s は %1$s をあなたと共有しました", "You shared %1$s via link" : "リンク経由で %1$s を共有しています", + "Downloaded via public link" : "公開リンクからダウンロードしました", + "Shared with %2$s" : "%2$s と共有しました", + "Shared with group %2$s" : "%2$s グループと共有しました", + "Shared with %3$s by %2$s" : "%3$s と %2$s で共有しました", + "Shared with group %3$s by %2$s" : "%3$s グループと %2$s で共有しました", + "Shared via link by %2$s" : "リンク経由で %2$s が共有しました", + "Shared by %2$s" : "%2$s が共有", + "Shared via public link" : "公開リンク経由で共有中", "Shares" : "共有", + "You received %2$s as a remote share from %1$s" : "%1$s からリモート共有として %2$s を受け取りました。", "Accept" : "承諾", + "Decline" : "拒否《はてなキーワード》", "Share with me through my #ownCloud Federated Cloud ID, see %s" : "#ownCloud の「クラウド連携ID」で私と共有できます。こちらを見てください。%s", "Share with me through my #ownCloud Federated Cloud ID" : "#ownCloud の「クラウド連携ID」で私と共有できます。", "This share is password-protected" : "この共有はパスワードで保護されています", diff --git a/apps/files_sharing/l10n/ja.json b/apps/files_sharing/l10n/ja.json index 16ca792e33d..8f9efffb782 100644 --- a/apps/files_sharing/l10n/ja.json +++ b/apps/files_sharing/l10n/ja.json @@ -36,10 +36,23 @@ "Public shared file %1$s was downloaded" : "公開共有ファイル %1$s がダウンロードされました", "You shared %1$s with %2$s" : "あなたは %1$s を %2$s と共有しました", "You shared %1$s with group %2$s" : "あなたは %1$s をグループ %2$s と共有しました", + "%2$s shared %1$s with %3$s" : "%2$s は %1$s を %3$s と共有しました", + "%2$s shared %1$s with group %3$s" : "%2$s は %1$s をグループ %3$s と共有しました", + "%2$s shared %1$s via link" : "%2$s はリンク経由で %1$s を共有しました", "%2$s shared %1$s with you" : "%2$s は %1$s をあなたと共有しました", "You shared %1$s via link" : "リンク経由で %1$s を共有しています", + "Downloaded via public link" : "公開リンクからダウンロードしました", + "Shared with %2$s" : "%2$s と共有しました", + "Shared with group %2$s" : "%2$s グループと共有しました", + "Shared with %3$s by %2$s" : "%3$s と %2$s で共有しました", + "Shared with group %3$s by %2$s" : "%3$s グループと %2$s で共有しました", + "Shared via link by %2$s" : "リンク経由で %2$s が共有しました", + "Shared by %2$s" : "%2$s が共有", + "Shared via public link" : "公開リンク経由で共有中", "Shares" : "共有", + "You received %2$s as a remote share from %1$s" : "%1$s からリモート共有として %2$s を受け取りました。", "Accept" : "承諾", + "Decline" : "拒否《はてなキーワード》", "Share with me through my #ownCloud Federated Cloud ID, see %s" : "#ownCloud の「クラウド連携ID」で私と共有できます。こちらを見てください。%s", "Share with me through my #ownCloud Federated Cloud ID" : "#ownCloud の「クラウド連携ID」で私と共有できます。", "This share is password-protected" : "この共有はパスワードで保護されています", diff --git a/apps/files_sharing/l10n/lv.js b/apps/files_sharing/l10n/lv.js index 9c2f4d3fe48..f59a8d0b395 100644 --- a/apps/files_sharing/l10n/lv.js +++ b/apps/files_sharing/l10n/lv.js @@ -56,6 +56,7 @@ OC.L10N.register( "Download %s" : "Lejupielādēt %s", "Direct link" : "Tiešā saite", "Federated Cloud Sharing" : "Federatīva mākoņkoplietošana", + "Open documentation" : "Atvērt dokumentāciju", "Allow users on this server to send shares to other servers" : "Atļaut šī servera lietotājiem sūtīt koplietotnes uz citiem serveriem", "Allow users on this server to receive shares from other servers" : "Atļaut šī servera lietotājiem saņem koplietotnes no citiem serveriem" }, diff --git a/apps/files_sharing/l10n/lv.json b/apps/files_sharing/l10n/lv.json index abc16e3ad68..7c7e43cce4b 100644 --- a/apps/files_sharing/l10n/lv.json +++ b/apps/files_sharing/l10n/lv.json @@ -54,6 +54,7 @@ "Download %s" : "Lejupielādēt %s", "Direct link" : "Tiešā saite", "Federated Cloud Sharing" : "Federatīva mākoņkoplietošana", + "Open documentation" : "Atvērt dokumentāciju", "Allow users on this server to send shares to other servers" : "Atļaut šī servera lietotājiem sūtīt koplietotnes uz citiem serveriem", "Allow users on this server to receive shares from other servers" : "Atļaut šī servera lietotājiem saņem koplietotnes no citiem serveriem" },"pluralForm" :"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);" diff --git a/apps/files_sharing/l10n/nb_NO.js b/apps/files_sharing/l10n/nb_NO.js index a8f7fbdbc9b..4f7fb08ef16 100644 --- a/apps/files_sharing/l10n/nb_NO.js +++ b/apps/files_sharing/l10n/nb_NO.js @@ -43,6 +43,14 @@ OC.L10N.register( "%2$s shared %1$s via link" : "%2$s delte %1$s via lenke", "%2$s shared %1$s with you" : "%2$s delte %1$s med deg", "You shared %1$s via link" : "Du delte %1$s via lenke", + "Downloaded via public link" : "Nedlastet via offentlig lenke", + "Shared with %2$s" : "Delt med %2$s", + "Shared with group %2$s" : "Delt med gruppe %2$s", + "Shared with %3$s by %2$s" : "Delt med %3$s av %2$s", + "Shared with group %3$s by %2$s" : "Delt med gruppe %3$s av %2$s", + "Shared via link by %2$s" : "Delt via lenke av %2$s", + "Shared by %2$s" : "Delt av %2$s", + "Shared via public link" : "Delt via offentlig lenke", "Shares" : "Delinger", "You received %2$s as a remote share from %1$s" : "Du mottok %2$s som en ekstern deling fra %1$s", "Accept" : "Aksepter", diff --git a/apps/files_sharing/l10n/nb_NO.json b/apps/files_sharing/l10n/nb_NO.json index e9c67955708..e75f095f354 100644 --- a/apps/files_sharing/l10n/nb_NO.json +++ b/apps/files_sharing/l10n/nb_NO.json @@ -41,6 +41,14 @@ "%2$s shared %1$s via link" : "%2$s delte %1$s via lenke", "%2$s shared %1$s with you" : "%2$s delte %1$s med deg", "You shared %1$s via link" : "Du delte %1$s via lenke", + "Downloaded via public link" : "Nedlastet via offentlig lenke", + "Shared with %2$s" : "Delt med %2$s", + "Shared with group %2$s" : "Delt med gruppe %2$s", + "Shared with %3$s by %2$s" : "Delt med %3$s av %2$s", + "Shared with group %3$s by %2$s" : "Delt med gruppe %3$s av %2$s", + "Shared via link by %2$s" : "Delt via lenke av %2$s", + "Shared by %2$s" : "Delt av %2$s", + "Shared via public link" : "Delt via offentlig lenke", "Shares" : "Delinger", "You received %2$s as a remote share from %1$s" : "Du mottok %2$s som en ekstern deling fra %1$s", "Accept" : "Aksepter", diff --git a/apps/files_sharing/l10n/zh_TW.js b/apps/files_sharing/l10n/zh_TW.js index bc49d1d8a48..eecbbf1f92e 100644 --- a/apps/files_sharing/l10n/zh_TW.js +++ b/apps/files_sharing/l10n/zh_TW.js @@ -2,24 +2,58 @@ OC.L10N.register( "files_sharing", { "Server to server sharing is not enabled on this server" : "伺服器對伺服器共享在這台伺服器上面並未啟用", + "Invalid or untrusted SSL certificate" : "無效或是不信任的SSL憑證", + "Could not authenticate to remote share, password might be wrong" : "無法驗證遠端分享,可能是密碼錯誤", + "Storage not valid" : "儲存空間無法使用", "Couldn't add remote share" : "無法加入遠端分享", "Shared with you" : "與你分享", "Shared with others" : "與其他人分享", "Shared by link" : "由連結分享", + "Nothing shared with you yet" : "目前沒有任何與您分享的內容", + "Files and folders others share with you will show up here" : "與您分享的檔案與資料夾將會顯示在這裡", + "Nothing shared yet" : "目前沒有分享內容", + "Files and folders you share will show up here" : "您分享的檔案與資料夾將會顯示在這裡", + "No shared links" : "沒有已分享的連結", + "Files and folders you share by link will show up here" : "您分享的檔案與資料夾連結將會顯示在這裡", "Do you want to add the remote share {name} from {owner}@{remote}?" : "是否要加入來自 {owner}@{remote} 的遠端分享 {name} ?", "Remote share" : "遠端分享", "Remote share password" : "遠端分享密碼", "Cancel" : "取消", "Add remote share" : "加入遠端分享", + "You can upload into this folder" : "你可以上傳內容到此資料夾", + "No ownCloud installation (7 or higher) found at {remote}" : "沒有在 {remote} 找到 ownCloud (本版7 或 更新版)", "Invalid ownCloud url" : "無效的 ownCloud URL", "Shared by" : "由...分享", "Sharing" : "分享", "A file or folder has been <strong>shared</strong>" : "檔案或目錄已被 <strong>分享</strong>", + "A file or folder was shared from <strong>another server</strong>" : "檔案或目錄已被 <strong>其他伺服器</strong> 分享", + "A public shared file or folder was <strong>downloaded</strong>" : "共享檔案或目錄已被 <strong>下載</strong>", + "You received a new remote share %2$s from %1$s" : "您收到了一個遠端分享 %2$s 來自於 %1$s", + "You received a new remote share from %s" : "您收到了一個遠端分享來自於 %s", + "%1$s accepted remote share %2$s" : "%1$s 接受了遠端分享 %2$s", + "%1$s declined remote share %2$s" : "%1$s 拒絕了遠端分享 %2$s", + "Public shared folder %1$s was downloaded" : "共享資料夾 %1$s 已被下載", + "Public shared file %1$s was downloaded" : "共享檔案 %1$s 已被下載", "You shared %1$s with %2$s" : "您與 %2$s 分享了 %1$s", "You shared %1$s with group %2$s" : "您與 %2$s 群組分享了 %1$s", + "%2$s shared %1$s with %3$s" : "%2$s 與 %3$s 分享了 %1$s", + "%2$s shared %1$s with group %3$s" : "%2$s 與群組 %3$s 分享了 %1$s", + "%2$s shared %1$s via link" : "%2$s 透過連結分享了 %1$s ", "%2$s shared %1$s with you" : "%2$s 與您分享了 %1$s", "You shared %1$s via link" : "您以連結分享了 %1$s", + "Downloaded via public link" : "透過公用連結下載", + "Shared with %2$s" : "與 %2$s 分享", + "Shared with group %2$s" : "與群組 %2$s 分享", + "Shared with %3$s by %2$s" : "透過 %2$s 與 %3$s 分享", + "Shared with group %3$s by %2$s" : "透過 %2$s 與群組 %3$s 分享", + "Shared via link by %2$s" : "%2$s 透過連結分享", + "Shared by %2$s" : "由 %2$s 分享", + "Shared via public link" : "透過公用連結分享", "Shares" : "分享", + "Accept" : "接受", + "Decline" : "拒絕", + "Share with me through my #ownCloud Federated Cloud ID, see %s" : "可透過我的 #ownCloud 聯合 ID,與我分享,請看 %s", + "Share with me through my #ownCloud Federated Cloud ID" : "可透過我的 #ownCloud 聯合 ID,與我分享", "This share is password-protected" : "這個分享有密碼保護", "The password is wrong. Try again." : "請檢查您的密碼並再試一次", "Password" : "密碼", @@ -36,6 +70,15 @@ OC.L10N.register( "Download" : "下載", "Download %s" : "下載 %s", "Direct link" : "直接連結", - "Federated Cloud Sharing" : "聯盟式雲端分享" + "Federated Cloud Sharing" : "聯盟式雲端分享", + "Open documentation" : "開啟文件", + "Allow users on this server to send shares to other servers" : "允許這台伺服器上的使用者發送分享給其他伺服器", + "Allow users on this server to receive shares from other servers" : "允許這台伺服器上的使用者發送接收來自其他伺服器的分享", + "Federated Cloud" : "聯盟式雲端", + "Your Federated Cloud ID:" : "您的雲端聯盟ID:", + "Share it:" : "分享它:", + "Add to your website" : "新增至您的網站", + "Share with me via ownCloud" : "透果ownCloud與我分享", + "HTML Code:" : "HTML 代碼:" }, "nplurals=1; plural=0;"); diff --git a/apps/files_sharing/l10n/zh_TW.json b/apps/files_sharing/l10n/zh_TW.json index 3567ed51df4..14be4c11d55 100644 --- a/apps/files_sharing/l10n/zh_TW.json +++ b/apps/files_sharing/l10n/zh_TW.json @@ -1,23 +1,57 @@ { "translations": { "Server to server sharing is not enabled on this server" : "伺服器對伺服器共享在這台伺服器上面並未啟用", + "Invalid or untrusted SSL certificate" : "無效或是不信任的SSL憑證", + "Could not authenticate to remote share, password might be wrong" : "無法驗證遠端分享,可能是密碼錯誤", + "Storage not valid" : "儲存空間無法使用", "Couldn't add remote share" : "無法加入遠端分享", "Shared with you" : "與你分享", "Shared with others" : "與其他人分享", "Shared by link" : "由連結分享", + "Nothing shared with you yet" : "目前沒有任何與您分享的內容", + "Files and folders others share with you will show up here" : "與您分享的檔案與資料夾將會顯示在這裡", + "Nothing shared yet" : "目前沒有分享內容", + "Files and folders you share will show up here" : "您分享的檔案與資料夾將會顯示在這裡", + "No shared links" : "沒有已分享的連結", + "Files and folders you share by link will show up here" : "您分享的檔案與資料夾連結將會顯示在這裡", "Do you want to add the remote share {name} from {owner}@{remote}?" : "是否要加入來自 {owner}@{remote} 的遠端分享 {name} ?", "Remote share" : "遠端分享", "Remote share password" : "遠端分享密碼", "Cancel" : "取消", "Add remote share" : "加入遠端分享", + "You can upload into this folder" : "你可以上傳內容到此資料夾", + "No ownCloud installation (7 or higher) found at {remote}" : "沒有在 {remote} 找到 ownCloud (本版7 或 更新版)", "Invalid ownCloud url" : "無效的 ownCloud URL", "Shared by" : "由...分享", "Sharing" : "分享", "A file or folder has been <strong>shared</strong>" : "檔案或目錄已被 <strong>分享</strong>", + "A file or folder was shared from <strong>another server</strong>" : "檔案或目錄已被 <strong>其他伺服器</strong> 分享", + "A public shared file or folder was <strong>downloaded</strong>" : "共享檔案或目錄已被 <strong>下載</strong>", + "You received a new remote share %2$s from %1$s" : "您收到了一個遠端分享 %2$s 來自於 %1$s", + "You received a new remote share from %s" : "您收到了一個遠端分享來自於 %s", + "%1$s accepted remote share %2$s" : "%1$s 接受了遠端分享 %2$s", + "%1$s declined remote share %2$s" : "%1$s 拒絕了遠端分享 %2$s", + "Public shared folder %1$s was downloaded" : "共享資料夾 %1$s 已被下載", + "Public shared file %1$s was downloaded" : "共享檔案 %1$s 已被下載", "You shared %1$s with %2$s" : "您與 %2$s 分享了 %1$s", "You shared %1$s with group %2$s" : "您與 %2$s 群組分享了 %1$s", + "%2$s shared %1$s with %3$s" : "%2$s 與 %3$s 分享了 %1$s", + "%2$s shared %1$s with group %3$s" : "%2$s 與群組 %3$s 分享了 %1$s", + "%2$s shared %1$s via link" : "%2$s 透過連結分享了 %1$s ", "%2$s shared %1$s with you" : "%2$s 與您分享了 %1$s", "You shared %1$s via link" : "您以連結分享了 %1$s", + "Downloaded via public link" : "透過公用連結下載", + "Shared with %2$s" : "與 %2$s 分享", + "Shared with group %2$s" : "與群組 %2$s 分享", + "Shared with %3$s by %2$s" : "透過 %2$s 與 %3$s 分享", + "Shared with group %3$s by %2$s" : "透過 %2$s 與群組 %3$s 分享", + "Shared via link by %2$s" : "%2$s 透過連結分享", + "Shared by %2$s" : "由 %2$s 分享", + "Shared via public link" : "透過公用連結分享", "Shares" : "分享", + "Accept" : "接受", + "Decline" : "拒絕", + "Share with me through my #ownCloud Federated Cloud ID, see %s" : "可透過我的 #ownCloud 聯合 ID,與我分享,請看 %s", + "Share with me through my #ownCloud Federated Cloud ID" : "可透過我的 #ownCloud 聯合 ID,與我分享", "This share is password-protected" : "這個分享有密碼保護", "The password is wrong. Try again." : "請檢查您的密碼並再試一次", "Password" : "密碼", @@ -34,6 +68,15 @@ "Download" : "下載", "Download %s" : "下載 %s", "Direct link" : "直接連結", - "Federated Cloud Sharing" : "聯盟式雲端分享" + "Federated Cloud Sharing" : "聯盟式雲端分享", + "Open documentation" : "開啟文件", + "Allow users on this server to send shares to other servers" : "允許這台伺服器上的使用者發送分享給其他伺服器", + "Allow users on this server to receive shares from other servers" : "允許這台伺服器上的使用者發送接收來自其他伺服器的分享", + "Federated Cloud" : "聯盟式雲端", + "Your Federated Cloud ID:" : "您的雲端聯盟ID:", + "Share it:" : "分享它:", + "Add to your website" : "新增至您的網站", + "Share with me via ownCloud" : "透果ownCloud與我分享", + "HTML Code:" : "HTML 代碼:" },"pluralForm" :"nplurals=1; plural=0;" }
\ No newline at end of file diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php index 9f3bf6508b1..2e615e231f1 100644 --- a/apps/files_sharing/lib/cache.php +++ b/apps/files_sharing/lib/cache.php @@ -8,7 +8,7 @@ * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Vincent Petry <pvince81@owncloud.com> diff --git a/apps/files_sharing/lib/capabilities.php b/apps/files_sharing/lib/capabilities.php index c8ba1273281..220878ec2aa 100644 --- a/apps/files_sharing/lib/capabilities.php +++ b/apps/files_sharing/lib/capabilities.php @@ -1,6 +1,6 @@ <?php /** - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/lib/controllers/externalsharescontroller.php b/apps/files_sharing/lib/controllers/externalsharescontroller.php index 71cc956ec98..edf065ab476 100644 --- a/apps/files_sharing/lib/controllers/externalsharescontroller.php +++ b/apps/files_sharing/lib/controllers/externalsharescontroller.php @@ -3,7 +3,7 @@ * @author Björn Schießle <schiessle@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/lib/controllers/sharecontroller.php b/apps/files_sharing/lib/controllers/sharecontroller.php index 616b64e6c59..4b446d79ada 100644 --- a/apps/files_sharing/lib/controllers/sharecontroller.php +++ b/apps/files_sharing/lib/controllers/sharecontroller.php @@ -7,6 +7,7 @@ * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> + * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 @@ -333,8 +334,7 @@ class ShareController extends Controller { OC_Util::tearDownFS(); OC_Util::setupFS($rootLinkItem['uid_owner']); $path = Filesystem::getPath($linkItem['file_source']); - - if(!empty($path) && Filesystem::isReadable($path)) { + if(Filesystem::isReadable($path)) { return $path; } } diff --git a/apps/files_sharing/lib/exceptions/s2sexception.php b/apps/files_sharing/lib/exceptions/s2sexception.php index d914e9e06db..fe2659d36ff 100644 --- a/apps/files_sharing/lib/exceptions/s2sexception.php +++ b/apps/files_sharing/lib/exceptions/s2sexception.php @@ -2,7 +2,7 @@ /** * @author Björn Schießle <schiessle@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/external/manager.php index 86b8904cc9a..93e2cdb540b 100644 --- a/apps/files_sharing/lib/external/manager.php +++ b/apps/files_sharing/lib/external/manager.php @@ -5,8 +5,7 @@ * @author Jörn Friedrich Dreyer <jfd@butonic.de> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * @author Vincent Petry <pvince81@owncloud.com> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/lib/helper.php b/apps/files_sharing/lib/helper.php index b15f70fcde3..a804737c490 100644 --- a/apps/files_sharing/lib/helper.php +++ b/apps/files_sharing/lib/helper.php @@ -7,7 +7,7 @@ * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. @@ -28,6 +28,8 @@ */ namespace OCA\Files_Sharing; +use OCP\Files\NotFoundException; + class Helper { public static function registerHooks() { @@ -48,6 +50,7 @@ class Helper { * @param string $token string share token * @param string $relativePath optional path relative to the share * @param string $password optional password + * @return array */ public static function setupFromToken($token, $relativePath = null, $password = null) { \OC_User::setIncognitoMode(true); @@ -71,10 +74,11 @@ class Helper { \OCP\JSON::checkUserExists($rootLinkItem['uid_owner']); \OC_Util::tearDownFS(); \OC_Util::setupFS($rootLinkItem['uid_owner']); - $path = \OC\Files\Filesystem::getPath($linkItem['file_source']); } - if ($path === null) { + try { + $path = \OC\Files\Filesystem::getPath($linkItem['file_source']); + } catch (NotFoundException $e) { \OCP\Util::writeLog('share', 'could not resolve linkItem', \OCP\Util::DEBUG); \OC_Response::setStatus(404); \OCP\JSON::error(array('success' => false)); diff --git a/apps/files_sharing/lib/middleware/sharingcheckmiddleware.php b/apps/files_sharing/lib/middleware/sharingcheckmiddleware.php index 9170c08b59d..22b9d32a275 100644 --- a/apps/files_sharing/lib/middleware/sharingcheckmiddleware.php +++ b/apps/files_sharing/lib/middleware/sharingcheckmiddleware.php @@ -2,7 +2,7 @@ /** * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_sharing/lib/propagation/propagationmanager.php b/apps/files_sharing/lib/propagation/propagationmanager.php index 6ed70e93f84..aac9428240d 100644 --- a/apps/files_sharing/lib/propagation/propagationmanager.php +++ b/apps/files_sharing/lib/propagation/propagationmanager.php @@ -1,6 +1,7 @@ <?php /** * @author Robin Appelman <icewind@owncloud.com> + * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/lib/propagation/recipientpropagator.php b/apps/files_sharing/lib/propagation/recipientpropagator.php index 8e064e2ee54..5eacf4c0f6e 100644 --- a/apps/files_sharing/lib/propagation/recipientpropagator.php +++ b/apps/files_sharing/lib/propagation/recipientpropagator.php @@ -1,5 +1,6 @@ <?php /** + * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> * @@ -25,6 +26,7 @@ namespace OCA\Files_Sharing\Propagation; use OC\Files\Cache\ChangePropagator; use OC\Files\View; use OC\Share\Share; +use OCP\Files\NotFoundException; /** * Propagate etags for share recipients @@ -128,6 +130,9 @@ class RecipientPropagator { protected $propagatingIds = []; + /** + * @param int $id + */ public function propagateById($id) { if (isset($this->propagatingIds[$id])) { return; @@ -142,7 +147,13 @@ class RecipientPropagator { if ($share['share_with'] === $this->userId) { $user = $share['uid_owner']; $view = new View('/' . $user . '/files'); - $path = $view->getPath($share['file_source']); + + try { + $path = $view->getPath($share['file_source']); + } catch (NotFoundException $e) { + $path = null; + } + $watcher = new ChangeWatcher($view, $this->manager->getSharePropagator($user)); $watcher->writeHook(['path' => $path]); } diff --git a/apps/files_sharing/lib/share/file.php b/apps/files_sharing/lib/share/file.php index 6c676f47a0c..ffc417db2f4 100644 --- a/apps/files_sharing/lib/share/file.php +++ b/apps/files_sharing/lib/share/file.php @@ -3,10 +3,11 @@ * @author Andreas Fischer <bantu@owncloud.com> * @author Bart Visscher <bartv@thisnet.nl> * @author Björn Schießle <schiessle@owncloud.com> + * @author Lukas Reschke <lukas@owncloud.com> * @author Michael Gapczynski <GapczynskiM@gmail.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Vincent Petry <pvince81@owncloud.com> * @@ -40,15 +41,16 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { private $path; public function isValidSource($itemSource, $uidOwner) { - $path = \OC\Files\Filesystem::getPath($itemSource); - if ($path) { + try { + $path = \OC\Files\Filesystem::getPath($itemSource); // FIXME: attributes should not be set here, // keeping this pattern for now to avoid unexpected // regressions $this->path = \OC\Files\Filesystem::normalizePath(basename($path)); return true; + } catch (\OCP\Files\NotFoundException $e) { + return false; } - return false; } public function getFilePath($itemSource, $uidOwner) { @@ -57,12 +59,13 @@ class OC_Share_Backend_File implements OCP\Share_Backend_File_Dependent { $this->path = null; return $path; } else { - $path = \OC\Files\Filesystem::getPath($itemSource); - if ($path) { + try { + $path = \OC\Files\Filesystem::getPath($itemSource); return $path; + } catch (\OCP\Files\NotFoundException $e) { + return false; } } - return false; } /** diff --git a/apps/files_sharing/lib/share/folder.php b/apps/files_sharing/lib/share/folder.php index daa5b5e9eb8..5e7cd8099db 100644 --- a/apps/files_sharing/lib/share/folder.php +++ b/apps/files_sharing/lib/share/folder.php @@ -5,7 +5,7 @@ * @author Michael Gapczynski <GapczynskiM@gmail.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/lib/sharedmount.php b/apps/files_sharing/lib/sharedmount.php index 85eb264ce09..a1387957867 100644 --- a/apps/files_sharing/lib/sharedmount.php +++ b/apps/files_sharing/lib/sharedmount.php @@ -4,7 +4,7 @@ * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index b0e56f5f054..18e02844179 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -7,7 +7,7 @@ * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author scambra <sergio@entrecables.com> * @author Vincent Petry <pvince81@owncloud.com> * diff --git a/apps/files_sharing/lib/updater.php b/apps/files_sharing/lib/updater.php index d70ed23b941..26044cc1c8e 100644 --- a/apps/files_sharing/lib/updater.php +++ b/apps/files_sharing/lib/updater.php @@ -5,7 +5,7 @@ * @author Michael Gapczynski <GapczynskiM@gmail.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_sharing/tests/api.php b/apps/files_sharing/tests/api.php index 3809b812051..760bc0591e5 100644 --- a/apps/files_sharing/tests/api.php +++ b/apps/files_sharing/tests/api.php @@ -5,7 +5,7 @@ * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Vincent Petry <pvince81@owncloud.com> * diff --git a/apps/files_sharing/tests/api/shareestest.php b/apps/files_sharing/tests/api/shareestest.php index 923881d4569..8a35350aeb5 100644 --- a/apps/files_sharing/tests/api/shareestest.php +++ b/apps/files_sharing/tests/api/shareestest.php @@ -1,7 +1,7 @@ <?php /** * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/tests/capabilities.php b/apps/files_sharing/tests/capabilities.php index b151f47a468..8bebde9f2d1 100644 --- a/apps/files_sharing/tests/capabilities.php +++ b/apps/files_sharing/tests/capabilities.php @@ -1,7 +1,7 @@ <?php /** * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/tests/controller/externalsharecontroller.php b/apps/files_sharing/tests/controller/externalsharecontroller.php index 7bc11f7fb94..4913c7308ba 100644 --- a/apps/files_sharing/tests/controller/externalsharecontroller.php +++ b/apps/files_sharing/tests/controller/externalsharecontroller.php @@ -1,7 +1,7 @@ <?php /** * @author Lukas Reschke <lukas@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/tests/controller/sharecontroller.php b/apps/files_sharing/tests/controller/sharecontroller.php index 0b56aafc8a9..db5eb75d761 100644 --- a/apps/files_sharing/tests/controller/sharecontroller.php +++ b/apps/files_sharing/tests/controller/sharecontroller.php @@ -199,8 +199,7 @@ class ShareControllerTest extends \Test\TestCase { } /** - * @expectedException \Exception - * @expectedExceptionMessage No file found belonging to file. + * @expectedException \OCP\Files\NotFoundException */ public function testShowShareWithDeletedFile() { $this->container['UserManager']->expects($this->once()) @@ -216,8 +215,7 @@ class ShareControllerTest extends \Test\TestCase { } /** - * @expectedException \Exception - * @expectedExceptionMessage No file found belonging to file. + * @expectedException \OCP\Files\NotFoundException */ public function testDownloadShareWithDeletedFile() { $this->container['UserManager']->expects($this->once()) diff --git a/apps/files_sharing/tests/etagpropagation.php b/apps/files_sharing/tests/etagpropagation.php index 2490fef03e1..1abf04df84f 100644 --- a/apps/files_sharing/tests/etagpropagation.php +++ b/apps/files_sharing/tests/etagpropagation.php @@ -1,5 +1,7 @@ <?php /** + * @author Jörn Friedrich Dreyer <jfd@butonic.de> + * @author Lukas Reschke <lukas@owncloud.com> * @author Robin Appelman <icewind@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> * @@ -173,7 +175,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsChanged($users, 'sub1/sub2'); } - private function assertAllUnchaged() { + private function assertAllUnchanged() { $users = [self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]; $this->assertEtagsNotChanged($users); @@ -186,7 +188,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testOwnerWritesToSingleFileShare() { @@ -195,7 +197,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsNotChanged([self::TEST_FILES_SHARING_API_USER4, self::TEST_FILES_SHARING_API_USER3]); $this->assertEtagsChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testOwnerWritesToShareWithReshare() { @@ -204,7 +206,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testOwnerRenameInShare() { @@ -214,7 +216,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testOwnerRenameInReShare() { @@ -223,7 +225,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testOwnerRenameIntoReShare() { @@ -232,7 +234,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testOwnerRenameOutOfReShare() { @@ -241,7 +243,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testOwnerDeleteInShare() { @@ -251,7 +253,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testOwnerDeleteInReShare() { @@ -260,7 +262,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testOwnerUnshares() { @@ -283,7 +285,7 @@ class EtagPropagation extends TestCase { self::TEST_FILES_SHARING_API_USER4, ]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testRecipientUnsharesFromSelf() { @@ -298,7 +300,7 @@ class EtagPropagation extends TestCase { self::TEST_FILES_SHARING_API_USER4, ]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testRecipientWritesToShare() { @@ -308,7 +310,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testRecipientWritesToReshare() { @@ -317,7 +319,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testRecipientWritesToOtherRecipientsReshare() { @@ -326,7 +328,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testRecipientRenameInShare() { @@ -336,7 +338,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testRecipientRenameInReShare() { @@ -345,7 +347,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testRecipientRenameResharedFolder() { @@ -356,7 +358,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsChanged([self::TEST_FILES_SHARING_API_USER2], 'sub1'); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testRecipientDeleteInShare() { @@ -366,7 +368,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testRecipientDeleteInReShare() { @@ -375,7 +377,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testReshareRecipientWritesToReshare() { @@ -384,7 +386,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testReshareRecipientRenameInReShare() { @@ -393,7 +395,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testReshareRecipientDeleteInReShare() { @@ -402,7 +404,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER3, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testRecipientUploadInDirectReshare() { @@ -411,7 +413,7 @@ class EtagPropagation extends TestCase { $this->assertEtagsNotChanged([self::TEST_FILES_SHARING_API_USER3]); $this->assertEtagsChanged([self::TEST_FILES_SHARING_API_USER1, self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } public function testEtagChangeOnPermissionsChange() { @@ -424,6 +426,6 @@ class EtagPropagation extends TestCase { $this->assertEtagsForFoldersChanged([self::TEST_FILES_SHARING_API_USER2, self::TEST_FILES_SHARING_API_USER4]); - $this->assertAllUnchaged(); + $this->assertAllUnchanged(); } } diff --git a/apps/files_sharing/tests/expiresharesjobtest.php b/apps/files_sharing/tests/expiresharesjobtest.php index 90da4011d8b..63a2c46f647 100644 --- a/apps/files_sharing/tests/expiresharesjobtest.php +++ b/apps/files_sharing/tests/expiresharesjobtest.php @@ -1,6 +1,6 @@ <?php /** - * @author Vincent Petry <pvince81@owncloud.com> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/tests/external/managertest.php b/apps/files_sharing/tests/external/managertest.php index 7242779d455..5b93b7494e9 100644 --- a/apps/files_sharing/tests/external/managertest.php +++ b/apps/files_sharing/tests/external/managertest.php @@ -1,6 +1,7 @@ <?php /** * @author Joas Schilling <nickvergessen@owncloud.com> + * @author Robin Appelman <icewind@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_sharing/tests/grouppropagationmanager.php b/apps/files_sharing/tests/grouppropagationmanager.php index 6fc6ef7a532..ea32ca4f7ec 100644 --- a/apps/files_sharing/tests/grouppropagationmanager.php +++ b/apps/files_sharing/tests/grouppropagationmanager.php @@ -1,7 +1,5 @@ <?php /** - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php b/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php index 0269f77d0d5..031f8c1b970 100644 --- a/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php +++ b/apps/files_sharing/tests/middleware/sharingcheckmiddleware.php @@ -2,7 +2,7 @@ /** * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_sharing/tests/sharedmount.php b/apps/files_sharing/tests/sharedmount.php index 6f487892b8f..94c0ad448bc 100644 --- a/apps/files_sharing/tests/sharedmount.php +++ b/apps/files_sharing/tests/sharedmount.php @@ -4,7 +4,7 @@ * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Vincent Petry <pvince81@owncloud.com> * diff --git a/apps/files_sharing/tests/sizepropagation.php b/apps/files_sharing/tests/sizepropagation.php index c596003de76..1d09f69449f 100644 --- a/apps/files_sharing/tests/sizepropagation.php +++ b/apps/files_sharing/tests/sizepropagation.php @@ -1,5 +1,6 @@ <?php /** + * @author Jörn Friedrich Dreyer <jfd@butonic.de> * @author Robin Appelman <icewind@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_trashbin/ajax/delete.php b/apps/files_trashbin/ajax/delete.php index 7ce8d632e4b..40d1811717c 100644 --- a/apps/files_trashbin/ajax/delete.php +++ b/apps/files_trashbin/ajax/delete.php @@ -4,7 +4,7 @@ * @author Björn Schießle <schiessle@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_trashbin/ajax/preview.php b/apps/files_trashbin/ajax/preview.php index 90add53f77f..49d6d93f574 100644 --- a/apps/files_trashbin/ajax/preview.php +++ b/apps/files_trashbin/ajax/preview.php @@ -3,7 +3,7 @@ * @author Björn Schießle <schiessle@owncloud.com> * @author Georg Ehrke <georg@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php index 01dc91f9bac..f0e5ce6d889 100644 --- a/apps/files_trashbin/ajax/undelete.php +++ b/apps/files_trashbin/ajax/undelete.php @@ -4,7 +4,7 @@ * @author Björn Schießle <schiessle@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Robin Appelman <icewind@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Vincent Petry <pvince81@owncloud.com> * diff --git a/apps/files_trashbin/appinfo/application.php b/apps/files_trashbin/appinfo/application.php index 08ab7cd5c1d..59553abfb14 100644 --- a/apps/files_trashbin/appinfo/application.php +++ b/apps/files_trashbin/appinfo/application.php @@ -1,6 +1,6 @@ <?php /** - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Victor Dubiniuk <dubiniuk@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_trashbin/appinfo/routes.php b/apps/files_trashbin/appinfo/routes.php index caa9f0864a1..f3b97d8687c 100644 --- a/apps/files_trashbin/appinfo/routes.php +++ b/apps/files_trashbin/appinfo/routes.php @@ -1,7 +1,7 @@ <?php /** * @author Lukas Reschke <lukas@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_trashbin/l10n/zh_TW.js b/apps/files_trashbin/l10n/zh_TW.js index 85d0873eddf..e0ad6dbd723 100644 --- a/apps/files_trashbin/l10n/zh_TW.js +++ b/apps/files_trashbin/l10n/zh_TW.js @@ -5,13 +5,15 @@ OC.L10N.register( "Couldn't restore %s" : "無法還原 %s", "Deleted files" : "回收桶", "Restore" : "還原", + "Delete" : "刪除", "Delete permanently" : "永久刪除", "Error" : "錯誤", "restored" : "已還原", + "No deleted files" : "沒有已刪除的檔案", + "You will be able to recover deleted files from here" : "您可以從這裡還原已刪除的檔案", "No entries found in this folder" : "在此資料夾中沒有任何項目", "Select all" : "全選", "Name" : "名稱", - "Deleted" : "已刪除", - "Delete" : "刪除" + "Deleted" : "已刪除" }, "nplurals=1; plural=0;"); diff --git a/apps/files_trashbin/l10n/zh_TW.json b/apps/files_trashbin/l10n/zh_TW.json index 5c744f828c9..6a313220b58 100644 --- a/apps/files_trashbin/l10n/zh_TW.json +++ b/apps/files_trashbin/l10n/zh_TW.json @@ -3,13 +3,15 @@ "Couldn't restore %s" : "無法還原 %s", "Deleted files" : "回收桶", "Restore" : "還原", + "Delete" : "刪除", "Delete permanently" : "永久刪除", "Error" : "錯誤", "restored" : "已還原", + "No deleted files" : "沒有已刪除的檔案", + "You will be able to recover deleted files from here" : "您可以從這裡還原已刪除的檔案", "No entries found in this folder" : "在此資料夾中沒有任何項目", "Select all" : "全選", "Name" : "名稱", - "Deleted" : "已刪除", - "Delete" : "刪除" + "Deleted" : "已刪除" },"pluralForm" :"nplurals=1; plural=0;" }
\ No newline at end of file diff --git a/apps/files_trashbin/lib/capabilities.php b/apps/files_trashbin/lib/capabilities.php index c991cc8be65..d903066e676 100644 --- a/apps/files_trashbin/lib/capabilities.php +++ b/apps/files_trashbin/lib/capabilities.php @@ -2,7 +2,7 @@ /** * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_trashbin/lib/helper.php b/apps/files_trashbin/lib/helper.php index 3d6a02c7776..d14e97285c5 100644 --- a/apps/files_trashbin/lib/helper.php +++ b/apps/files_trashbin/lib/helper.php @@ -5,7 +5,7 @@ * @author Jörn Friedrich Dreyer <jfd@butonic.de> * @author Robin Appelman <icewind@owncloud.com> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 839a47a7bf2..8f0fe745a45 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -12,7 +12,7 @@ * @author Qingping Hou <dave2008713@gmail.com> * @author Robin Appelman <icewind@owncloud.com> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Sjors van der Pluijm <sjors@desjors.nl> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Victor Dubiniuk <dubiniuk@owncloud.com> @@ -41,6 +41,7 @@ use OC\Files\Filesystem; use OC\Files\View; use OCA\Files_Trashbin\AppInfo\Application; use OCA\Files_Trashbin\Command\Expire; +use OCP\Files\NotFoundException; class Trashbin { @@ -64,15 +65,24 @@ class Trashbin { self::getUidAndFilename($params['path']); } + /** + * @param string $filename + * @return array + * @throws \OC\User\NoUserException + */ public static function getUidAndFilename($filename) { $uid = \OC\Files\Filesystem::getOwner($filename); \OC\Files\Filesystem::initMountPoints($uid); if ($uid != \OCP\User::getUser()) { $info = \OC\Files\Filesystem::getFileInfo($filename); $ownerView = new \OC\Files\View('/' . $uid . '/files'); - $filename = $ownerView->getPath($info['fileid']); + try { + $filename = $ownerView->getPath($info['fileid']); + } catch (NotFoundException $e) { + $filename = null; + } } - return array($uid, $filename); + return [$uid, $filename]; } /** diff --git a/apps/files_versions/ajax/preview.php b/apps/files_versions/ajax/preview.php index d7bc44f17a2..0da518f3eaa 100644 --- a/apps/files_versions/ajax/preview.php +++ b/apps/files_versions/ajax/preview.php @@ -1,7 +1,7 @@ <?php /** * @author Björn Schießle <schiessle@owncloud.com> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Vincent Petry <pvince81@owncloud.com> * diff --git a/apps/files_versions/appinfo/application.php b/apps/files_versions/appinfo/application.php index 00723e621ac..ba0a2ae74cb 100644 --- a/apps/files_versions/appinfo/application.php +++ b/apps/files_versions/appinfo/application.php @@ -1,6 +1,6 @@ <?php /** - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Victor Dubiniuk <dubiniuk@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_versions/appinfo/routes.php b/apps/files_versions/appinfo/routes.php index 9bab86d9224..b2ed477de68 100644 --- a/apps/files_versions/appinfo/routes.php +++ b/apps/files_versions/appinfo/routes.php @@ -4,7 +4,7 @@ * @author Jörn Friedrich Dreyer <jfd@butonic.de> * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Tom Needham <tom@owncloud.com> * diff --git a/apps/files_versions/lib/capabilities.php b/apps/files_versions/lib/capabilities.php index 11b98038f46..ba4de906c70 100644 --- a/apps/files_versions/lib/capabilities.php +++ b/apps/files_versions/lib/capabilities.php @@ -2,7 +2,7 @@ /** * @author Christopher Schäpers <kondou@ts.unde.re> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Tom Needham <tom@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/files_versions/lib/storage.php b/apps/files_versions/lib/storage.php index dd8af1b8d18..6737bf20f90 100644 --- a/apps/files_versions/lib/storage.php +++ b/apps/files_versions/lib/storage.php @@ -44,6 +44,7 @@ namespace OCA\Files_Versions; use OCA\Files_Versions\AppInfo\Application; use OCA\Files_Versions\Command\Expire; use OCP\Lock\ILockingProvider; +use OCP\Files\NotFoundException; class Storage { @@ -74,15 +75,24 @@ class Storage { /** @var \OCA\Files_Versions\AppInfo\Application */ private static $application; + /** + * @param string $filename + * @return array + * @throws \OC\User\NoUserException + */ public static function getUidAndFilename($filename) { $uid = \OC\Files\Filesystem::getOwner($filename); \OC\Files\Filesystem::initMountPoints($uid); if ( $uid != \OCP\User::getUser() ) { $info = \OC\Files\Filesystem::getFileInfo($filename); $ownerView = new \OC\Files\View('/'.$uid.'/files'); - $filename = $ownerView->getPath($info['fileid']); + try { + $filename = $ownerView->getPath($info['fileid']); + } catch (NotFoundException $e) { + $filename = null; + } } - return array($uid, $filename); + return [$uid, $filename]; } /** diff --git a/apps/files_versions/tests/command/expiretest.php b/apps/files_versions/tests/command/expiretest.php index eb622689c33..eccc1f4c2ad 100644 --- a/apps/files_versions/tests/command/expiretest.php +++ b/apps/files_versions/tests/command/expiretest.php @@ -1,6 +1,7 @@ <?php /** * @author Joas Schilling <nickvergessen@owncloud.com> + * @author Jörn Friedrich Dreyer <jfd@butonic.de> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/files_versions/tests/versions.php b/apps/files_versions/tests/versions.php index 2979de2ac98..b9bc0932a84 100644 --- a/apps/files_versions/tests/versions.php +++ b/apps/files_versions/tests/versions.php @@ -759,7 +759,11 @@ class Test_Files_Versioning extends \Test\TestCase { ); } - private function createAndCheckVersions($view, $path) { + /** + * @param \OC\Files\View $view + * @param string $path + */ + private function createAndCheckVersions(\OC\Files\View $view, $path) { $view->file_put_contents($path, 'test file'); $view->file_put_contents($path, 'version 1'); $view->file_put_contents($path, 'version 2'); @@ -782,7 +786,6 @@ class Test_Files_Versioning extends \Test\TestCase { /** * @param string $user * @param bool $create - * @param bool $password */ public static function loginHelper($user, $create = false) { diff --git a/apps/provisioning_api/appinfo/app.php b/apps/provisioning_api/appinfo/app.php deleted file mode 100644 index 40d8d5d04d3..00000000000 --- a/apps/provisioning_api/appinfo/app.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/** - - * - * @copyright Copyright (c) 2015, 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/> - * - */ diff --git a/apps/provisioning_api/appinfo/routes.php b/apps/provisioning_api/appinfo/routes.php index 17cfea26572..2a4b50dc27c 100644 --- a/apps/provisioning_api/appinfo/routes.php +++ b/apps/provisioning_api/appinfo/routes.php @@ -1,8 +1,9 @@ <?php /** * @author Joas Schilling <nickvergessen@owncloud.com> + * @author michag86 <micha_g@arcor.de> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Tom Needham <tom@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/provisioning_api/lib/apps.php b/apps/provisioning_api/lib/apps.php index ba920c7a9c9..e0fa63cca34 100644 --- a/apps/provisioning_api/lib/apps.php +++ b/apps/provisioning_api/lib/apps.php @@ -3,7 +3,7 @@ * @author Joas Schilling <nickvergessen@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Tom Needham <tom@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/provisioning_api/lib/groups.php b/apps/provisioning_api/lib/groups.php index 7e7515bc709..5b613562324 100644 --- a/apps/provisioning_api/lib/groups.php +++ b/apps/provisioning_api/lib/groups.php @@ -3,7 +3,7 @@ * @author Joas Schilling <nickvergessen@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Tom Needham <tom@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/provisioning_api/lib/users.php b/apps/provisioning_api/lib/users.php index 0b529bcea2c..527b107ad50 100644 --- a/apps/provisioning_api/lib/users.php +++ b/apps/provisioning_api/lib/users.php @@ -2,8 +2,9 @@ /** * @author Joas Schilling <nickvergessen@owncloud.com> * @author Lukas Reschke <lukas@owncloud.com> + * @author michag86 <micha_g@arcor.de> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Tom Needham <tom@owncloud.com> * diff --git a/apps/provisioning_api/tests/appstest.php b/apps/provisioning_api/tests/appstest.php index 2baea5bbc8c..2e1a86025c2 100644 --- a/apps/provisioning_api/tests/appstest.php +++ b/apps/provisioning_api/tests/appstest.php @@ -2,7 +2,7 @@ /** * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Tom Needham <tom@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/provisioning_api/tests/groupstest.php b/apps/provisioning_api/tests/groupstest.php index 4afd246abcd..c75ba76bd35 100644 --- a/apps/provisioning_api/tests/groupstest.php +++ b/apps/provisioning_api/tests/groupstest.php @@ -2,7 +2,7 @@ /** * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Tom Needham <tom@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/provisioning_api/tests/testcase.php b/apps/provisioning_api/tests/testcase.php index 6135a6d2f96..113bc512243 100644 --- a/apps/provisioning_api/tests/testcase.php +++ b/apps/provisioning_api/tests/testcase.php @@ -2,7 +2,7 @@ /** * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 diff --git a/apps/provisioning_api/tests/userstest.php b/apps/provisioning_api/tests/userstest.php index b43041bbbf9..607e6f118ae 100644 --- a/apps/provisioning_api/tests/userstest.php +++ b/apps/provisioning_api/tests/userstest.php @@ -2,7 +2,7 @@ /** * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> - * @author Roeland Jago Douma <roeland@famdouma.nl> + * @author Roeland Jago Douma <rullzer@owncloud.com> * @author Thomas Müller <thomas.mueller@tmit.eu> * @author Tom Needham <tom@owncloud.com> * @author Vincent Petry <pvince81@owncloud.com> diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index 4fd029c74da..d7ca786a439 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -6,6 +6,7 @@ * @author Bart Visscher <bartv@thisnet.nl> * @author Christopher Schäpers <kondou@ts.unde.re> * @author Frédéric Fortier <frederic.fortier@oronospolytechnique.com> + * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Nicolas Grekas <nicolas.grekas@gmail.com> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> diff --git a/apps/user_ldap/l10n/fr.js b/apps/user_ldap/l10n/fr.js index 3bf26f0e3ea..9e863ada3b5 100644 --- a/apps/user_ldap/l10n/fr.js +++ b/apps/user_ldap/l10n/fr.js @@ -39,7 +39,7 @@ OC.L10N.register( "Select attributes" : "Sélectionner les attributs", "User not found. Please check your login attributes and username. Effective filter (to copy-and-paste for command line validation): <br/>" : "Utilisateur introuvable. Veuillez vérifier les attributs de login et le nom d'utilisateur. Filtre effectif (à copier-coller pour valider en ligne de commande):<br/>", "User found and settings verified." : "Utilisateur trouvé et paramètres vérifiés.", - "Settings verified, but one user found. Only the first will be able to login. Consider a more narrow filter." : "Paramètres vérifiés, mais seul le premier utilisateur pourra se connecter. Utilisez plutôt un filtre moins restrictif.", + "Settings verified, but one user found. Only the first will be able to login. Consider a more narrow filter." : "Settings verified, but one user found. Only the first will be able to login. Consider a more narrow filter.", "An unspecified error occurred. Please check the settings and the log." : "Une erreur inconnue s'est produite. Veuillez vérifier les paramètres et le log.", "The search filter is invalid, probably due to syntax issues like uneven number of opened and closed brackets. Please revise." : "Le filtre de recherche n'est pas valide, probablement à cause de problèmes de syntaxe tels que des parenthèses manquantes. Veuillez le corriger.", "A connection error to LDAP / AD occurred, please check host, port and credentials." : "Une erreur s'est produite lors de la connexion au LDAP / AD. Veuillez vérifier l'hôte, le port et les informations d'identification.", diff --git a/apps/user_ldap/l10n/fr.json b/apps/user_ldap/l10n/fr.json index 87cf780e825..a26710c340b 100644 --- a/apps/user_ldap/l10n/fr.json +++ b/apps/user_ldap/l10n/fr.json @@ -37,7 +37,7 @@ "Select attributes" : "Sélectionner les attributs", "User not found. Please check your login attributes and username. Effective filter (to copy-and-paste for command line validation): <br/>" : "Utilisateur introuvable. Veuillez vérifier les attributs de login et le nom d'utilisateur. Filtre effectif (à copier-coller pour valider en ligne de commande):<br/>", "User found and settings verified." : "Utilisateur trouvé et paramètres vérifiés.", - "Settings verified, but one user found. Only the first will be able to login. Consider a more narrow filter." : "Paramètres vérifiés, mais seul le premier utilisateur pourra se connecter. Utilisez plutôt un filtre moins restrictif.", + "Settings verified, but one user found. Only the first will be able to login. Consider a more narrow filter." : "Settings verified, but one user found. Only the first will be able to login. Consider a more narrow filter.", "An unspecified error occurred. Please check the settings and the log." : "Une erreur inconnue s'est produite. Veuillez vérifier les paramètres et le log.", "The search filter is invalid, probably due to syntax issues like uneven number of opened and closed brackets. Please revise." : "Le filtre de recherche n'est pas valide, probablement à cause de problèmes de syntaxe tels que des parenthèses manquantes. Veuillez le corriger.", "A connection error to LDAP / AD occurred, please check host, port and credentials." : "Une erreur s'est produite lors de la connexion au LDAP / AD. Veuillez vérifier l'hôte, le port et les informations d'identification.", diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 32472c13b03..dd8ffe14bca 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -691,8 +691,9 @@ class Access extends LDAPUtility implements user\IUserTools { * @param array $ldapRecords */ public function batchApplyUserAttributes(array $ldapRecords){ + $displayNameAttribute = strtolower($this->connection->ldapUserDisplayName); foreach($ldapRecords as $userRecord) { - $ocName = $this->dn2ocname($userRecord['dn'][0], $userRecord[$this->connection->ldapUserDisplayName]); + $ocName = $this->dn2ocname($userRecord['dn'][0], $userRecord[$displayNameAttribute]); $this->cacheUserExists($ocName); $user = $this->userManager->get($ocName); $user->processAttributes($userRecord); diff --git a/apps/user_ldap/lib/configuration.php b/apps/user_ldap/lib/configuration.php index 4a6263de9aa..e1ca624af95 100644 --- a/apps/user_ldap/lib/configuration.php +++ b/apps/user_ldap/lib/configuration.php @@ -3,6 +3,7 @@ * @author Alexander Bergolth <leo@strike.wu.ac.at> * @author Arthur Schiwon <blizzz@owncloud.com> * @author Jörn Friedrich Dreyer <jfd@butonic.de> + * @author Lennart Rosam <hello@takuto.de> * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * @author Robin McCorkell <rmccorkell@karoshi.org.uk> diff --git a/apps/user_ldap/lib/filesystemhelper.php b/apps/user_ldap/lib/filesystemhelper.php index 6d431f6cb43..ee8c26d2f59 100644 --- a/apps/user_ldap/lib/filesystemhelper.php +++ b/apps/user_ldap/lib/filesystemhelper.php @@ -1,6 +1,7 @@ <?php /** * @author Arthur Schiwon <blizzz@owncloud.com> + * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/user_ldap/lib/user/deletedusersindex.php b/apps/user_ldap/lib/user/deletedusersindex.php index f8c1406d77e..6b58595cce6 100644 --- a/apps/user_ldap/lib/user/deletedusersindex.php +++ b/apps/user_ldap/lib/user/deletedusersindex.php @@ -1,6 +1,7 @@ <?php /** * @author Arthur Schiwon <blizzz@owncloud.com> + * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/user_ldap/lib/user/manager.php b/apps/user_ldap/lib/user/manager.php index 89bbc849887..4a687c0832a 100644 --- a/apps/user_ldap/lib/user/manager.php +++ b/apps/user_ldap/lib/user/manager.php @@ -1,6 +1,7 @@ <?php /** * @author Arthur Schiwon <blizzz@owncloud.com> + * @author Joas Schilling <nickvergessen@owncloud.com> * @author Jörn Friedrich Dreyer <jfd@butonic.de> * @author Morris Jobke <hey@morrisjobke.de> * diff --git a/apps/user_ldap/lib/user/offlineuser.php b/apps/user_ldap/lib/user/offlineuser.php index 8177e84346f..72c02427928 100644 --- a/apps/user_ldap/lib/user/offlineuser.php +++ b/apps/user_ldap/lib/user/offlineuser.php @@ -1,6 +1,7 @@ <?php /** * @author Arthur Schiwon <blizzz@owncloud.com> + * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/user_ldap/lib/user/user.php b/apps/user_ldap/lib/user/user.php index 756b923e7e5..0dc3c8c0c26 100644 --- a/apps/user_ldap/lib/user/user.php +++ b/apps/user_ldap/lib/user/user.php @@ -1,6 +1,7 @@ <?php /** * @author Arthur Schiwon <blizzz@owncloud.com> + * @author Joas Schilling <nickvergessen@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * * @copyright Copyright (c) 2015, ownCloud, Inc. @@ -416,9 +417,9 @@ class User { } //can be null $quotaDefault = $this->connection->ldapQuotaDefault; - $quota = !is_null($valueFromLDAP) - ? $valueFromLDAP - : $quotaDefault !== '' ? $quotaDefault : null; + $quota = $quotaDefault !== '' ? $quotaDefault : null; + $quota = !is_null($valueFromLDAP) ? $valueFromLDAP : $quota; + if(is_null($valueFromLDAP)) { $quotaAttribute = $this->connection->ldapQuotaAttribute; if(!empty($quotaAttribute)) { diff --git a/apps/user_ldap/tests/access.php b/apps/user_ldap/tests/access.php index cb6dbf0cd5d..25e871d9b3d 100644 --- a/apps/user_ldap/tests/access.php +++ b/apps/user_ldap/tests/access.php @@ -230,24 +230,34 @@ class Test_Access extends \Test\TestCase { $mapperMock = $this->getMockBuilder('\OCA\User_LDAP\Mapping\UserMapping') ->disableOriginalConstructor() ->getMock(); + + $mapperMock->expects($this->any()) + ->method('getNameByDN') + ->will($this->returnValue('a_username')); + $userMock = $this->getMockBuilder('\OCA\user_ldap\lib\user\User') ->disableOriginalConstructor() ->getMock(); + $access->connection->expects($this->any()) + ->method('__get') + ->will($this->returnValue('displayName')); + $access->setUserMapper($mapperMock); + $displayNameAttribute = strtolower($access->connection->ldapUserDisplayName); $data = array( array( 'dn' => 'foobar', - $con->ldapUserDisplayName => 'barfoo' + $displayNameAttribute => 'barfoo' ), array( 'dn' => 'foo', - $con->ldapUserDisplayName => 'bar' + $displayNameAttribute => 'bar' ), array( 'dn' => 'raboof', - $con->ldapUserDisplayName => 'oofrab' + $displayNameAttribute => 'oofrab' ) ); diff --git a/apps/user_ldap/tests/group_ldap.php b/apps/user_ldap/tests/group_ldap.php index 49af5e3fe34..6a6d5bc7ca1 100644 --- a/apps/user_ldap/tests/group_ldap.php +++ b/apps/user_ldap/tests/group_ldap.php @@ -3,6 +3,7 @@ * @author Arthur Schiwon <blizzz@owncloud.com> * @author Frédéric Fortier <frederic.fortier@oronospolytechnique.com> * @author Joas Schilling <nickvergessen@owncloud.com> + * @author Lukas Reschke <lukas@owncloud.com> * @author Morris Jobke <hey@morrisjobke.de> * * @copyright Copyright (c) 2015, ownCloud, Inc. diff --git a/apps/user_ldap/tests/user/user.php b/apps/user_ldap/tests/user/user.php index 1c41eb71ec2..19581d835d1 100644 --- a/apps/user_ldap/tests/user/user.php +++ b/apps/user_ldap/tests/user/user.php @@ -370,6 +370,45 @@ class Test_User_User extends \Test\TestCase { $user->updateQuota(); } + public function testUpdateQuotaFromValue() { + list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = + $this->getTestInstances(); + + list($access, $connection) = + $this->getAdvancedMocks($config, $filesys, $log, $avaMgr, $dbc); + + $readQuota = '19 GB'; + + $connection->expects($this->at(0)) + ->method('__get') + ->with($this->equalTo('ldapQuotaDefault')) + ->will($this->returnValue('')); + + $connection->expects($this->once(1)) + ->method('__get') + ->with($this->equalTo('ldapQuotaDefault')) + ->will($this->returnValue(null)); + + $access->expects($this->never()) + ->method('readAttribute'); + + $config->expects($this->once()) + ->method('setUserValue') + ->with($this->equalTo('alice'), + $this->equalTo('files'), + $this->equalTo('quota'), + $this->equalTo($readQuota)) + ->will($this->returnValue(true)); + + $uid = 'alice'; + $dn = 'uid=alice,dc=foo,dc=bar'; + + $user = new User( + $uid, $dn, $access, $config, $filesys, $image, $log, $avaMgr); + + $user->updateQuota($readQuota); + } + //the testUpdateAvatar series also implicitely tests getAvatarImage public function testUpdateAvatarJpegPhotoProvided() { list($access, $config, $filesys, $image, $log, $avaMgr, $dbc) = |