diff options
Diffstat (limited to 'apps/files_external')
-rw-r--r-- | apps/files_external/l10n/it.js | 1 | ||||
-rw-r--r-- | apps/files_external/l10n/it.json | 1 | ||||
-rw-r--r-- | apps/files_external/l10n/nl.js | 8 | ||||
-rw-r--r-- | apps/files_external/l10n/nl.json | 8 | ||||
-rw-r--r-- | apps/files_external/service/storagesservice.php | 4 | ||||
-rw-r--r-- | apps/files_external/tests/service/globalstoragesservicetest.php | 28 | ||||
-rw-r--r-- | apps/files_external/tests/service/userglobalstoragesservicetest.php | 5 |
7 files changed, 53 insertions, 2 deletions
diff --git a/apps/files_external/l10n/it.js b/apps/files_external/l10n/it.js index deeb824f57f..6e3596e197d 100644 --- a/apps/files_external/l10n/it.js +++ b/apps/files_external/l10n/it.js @@ -31,6 +31,7 @@ OC.L10N.register( "Invalid storage backend \"%s\"" : "Motore di archiviazione \"%s\" non valido", "Unsatisfied backend parameters" : "Parametri del motore non soddisfatti", "Unsatisfied authentication mechanism parameters" : "Parametri del meccanismo di autenticazione non soddisfatti", + "Admin-only storage backend \"%s\"" : "Motore di archiviazione per soli amministratori \"%s\"", "Personal" : "Personale", "System" : "Sistema", "Grant access" : "Concedi l'accesso", diff --git a/apps/files_external/l10n/it.json b/apps/files_external/l10n/it.json index f1282447100..1c64b7dbadd 100644 --- a/apps/files_external/l10n/it.json +++ b/apps/files_external/l10n/it.json @@ -29,6 +29,7 @@ "Invalid storage backend \"%s\"" : "Motore di archiviazione \"%s\" non valido", "Unsatisfied backend parameters" : "Parametri del motore non soddisfatti", "Unsatisfied authentication mechanism parameters" : "Parametri del meccanismo di autenticazione non soddisfatti", + "Admin-only storage backend \"%s\"" : "Motore di archiviazione per soli amministratori \"%s\"", "Personal" : "Personale", "System" : "Sistema", "Grant access" : "Concedi l'accesso", diff --git a/apps/files_external/l10n/nl.js b/apps/files_external/l10n/nl.js index a9a66934753..d43bb0f9794 100644 --- a/apps/files_external/l10n/nl.js +++ b/apps/files_external/l10n/nl.js @@ -1,6 +1,9 @@ OC.L10N.register( "files_external", { + "Fetching request tokens failed. Verify that your app key and secret are correct." : "Ophalen aanvraag tokens mislukt. Verifieer dat uw app sleutel en geheime sleutel juist zijn.", + "Fetching access tokens failed. Verify that your app key and secret are correct." : "Ophalen toegangstokens mislukt. Verifieer dat uw app sleutel en geheime sleutel juist zijn.", + "Please provide a valid app key and secret." : "Geef een geldige app sleutel en geheime sleutel op.", "Step 1 failed. Exception: %s" : "Stap 1 is mislukt. Uitzondering: %s", "Step 2 failed. Exception: %s" : "Stap 2 is mislukt. Uitzondering: %s", "External storage" : "Externe opslag", @@ -22,8 +25,13 @@ OC.L10N.register( "SFTP with secret key login" : "SFTP met geheime sleutel inlog", "Public key" : "Publieke sleutel", "Storage with id \"%i\" not found" : "Opslag met id \"%i\" niet gevonden", + "Invalid backend or authentication mechanism class" : "Ongeldige backend of authenticatie mechanisme klasse", "Invalid mount point" : "Ongeldig aankoppelpunt", + "Objectstore forbidden" : "Objectopslag verboden", "Invalid storage backend \"%s\"" : "Ongeldig opslagsysteem \"%s\"", + "Unsatisfied backend parameters" : "Onvoldoende backend parameters", + "Unsatisfied authentication mechanism parameters" : "Onvoldoende authenticatiemechanisme parameters", + "Admin-only storage backend \"%s\"" : "Alleen voor beheerders opslagbackend '%s\"", "Personal" : "Persoonlijk", "System" : "Systeem", "Grant access" : "Sta toegang toe", diff --git a/apps/files_external/l10n/nl.json b/apps/files_external/l10n/nl.json index bd3fd953a26..b5c0bf78542 100644 --- a/apps/files_external/l10n/nl.json +++ b/apps/files_external/l10n/nl.json @@ -1,4 +1,7 @@ { "translations": { + "Fetching request tokens failed. Verify that your app key and secret are correct." : "Ophalen aanvraag tokens mislukt. Verifieer dat uw app sleutel en geheime sleutel juist zijn.", + "Fetching access tokens failed. Verify that your app key and secret are correct." : "Ophalen toegangstokens mislukt. Verifieer dat uw app sleutel en geheime sleutel juist zijn.", + "Please provide a valid app key and secret." : "Geef een geldige app sleutel en geheime sleutel op.", "Step 1 failed. Exception: %s" : "Stap 1 is mislukt. Uitzondering: %s", "Step 2 failed. Exception: %s" : "Stap 2 is mislukt. Uitzondering: %s", "External storage" : "Externe opslag", @@ -20,8 +23,13 @@ "SFTP with secret key login" : "SFTP met geheime sleutel inlog", "Public key" : "Publieke sleutel", "Storage with id \"%i\" not found" : "Opslag met id \"%i\" niet gevonden", + "Invalid backend or authentication mechanism class" : "Ongeldige backend of authenticatie mechanisme klasse", "Invalid mount point" : "Ongeldig aankoppelpunt", + "Objectstore forbidden" : "Objectopslag verboden", "Invalid storage backend \"%s\"" : "Ongeldig opslagsysteem \"%s\"", + "Unsatisfied backend parameters" : "Onvoldoende backend parameters", + "Unsatisfied authentication mechanism parameters" : "Onvoldoende authenticatiemechanisme parameters", + "Admin-only storage backend \"%s\"" : "Alleen voor beheerders opslagbackend '%s\"", "Personal" : "Persoonlijk", "System" : "Systeem", "Grant access" : "Sta toegang toe", diff --git a/apps/files_external/service/storagesservice.php b/apps/files_external/service/storagesservice.php index 947e544d88f..703f277d84e 100644 --- a/apps/files_external/service/storagesservice.php +++ b/apps/files_external/service/storagesservice.php @@ -172,7 +172,7 @@ abstract class StoragesService { // the root mount point is in the format "/$user/files/the/mount/point" // we remove the "/$user/files" prefix - $parts = explode('/', trim($rootMountPath, '/'), 3); + $parts = explode('/', ltrim($rootMountPath, '/'), 3); if (count($parts) < 3) { // something went wrong, skip \OCP\Util::writeLog( @@ -183,7 +183,7 @@ abstract class StoragesService { continue; } - $relativeMountPath = $parts[2]; + $relativeMountPath = rtrim($parts[2], '/'); // note: we cannot do this after the loop because the decrypted config // options might be needed for the config hash diff --git a/apps/files_external/tests/service/globalstoragesservicetest.php b/apps/files_external/tests/service/globalstoragesservicetest.php index 2bc480ca312..94c34c221fc 100644 --- a/apps/files_external/tests/service/globalstoragesservicetest.php +++ b/apps/files_external/tests/service/globalstoragesservicetest.php @@ -914,4 +914,32 @@ class GlobalStoragesServiceTest extends StoragesServiceTest { $this->assertEquals('identifier:\Auth\Mechanism', $storage2->getAuthMechanism()->getIdentifier()); } + public function testReadEmptyMountPoint() { + $configFile = $this->dataDir . '/mount.json'; + + $json = [ + 'user' => [ + 'user1' => [ + '/$user/files/' => [ + 'backend' => 'identifier:\OCA\Files_External\Lib\Backend\SFTP', + 'authMechanism' => 'identifier:\Auth\Mechanism', + 'options' => [], + 'mountOptions' => [], + ], + ] + ] + ]; + + file_put_contents($configFile, json_encode($json)); + + $allStorages = $this->service->getAllStorages(); + + $this->assertCount(1, $allStorages); + + $storage1 = $allStorages[1]; + + $this->assertEquals('/', $storage1->getMountPoint()); + } + + } diff --git a/apps/files_external/tests/service/userglobalstoragesservicetest.php b/apps/files_external/tests/service/userglobalstoragesservicetest.php index 49a02453840..b9e2c08c932 100644 --- a/apps/files_external/tests/service/userglobalstoragesservicetest.php +++ b/apps/files_external/tests/service/userglobalstoragesservicetest.php @@ -212,4 +212,9 @@ class UserGlobalStoragesServiceTest extends GlobalStoragesServiceTest { $this->assertTrue(true); } + public function testReadEmptyMountPoint() { + // we don't test this here + $this->assertTrue(true); + } + } |