diff options
-rw-r--r-- | apps/files/l10n/pl.js | 1 | ||||
-rw-r--r-- | apps/files/l10n/pl.json | 1 | ||||
-rw-r--r-- | apps/files/l10n/sq.js | 3 | ||||
-rw-r--r-- | apps/files/l10n/sq.json | 3 | ||||
-rw-r--r-- | apps/files_external/l10n/pl.js | 1 | ||||
-rw-r--r-- | apps/files_external/l10n/pl.json | 1 | ||||
-rw-r--r-- | apps/files_external/l10n/sq.js | 2 | ||||
-rw-r--r-- | apps/files_external/l10n/sq.json | 2 | ||||
-rw-r--r-- | apps/user_ldap/group_ldap.php | 20 | ||||
-rw-r--r-- | apps/user_ldap/l10n/pl.js | 1 | ||||
-rw-r--r-- | apps/user_ldap/l10n/pl.json | 1 | ||||
-rw-r--r-- | core/l10n/sq.js | 1 | ||||
-rw-r--r-- | core/l10n/sq.json | 1 | ||||
-rw-r--r-- | lib/l10n/pl.js | 1 | ||||
-rw-r--r-- | lib/l10n/pl.json | 1 | ||||
-rw-r--r-- | lib/l10n/ro.js | 5 | ||||
-rw-r--r-- | lib/l10n/ro.json | 5 | ||||
-rw-r--r-- | lib/private/Authentication/Token/DefaultToken.php | 9 | ||||
-rw-r--r-- | lib/private/Authentication/Token/DefaultTokenProvider.php | 16 | ||||
-rw-r--r-- | lib/private/Authentication/Token/IProvider.php | 37 | ||||
-rw-r--r-- | lib/private/Authentication/Token/IToken.php | 10 | ||||
-rw-r--r-- | lib/private/Files/Config/MountProviderCollection.php | 36 | ||||
-rw-r--r-- | lib/private/Files/Filesystem.php | 41 | ||||
-rw-r--r-- | lib/private/Files/Mount/LocalHomeMountProvider.php | 46 | ||||
-rw-r--r-- | lib/private/Files/Mount/ObjectHomeMountProvider.php | 73 | ||||
-rw-r--r-- | lib/private/Server.php | 10 | ||||
-rw-r--r-- | lib/private/User/Session.php | 65 | ||||
-rw-r--r-- | lib/public/Encryption/Exceptions/GenericEncryptionException.php (renamed from lib/public/encryption/exceptions/genericencryptionexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Encryption/IEncryptionModule.php (renamed from lib/public/encryption/iencryptionmodule.php) | 0 | ||||
-rw-r--r-- | lib/public/Encryption/IFile.php (renamed from lib/public/encryption/ifile.php) | 0 | ||||
-rw-r--r-- | lib/public/Encryption/IManager.php (renamed from lib/public/encryption/imanager.php) | 0 | ||||
-rw-r--r-- | lib/public/Encryption/Keys/IStorage.php (renamed from lib/public/encryption/keys/istorage.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/AlreadyExistsException.php (renamed from lib/public/files/alreadyexistsexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Cache/ICache.php (renamed from lib/public/files/cache/icache.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Cache/ICacheEntry.php (renamed from lib/public/files/cache/icacheentry.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Cache/IPropagator.php (renamed from lib/public/files/cache/ipropagator.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Cache/IScanner.php (renamed from lib/public/files/cache/iscanner.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Cache/IUpdater.php (renamed from lib/public/files/cache/iupdater.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Cache/IWatcher.php (renamed from lib/public/files/cache/iwatcher.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Config/ICachedMountInfo.php (renamed from lib/public/files/config/icachedmountinfo.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Config/IHomeMountProvider.php | 43 | ||||
-rw-r--r-- | lib/public/Files/Config/IMountProvider.php (renamed from lib/public/files/config/imountprovider.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Config/IMountProviderCollection.php (renamed from lib/public/files/config/imountprovidercollection.php) | 17 | ||||
-rw-r--r-- | lib/public/Files/Config/IUserMountCache.php (renamed from lib/public/files/config/iusermountcache.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/EntityTooLargeException.php (renamed from lib/public/files/entitytoolargeexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/File.php (renamed from lib/public/files/file.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/FileInfo.php (renamed from lib/public/files/fileinfo.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/FileNameTooLongException.php (renamed from lib/public/files/filenametoolongexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Folder.php (renamed from lib/public/files/folder.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/ForbiddenException.php (renamed from lib/public/files/forbiddenexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/IHomeStorage.php (renamed from lib/public/files/ihomestorage.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/IMimeTypeDetector.php (renamed from lib/public/files/imimetypedetector.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/IMimeTypeLoader.php (renamed from lib/public/files/imimetypeloader.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/IRootFolder.php (renamed from lib/public/files/irootfolder.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/InvalidCharacterInPathException.php (renamed from lib/public/files/invalidcharacterinpathexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/InvalidContentException.php (renamed from lib/public/files/invalidcontentexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/InvalidPathException.php (renamed from lib/public/files/invalidpathexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/LockNotAcquiredException.php (renamed from lib/public/files/locknotacquiredexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Mount/IMountManager.php (renamed from lib/public/files/mount/imountmanager.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Mount/IMountPoint.php (renamed from lib/public/files/mount/imountpoint.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Node.php (renamed from lib/public/files/node.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/NotEnoughSpaceException.php (renamed from lib/public/files/notenoughspaceexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/NotFoundException.php (renamed from lib/public/files/notfoundexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/NotPermittedException.php (renamed from lib/public/files/notpermittedexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/ObjectStore/IObjectStore.php (renamed from lib/public/files/objectstore/iobjectstore.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/ReservedWordException.php (renamed from lib/public/files/reservedwordexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Storage.php (renamed from lib/public/files/storage.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Storage/ILockingStorage.php (renamed from lib/public/files/storage/ilockingstorage.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Storage/IStorage.php (renamed from lib/public/files/storage/istorage.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/Storage/IStorageFactory.php (renamed from lib/public/files/storage/istoragefactory.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/StorageAuthException.php (renamed from lib/public/files/storageauthexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/StorageBadConfigException.php (renamed from lib/public/files/storagebadconfigexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/StorageConnectionException.php (renamed from lib/public/files/storageconnectionexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/StorageInvalidException.php (renamed from lib/public/files/storageinvalidexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/StorageNotAvailableException.php (renamed from lib/public/files/storagenotavailableexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Files/StorageTimeoutException.php (renamed from lib/public/files/storagetimeoutexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Http/Client/IClient.php (renamed from lib/public/http/client/iclient.php) | 0 | ||||
-rw-r--r-- | lib/public/Http/Client/IClientService.php (renamed from lib/public/http/client/iclientservice.php) | 0 | ||||
-rw-r--r-- | lib/public/Http/Client/IResponse.php (renamed from lib/public/http/client/iresponse.php) | 0 | ||||
-rw-r--r-- | tests/lib/user/session.php | 22 |
80 files changed, 364 insertions, 111 deletions
diff --git a/apps/files/l10n/pl.js b/apps/files/l10n/pl.js index 6a5b74a253f..01259a538ab 100644 --- a/apps/files/l10n/pl.js +++ b/apps/files/l10n/pl.js @@ -48,6 +48,7 @@ OC.L10N.register( "Could not move \"{file}\"" : "Nie można było przenieść \"{file}\"", "Could not create file \"{file}\"" : "Nie można było utworzyć pliku \"{file}\"", "Could not create file \"{file}\" because it already exists" : "Nie można było utworzyć pliku \"{file}\", ponieważ ten plik już istnieje.", + "Could not create folder \"{dir}\"" : "Nie można utworzyć folderu „{dir}”", "Could not create folder \"{dir}\" because it already exists" : "Nie można utworzyć folderu „{dir}”, ponieważ już istnieje.", "Error deleting file \"{fileName}\"." : "Błąd podczas usuwania pliku „{fileName}”.", "No entries in this folder match '{filter}'" : "Brak wyników pasujących do '{filter}'", diff --git a/apps/files/l10n/pl.json b/apps/files/l10n/pl.json index e67527bc634..fd4d5116953 100644 --- a/apps/files/l10n/pl.json +++ b/apps/files/l10n/pl.json @@ -46,6 +46,7 @@ "Could not move \"{file}\"" : "Nie można było przenieść \"{file}\"", "Could not create file \"{file}\"" : "Nie można było utworzyć pliku \"{file}\"", "Could not create file \"{file}\" because it already exists" : "Nie można było utworzyć pliku \"{file}\", ponieważ ten plik już istnieje.", + "Could not create folder \"{dir}\"" : "Nie można utworzyć folderu „{dir}”", "Could not create folder \"{dir}\" because it already exists" : "Nie można utworzyć folderu „{dir}”, ponieważ już istnieje.", "Error deleting file \"{fileName}\"." : "Błąd podczas usuwania pliku „{fileName}”.", "No entries in this folder match '{filter}'" : "Brak wyników pasujących do '{filter}'", diff --git a/apps/files/l10n/sq.js b/apps/files/l10n/sq.js index 6ec154a9ac3..c1485c154d7 100644 --- a/apps/files/l10n/sq.js +++ b/apps/files/l10n/sq.js @@ -32,8 +32,11 @@ OC.L10N.register( "Could not get result from server." : "S’mori dot përfundime nga shërbyesi.", "Uploading..." : "Po ngarkohet...", "..." : "...", + "{hours}:{minutes}:{seconds} hour{plural_s} left" : "{orë}:{minuta}:{sekonda} orë{shumë_s} majtas", "{hours}:{minutes}h" : "{hours}:{minutes}h", + "{minutes}:{seconds} minute{plural_s} left" : "{minuta}:{sekonda} minuta{shumë_s} majtas", "{minutes}:{seconds}m" : "{minutes}:{seconds}m", + "{seconds} second{plural_s} left" : "{sekonda} sekonda{shumë_s} majtas", "{seconds}s" : "{seconds}s", "Any moment now..." : "Në çdo çast tani…", "Soon..." : "Së shpejti…", diff --git a/apps/files/l10n/sq.json b/apps/files/l10n/sq.json index 5520c286f19..9b40e9f7c9d 100644 --- a/apps/files/l10n/sq.json +++ b/apps/files/l10n/sq.json @@ -30,8 +30,11 @@ "Could not get result from server." : "S’mori dot përfundime nga shërbyesi.", "Uploading..." : "Po ngarkohet...", "..." : "...", + "{hours}:{minutes}:{seconds} hour{plural_s} left" : "{orë}:{minuta}:{sekonda} orë{shumë_s} majtas", "{hours}:{minutes}h" : "{hours}:{minutes}h", + "{minutes}:{seconds} minute{plural_s} left" : "{minuta}:{sekonda} minuta{shumë_s} majtas", "{minutes}:{seconds}m" : "{minutes}:{seconds}m", + "{seconds} second{plural_s} left" : "{sekonda} sekonda{shumë_s} majtas", "{seconds}s" : "{seconds}s", "Any moment now..." : "Në çdo çast tani…", "Soon..." : "Së shpejti…", diff --git a/apps/files_external/l10n/pl.js b/apps/files_external/l10n/pl.js index 2034b73bd8a..7bb11f8b3d8 100644 --- a/apps/files_external/l10n/pl.js +++ b/apps/files_external/l10n/pl.js @@ -1,6 +1,7 @@ OC.L10N.register( "files_external", { + "Fetching access tokens failed. Verify that your app key and secret are correct." : "Otrzymano błędne żądanie tokenów. Sprawdź, czy klucz aplikacji oraz klucz poufny są poprawne.", "Step 1 failed. Exception: %s" : "Krok 1 błędny. Błąd: %s", "Step 2 failed. Exception: %s" : "Krok 2 błędny. Błąd: %s", "External storage" : "Zewnętrzne zasoby dyskowe", diff --git a/apps/files_external/l10n/pl.json b/apps/files_external/l10n/pl.json index 0d1a97abfcb..5089d91398b 100644 --- a/apps/files_external/l10n/pl.json +++ b/apps/files_external/l10n/pl.json @@ -1,4 +1,5 @@ { "translations": { + "Fetching access tokens failed. Verify that your app key and secret are correct." : "Otrzymano błędne żądanie tokenów. Sprawdź, czy klucz aplikacji oraz klucz poufny są poprawne.", "Step 1 failed. Exception: %s" : "Krok 1 błędny. Błąd: %s", "Step 2 failed. Exception: %s" : "Krok 2 błędny. Błąd: %s", "External storage" : "Zewnętrzne zasoby dyskowe", diff --git a/apps/files_external/l10n/sq.js b/apps/files_external/l10n/sq.js index 9b23453e3e4..c73e2c5244a 100644 --- a/apps/files_external/l10n/sq.js +++ b/apps/files_external/l10n/sq.js @@ -38,6 +38,7 @@ OC.L10N.register( "Couldn't get the list of external mount points: {type}" : "S’u mor dot lista e pikave të jashtme të montimit: {type}", "There was an error with message: " : "Pati një gabim me këtë mesazh:", "External mount error" : "Gabim i jashtëm montimi", + "external-storage" : "ruajtje-jashtme", "Couldn't get the list of Windows network drive mount points: empty response from the server" : "S’u mor dot lista e pikave të montimit Windows network drive: përgjigje e zbrazët nga shërbyesi", "Some of the configured external mount points are not connected. Please click on the red row(s) for more information" : "Disa nga pikat e jashtme të formësuara të montimit s’janë të lidhura. Ju lutemi, klikoni në shigjetën(at) e kuqe për më tepër të dhëna", "Please enter the credentials for the {mount} mount" : "Ju lutemi, jepni kredencialet për pikën e montimit {mount}", @@ -59,6 +60,7 @@ OC.L10N.register( "Client secret" : "E fshehtë klienti", "OpenStack" : "OpenStack", "Tenant name" : "Emër qiraxhiu", + "Identity endpoint URL" : "Identifiko pikëmbarimin URL", "Rackspace" : "Rackspace", "API key" : "Kyç API", "Username and password" : "Emër përdoruesi dhe fjalëkalim", diff --git a/apps/files_external/l10n/sq.json b/apps/files_external/l10n/sq.json index f0e420e1ab9..78b2a7d7ef3 100644 --- a/apps/files_external/l10n/sq.json +++ b/apps/files_external/l10n/sq.json @@ -36,6 +36,7 @@ "Couldn't get the list of external mount points: {type}" : "S’u mor dot lista e pikave të jashtme të montimit: {type}", "There was an error with message: " : "Pati një gabim me këtë mesazh:", "External mount error" : "Gabim i jashtëm montimi", + "external-storage" : "ruajtje-jashtme", "Couldn't get the list of Windows network drive mount points: empty response from the server" : "S’u mor dot lista e pikave të montimit Windows network drive: përgjigje e zbrazët nga shërbyesi", "Some of the configured external mount points are not connected. Please click on the red row(s) for more information" : "Disa nga pikat e jashtme të formësuara të montimit s’janë të lidhura. Ju lutemi, klikoni në shigjetën(at) e kuqe për më tepër të dhëna", "Please enter the credentials for the {mount} mount" : "Ju lutemi, jepni kredencialet për pikën e montimit {mount}", @@ -57,6 +58,7 @@ "Client secret" : "E fshehtë klienti", "OpenStack" : "OpenStack", "Tenant name" : "Emër qiraxhiu", + "Identity endpoint URL" : "Identifiko pikëmbarimin URL", "Rackspace" : "Rackspace", "API key" : "Kyç API", "Username and password" : "Emër përdoruesi dhe fjalëkalim", diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php index ff8197fb43a..617bdc3e6ed 100644 --- a/apps/user_ldap/group_ldap.php +++ b/apps/user_ldap/group_ldap.php @@ -469,16 +469,17 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { // apply filter via ldap search to see if this user is in this // dynamic group $userMatch = $this->access->readAttribute( - $uid, + $userDN, $this->access->connection->ldapUserDisplayName, $memberUrlFilter ); if ($userMatch !== false) { // match found so this user is in this group - $pos = strpos($dynamicGroup['dn'][0], ','); - if ($pos !== false) { - $membershipGroup = substr($dynamicGroup['dn'][0],3,$pos-3); - $groups[] = $membershipGroup; + $groupName = $this->access->dn2groupname($dynamicGroup['dn'][0]); + if(is_string($groupName)) { + // be sure to never return false if the dn could not be + // resolved to a name, for whatever reason. + $groups[] = $groupName; } } } else { @@ -530,11 +531,12 @@ class GROUP_LDAP extends BackendUtility implements \OCP\GroupInterface { } if(isset($this->cachedGroupsByMember[$uid])) { - $groups = $this->cachedGroupsByMember[$uid]; + $groups[] = $this->cachedGroupsByMember[$uid]; } else { - $groups = array_values($this->getGroupsByMember($uid)); - $groups = $this->access->ownCloudGroupNames($groups); - $this->cachedGroupsByMember[$uid] = $groups; + $groupsByMember = array_values($this->getGroupsByMember($uid)); + $groupsByMember = $this->access->ownCloudGroupNames($groupsByMember); + $this->cachedGroupsByMember[$uid] = $groupsByMember; + $groups = array_merge($groups, $groupsByMember); } if($primaryGroup !== false) { diff --git a/apps/user_ldap/l10n/pl.js b/apps/user_ldap/l10n/pl.js index 7a22b20bb17..de8f1f49ad3 100644 --- a/apps/user_ldap/l10n/pl.js +++ b/apps/user_ldap/l10n/pl.js @@ -44,6 +44,7 @@ OC.L10N.register( "Test Configuration" : "Konfiguracja testowa", "Help" : "Pomoc", "Groups meeting these criteria are available in %s:" : "Przyłączenie do grupy z tymi ustawieniami dostępne jest w %s:", + "Only from these groups:" : "Tylko z tych grup:", "Search groups" : "Przeszukaj grupy", "Available groups" : "Dostępne grupy", "Selected groups" : "Wybrane grupy", diff --git a/apps/user_ldap/l10n/pl.json b/apps/user_ldap/l10n/pl.json index f051f4d4805..5a853c3abed 100644 --- a/apps/user_ldap/l10n/pl.json +++ b/apps/user_ldap/l10n/pl.json @@ -42,6 +42,7 @@ "Test Configuration" : "Konfiguracja testowa", "Help" : "Pomoc", "Groups meeting these criteria are available in %s:" : "Przyłączenie do grupy z tymi ustawieniami dostępne jest w %s:", + "Only from these groups:" : "Tylko z tych grup:", "Search groups" : "Przeszukaj grupy", "Available groups" : "Dostępne grupy", "Selected groups" : "Wybrane grupy", diff --git a/core/l10n/sq.js b/core/l10n/sq.js index 98a40335447..32f8fe8a89f 100644 --- a/core/l10n/sq.js +++ b/core/l10n/sq.js @@ -212,6 +212,7 @@ OC.L10N.register( "sunny" : "me diell", "Hello {name}, the weather is {weather}" : "Tungjatjeta {name}, koha është {weather}", "Hello {name}" : "Tungjatjeta {name}", + "new" : "re", "_download %n file_::_download %n files_" : ["shkarko %n kartelë","shkarko %n kartela"], "The upgrade is in progress, leaving this page might interrupt the process in some environments." : "Përmirësimi po kryhet, braktisja e kësaj faqeje mund ta ndërpresë procesin në disa mjedise.", "Updating to {version}" : "Po përditësohet me {version}", diff --git a/core/l10n/sq.json b/core/l10n/sq.json index 67b2343caa5..f6d3012ae62 100644 --- a/core/l10n/sq.json +++ b/core/l10n/sq.json @@ -210,6 +210,7 @@ "sunny" : "me diell", "Hello {name}, the weather is {weather}" : "Tungjatjeta {name}, koha është {weather}", "Hello {name}" : "Tungjatjeta {name}", + "new" : "re", "_download %n file_::_download %n files_" : ["shkarko %n kartelë","shkarko %n kartela"], "The upgrade is in progress, leaving this page might interrupt the process in some environments." : "Përmirësimi po kryhet, braktisja e kësaj faqeje mund ta ndërpresë procesin në disa mjedise.", "Updating to {version}" : "Po përditësohet me {version}", diff --git a/lib/l10n/pl.js b/lib/l10n/pl.js index 29e8907f6d4..3124a335261 100644 --- a/lib/l10n/pl.js +++ b/lib/l10n/pl.js @@ -88,6 +88,7 @@ OC.L10N.register( "A valid username must be provided" : "Należy podać prawidłową nazwę użytkownika", "A valid password must be provided" : "Należy podać prawidłowe hasło", "The username is already being used" : "Ta nazwa użytkownika jest już używana", + "User disabled" : "Użytkownik zablokowany", "Help" : "Pomoc", "Personal" : "Osobiste", "Users" : "Użytkownicy", diff --git a/lib/l10n/pl.json b/lib/l10n/pl.json index 984cae2f1cd..bbb4cc7b5ea 100644 --- a/lib/l10n/pl.json +++ b/lib/l10n/pl.json @@ -86,6 +86,7 @@ "A valid username must be provided" : "Należy podać prawidłową nazwę użytkownika", "A valid password must be provided" : "Należy podać prawidłowe hasło", "The username is already being used" : "Ta nazwa użytkownika jest już używana", + "User disabled" : "Użytkownik zablokowany", "Help" : "Pomoc", "Personal" : "Osobiste", "Users" : "Użytkownicy", diff --git a/lib/l10n/ro.js b/lib/l10n/ro.js index aecd4475d52..e8f3ab7c5bb 100644 --- a/lib/l10n/ro.js +++ b/lib/l10n/ro.js @@ -14,18 +14,23 @@ OC.L10N.register( "The library %s is not available." : "Biblioteca %s nu este disponibilă.", "Following platforms are supported: %s" : "Sunt suportate următoarele platforme: %s", "ownCloud %s or higher is required." : "ownCloud %s sau mai mare este necesar.", + "ownCloud %s or lower is required." : "Versiunea ownCloud %s sau mai joasă este necesară.", "Unknown filetype" : "Tip fișier necunoscut", "Invalid image" : "Imagine invalidă", "today" : "astăzi", "yesterday" : "ieri", + "_%n day ago_::_%n days ago_" : ["Acum o zi","Acum %n zile","Acum %n zile"], "last month" : "ultima lună", "_%n month ago_::_%n months ago_" : ["%n lună în urmă","%n luni în urmă","%n luni în urmă"], "last year" : "ultimul an", "_%n year ago_::_%n years ago_" : ["%n an în urmă","%n ani în urmâ","%n ani în urmâ"], "seconds ago" : "secunde în urmă", + "Module with id: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Modulul cu id-ul %s nu există. Activează-l în setările tale de aplicație sau contactează-ți administratorul.", "Empty filename is not allowed" : "Nu este permis fișier fără nume", + "Dot files are not allowed" : "Fișierele care încep cu caracterul punct nu sunt permise", "File name contains at least one invalid character" : "Numele fișierului conține măcar un caracter invalid", "File name is too long" : "Numele fișierului este prea lung", + "App directory already exists" : "Directorul de aplicație există deja", "%s enter the database name." : "%s introduceți numele bazei de date", "Oracle connection could not be established" : "Conexiunea Oracle nu a putut fi stabilită", "DB Error: \"%s\"" : "Eroare Bază de Date: \"%s\"", diff --git a/lib/l10n/ro.json b/lib/l10n/ro.json index e7feb458ef3..ea93ecbd9b0 100644 --- a/lib/l10n/ro.json +++ b/lib/l10n/ro.json @@ -12,18 +12,23 @@ "The library %s is not available." : "Biblioteca %s nu este disponibilă.", "Following platforms are supported: %s" : "Sunt suportate următoarele platforme: %s", "ownCloud %s or higher is required." : "ownCloud %s sau mai mare este necesar.", + "ownCloud %s or lower is required." : "Versiunea ownCloud %s sau mai joasă este necesară.", "Unknown filetype" : "Tip fișier necunoscut", "Invalid image" : "Imagine invalidă", "today" : "astăzi", "yesterday" : "ieri", + "_%n day ago_::_%n days ago_" : ["Acum o zi","Acum %n zile","Acum %n zile"], "last month" : "ultima lună", "_%n month ago_::_%n months ago_" : ["%n lună în urmă","%n luni în urmă","%n luni în urmă"], "last year" : "ultimul an", "_%n year ago_::_%n years ago_" : ["%n an în urmă","%n ani în urmâ","%n ani în urmâ"], "seconds ago" : "secunde în urmă", + "Module with id: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Modulul cu id-ul %s nu există. Activează-l în setările tale de aplicație sau contactează-ți administratorul.", "Empty filename is not allowed" : "Nu este permis fișier fără nume", + "Dot files are not allowed" : "Fișierele care încep cu caracterul punct nu sunt permise", "File name contains at least one invalid character" : "Numele fișierului conține măcar un caracter invalid", "File name is too long" : "Numele fișierului este prea lung", + "App directory already exists" : "Directorul de aplicație există deja", "%s enter the database name." : "%s introduceți numele bazei de date", "Oracle connection could not be established" : "Conexiunea Oracle nu a putut fi stabilită", "DB Error: \"%s\"" : "Eroare Bază de Date: \"%s\"", diff --git a/lib/private/Authentication/Token/DefaultToken.php b/lib/private/Authentication/Token/DefaultToken.php index 25caf675a43..08451a46151 100644 --- a/lib/private/Authentication/Token/DefaultToken.php +++ b/lib/private/Authentication/Token/DefaultToken.php @@ -77,5 +77,14 @@ class DefaultToken extends Entity implements IToken { public function getUID() { return $this->uid; } + + /** + * Get the (encrypted) login password + * + * @return string + */ + public function getPassword() { + return parent::getPassword(); + } } diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php index deca5b409e8..a335b79e332 100644 --- a/lib/private/Authentication/Token/DefaultTokenProvider.php +++ b/lib/private/Authentication/Token/DefaultTokenProvider.php @@ -103,25 +103,27 @@ class DefaultTokenProvider implements IProvider { } /** - * @param string $token + * Get a token by token id + * + * @param string $tokenId * @throws InvalidTokenException * @return DefaultToken */ - public function getToken($token) { + public function getToken($tokenId) { try { - return $this->mapper->getToken($this->hashToken($token)); + return $this->mapper->getToken($this->hashToken($tokenId)); } catch (DoesNotExistException $ex) { throw new InvalidTokenException(); } } /** - * @param DefaultToken $savedToken - * @param string $token session token + * @param IToken $savedToken + * @param string $tokenId session token * @return string */ - public function getPassword(DefaultToken $savedToken, $token) { - return $this->decryptPassword($savedToken->getPassword(), $token); + public function getPassword(IToken $savedToken, $tokenId) { + return $this->decryptPassword($savedToken->getPassword(), $tokenId); } /** diff --git a/lib/private/Authentication/Token/IProvider.php b/lib/private/Authentication/Token/IProvider.php index f8a3262ca8b..1fd3a70fbbf 100644 --- a/lib/private/Authentication/Token/IProvider.php +++ b/lib/private/Authentication/Token/IProvider.php @@ -27,6 +27,27 @@ use OC\Authentication\Exceptions\InvalidTokenException; interface IProvider { /** + * Create and persist a new token + * + * @param string $token + * @param string $uid + * @param string $password + * @param string $name + * @param int $type token type + * @return DefaultToken + */ + public function generateToken($token, $uid, $password, $name, $type = IToken::TEMPORARY_TOKEN); + + /** + * Get a token by token id + * + * @param string $tokenId + * @throws InvalidTokenException + * @return IToken + */ + public function getToken($tokenId) ; + + /** * @param string $token * @throws InvalidTokenException * @return IToken @@ -34,9 +55,25 @@ interface IProvider { public function validateToken($token); /** + * Invalidate (delete) the given session token + * + * @param string $token + */ + public function invalidateToken($token); + + /** * Update token activity timestamp * * @param IToken $token */ public function updateToken(IToken $token); + + /** + * Get the (unencrypted) password of the given token + * + * @param IToken $token + * @param string $tokenId + * @return string + */ + public function getPassword(IToken $token, $tokenId); } diff --git a/lib/private/Authentication/Token/IToken.php b/lib/private/Authentication/Token/IToken.php index 9b2bd18f83b..2a01ea75ea9 100644 --- a/lib/private/Authentication/Token/IToken.php +++ b/lib/private/Authentication/Token/IToken.php @@ -22,9 +22,6 @@ namespace OC\Authentication\Token; -/** - * @since 9.1.0 - */ interface IToken { const TEMPORARY_TOKEN = 0; @@ -43,4 +40,11 @@ interface IToken { * @return string */ public function getUID(); + + /** + * Get the (encrypted) login password + * + * @return string + */ + public function getPassword(); } diff --git a/lib/private/Files/Config/MountProviderCollection.php b/lib/private/Files/Config/MountProviderCollection.php index 499fa576fbc..60c90d7a019 100644 --- a/lib/private/Files/Config/MountProviderCollection.php +++ b/lib/private/Files/Config/MountProviderCollection.php @@ -24,6 +24,7 @@ namespace OC\Files\Config; use OC\Hooks\Emitter; use OC\Hooks\EmitterTrait; +use OCP\Files\Config\IHomeMountProvider; use OCP\Files\Config\IMountProviderCollection; use OCP\Files\Config\IMountProvider; use OCP\Files\Config\IUserMountCache; @@ -35,6 +36,11 @@ class MountProviderCollection implements IMountProviderCollection, Emitter { use EmitterTrait; /** + * @var \OCP\Files\Config\IHomeMountProvider[] + */ + private $homeProviders = []; + + /** * @var \OCP\Files\Config\IMountProvider[] */ private $providers = array(); @@ -78,6 +84,25 @@ class MountProviderCollection implements IMountProviderCollection, Emitter { } /** + * Get the configured home mount for this user + * + * @param \OCP\IUser $user + * @return \OCP\Files\Mount\IMountPoint + * @since 9.1.0 + */ + public function getHomeMountForUser(IUser $user) { + /** @var \OCP\Files\Config\IHomeMountProvider[] $providers */ + $providers = array_reverse($this->homeProviders); // call the latest registered provider first to give apps an opportunity to overwrite builtin + foreach ($providers as $homeProvider) { + if ($mount = $homeProvider->getHomeMountForUser($user, $this->loader)) { + $mount->setMountPoint('/' . $user->getUID()); //make sure the mountpoint is what we expect + return $mount; + } + } + throw new \Exception('No home storage configured for user ' . $user); + } + + /** * Add a provider for mount points * * @param \OCP\Files\Config\IMountProvider $provider @@ -88,6 +113,17 @@ class MountProviderCollection implements IMountProviderCollection, Emitter { } /** + * Add a provider for home mount points + * + * @param \OCP\Files\Config\IHomeMountProvider $provider + * @since 9.1.0 + */ + public function registerHomeProvider(IHomeMountProvider $provider) { + $this->homeProviders[] = $provider; + $this->emit('\OC\Files\Config', 'registerHomeMountProvider', [$provider]); + } + + /** * Cache mounts for user * * @param IUser $user diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php index 99c123ad1a1..70236773448 100644 --- a/lib/private/Files/Filesystem.php +++ b/lib/private/Files/Filesystem.php @@ -397,7 +397,6 @@ class Filesystem { if (isset(self::$usersSetup[$user])) { return; } - $root = \OC_User::getHome($user); $userManager = \OC::$server->getUserManager(); $userObject = $userManager->get($user); @@ -409,50 +408,26 @@ class Filesystem { self::$usersSetup[$user] = true; - $homeStorage = \OC::$server->getConfig()->getSystemValue('objectstore'); - if (!empty($homeStorage)) { - // sanity checks - if (empty($homeStorage['class'])) { - \OCP\Util::writeLog('files', 'No class given for objectstore', \OCP\Util::ERROR); - } - if (!isset($homeStorage['arguments'])) { - $homeStorage['arguments'] = array(); - } - // instantiate object store implementation - $homeStorage['arguments']['objectstore'] = new $homeStorage['class']($homeStorage['arguments']); - // mount with home object store implementation - $homeStorage['class'] = '\OC\Files\ObjectStore\HomeObjectStoreStorage'; - } else { - $homeStorage = array( - //default home storage configuration: - 'class' => '\OC\Files\Storage\Home', - 'arguments' => array() - ); - } - $homeStorage['arguments']['user'] = $userObject; + /** @var \OC\Files\Config\MountProviderCollection $mountConfigManager */ + $mountConfigManager = \OC::$server->getMountProviderCollection(); - // check for legacy home id (<= 5.0.12) - if (\OC\Files\Cache\Storage::exists('local::' . $root . '/')) { - $homeStorage['arguments']['legacy'] = true; - } + // home mounts are handled seperate since we need to ensure this is mounted before we call the other mount providers + $homeMount = $mountConfigManager->getHomeMountForUser($userObject); - $mount = new MountPoint($homeStorage['class'], '/' . $user, $homeStorage['arguments'], self::getLoader()); - self::getMountManager()->addMount($mount); + self::getMountManager()->addMount($homeMount); - $home = \OC\Files\Filesystem::getStorage($user); + \OC\Files\Filesystem::getStorage($user); // Chance to mount for other storages - /** @var \OC\Files\Config\MountProviderCollection $mountConfigManager */ - $mountConfigManager = \OC::$server->getMountProviderCollection(); if ($userObject) { $mounts = $mountConfigManager->getMountsForUser($userObject); array_walk($mounts, array(self::$mounts, 'addMount')); - $mounts[] = $mount; + $mounts[] = $homeMount; $mountConfigManager->registerMounts($userObject, $mounts); } self::listenForNewMountProviders($mountConfigManager, $userManager); - \OC_Hook::emit('OC_Filesystem', 'post_initMountPoints', array('user' => $user, 'user_dir' => $root)); + \OC_Hook::emit('OC_Filesystem', 'post_initMountPoints', array('user' => $user)); } /** diff --git a/lib/private/Files/Mount/LocalHomeMountProvider.php b/lib/private/Files/Mount/LocalHomeMountProvider.php new file mode 100644 index 00000000000..102df59a536 --- /dev/null +++ b/lib/private/Files/Mount/LocalHomeMountProvider.php @@ -0,0 +1,46 @@ +<?php +/** + * @author Robin Appelman <icewind@owncloud.com> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Files\Mount; + +use OCP\Files\Config\IHomeMountProvider; +use OCP\Files\Storage\IStorageFactory; +use OCP\IUser; + +/** + * Mount provider for regular posix home folders + */ +class LocalHomeMountProvider implements IHomeMountProvider { + /** + * Get the cache mount for a user + * + * @param IUser $user + * @param IStorageFactory $loader + * @return \OCP\Files\Mount\IMountPoint[] + */ + public function getHomeMountForUser(IUser $user, IStorageFactory $loader) { + $arguments = ['user' => $user]; + if (\OC\Files\Cache\Storage::exists('local::' . $user->getHome() . '/')) { + $arguments['legacy'] = true; + } + return new MountPoint('\OC\Files\Storage\Home', '/' . $user->getUID(), $arguments, $loader); + } +} diff --git a/lib/private/Files/Mount/ObjectHomeMountProvider.php b/lib/private/Files/Mount/ObjectHomeMountProvider.php new file mode 100644 index 00000000000..c910cf6bd45 --- /dev/null +++ b/lib/private/Files/Mount/ObjectHomeMountProvider.php @@ -0,0 +1,73 @@ +<?php +/** + * @author Robin Appelman <icewind@owncloud.com> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Files\Mount; + +use OCP\Files\Config\IHomeMountProvider; +use OCP\Files\Storage\IStorageFactory; +use OCP\IConfig; +use OCP\IUser; + +/** + * Mount provider for object store home storages + */ +class ObjectHomeMountProvider implements IHomeMountProvider { + /** + * @var IConfig + */ + private $config; + + /** + * ObjectStoreHomeMountProvider constructor. + * + * @param IConfig $config + */ + public function __construct(IConfig $config) { + $this->config = $config; + } + + /** + * Get the cache mount for a user + * + * @param IUser $user + * @param IStorageFactory $loader + * @return \OCP\Files\Mount\IMountPoint[] + */ + public function getHomeMountForUser(IUser $user, IStorageFactory $loader) { + $config = $this->config->getSystemValue('objectstore'); + if (!is_array($config)) { + return null; //fall back to local home provider + } + + // sanity checks + if (empty($config['class'])) { + \OCP\Util::writeLog('files', 'No class given for objectstore', \OCP\Util::ERROR); + } + if (!isset($config['arguments'])) { + $config['arguments'] = []; + } + $config['arguments']['user'] = $user; + // instantiate object store implementation + $config['arguments']['objectstore'] = new $config['class']($config['arguments']); + + return new MountPoint('\OC\Files\ObjectStore\HomeObjectStoreStorage', '/' . $user->getUID(), $config['arguments'], $loader); + } +} diff --git a/lib/private/Server.php b/lib/private/Server.php index a6f1425d545..a4294ee2c88 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -49,6 +49,8 @@ use OC\Diagnostics\QueryLogger; use OC\Files\Config\UserMountCache; use OC\Files\Config\UserMountCacheListener; use OC\Files\Mount\CacheMountProvider; +use OC\Files\Mount\LocalHomeMountProvider; +use OC\Files\Mount\ObjectHomeMountProvider; use OC\Files\Node\HookConnector; use OC\Files\Node\LazyRoot; use OC\Files\Node\Root; @@ -229,15 +231,11 @@ class Server extends ServerContainer implements IServerContainer { // might however be called when ownCloud is not yet setup. if (\OC::$server->getSystemConfig()->getValue('installed', false)) { $defaultTokenProvider = $c->query('OC\Authentication\Token\DefaultTokenProvider'); - $tokenProviders = [ - $defaultTokenProvider, - ]; } else { $defaultTokenProvider = null; - $tokenProviders = []; } - $userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $tokenProviders); + $userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider); $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); }); @@ -479,6 +477,8 @@ class Server extends ServerContainer implements IServerContainer { $config = $c->getConfig(); $manager->registerProvider(new CacheMountProvider($config)); + $manager->registerHomeProvider(new LocalHomeMountProvider()); + $manager->registerHomeProvider(new ObjectHomeMountProvider($config)); return $manager; }); diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index c9f42d7e414..3f074fa8adf 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -35,7 +35,6 @@ namespace OC\User; use OC; use OC\Authentication\Exceptions\InvalidTokenException; -use OC\Authentication\Token\DefaultTokenProvider; use OC\Authentication\Token\IProvider; use OC\Authentication\Token\IToken; use OC\Hooks\Emitter; @@ -69,35 +68,20 @@ use OCP\Session\Exceptions\SessionNotAvailableException; * @package OC\User */ class Session implements IUserSession, Emitter { - /* - * @var Manager $manager - */ - + + /** @var Manager $manager */ private $manager; - /* - * @var ISession $session - */ + /** @var ISession $session */ private $session; - /* - * @var ITimeFactory - */ + /** @var ITimeFactory */ private $timeFacory; - /** - * @var DefaultTokenProvider - */ + /** @var IProvider */ private $tokenProvider; - /** - * @var IProvider[] - */ - private $tokenProviders; - - /** - * @var User $activeUser - */ + /** @var User $activeUser */ protected $activeUser; /** @@ -105,20 +89,18 @@ class Session implements IUserSession, Emitter { * @param ISession $session * @param ITimeFactory $timeFacory * @param IProvider $tokenProvider - * @param IProvider[] $tokenProviders */ - public function __construct(IUserManager $manager, ISession $session, ITimeFactory $timeFacory, $tokenProvider, array $tokenProviders = []) { + public function __construct(IUserManager $manager, ISession $session, ITimeFactory $timeFacory, $tokenProvider) { $this->manager = $manager; $this->session = $session; $this->timeFacory = $timeFacory; $this->tokenProvider = $tokenProvider; - $this->tokenProviders = $tokenProviders; } /** - * @param DefaultTokenProvider $provider + * @param IProvider $provider */ - public function setTokenProvider(DefaultTokenProvider $provider) { + public function setTokenProvider(IProvider $provider) { $this->tokenProvider = $provider; } @@ -246,7 +228,7 @@ class Session implements IUserSession, Emitter { } // Session is valid, so the token can be refreshed - $this->updateToken($this->tokenProvider, $token); + $this->updateToken($token); } /** @@ -418,34 +400,31 @@ class Session implements IUserSession, Emitter { * @return boolean */ private function validateToken($token) { - foreach ($this->tokenProviders as $provider) { - try { - $token = $provider->validateToken($token); - if (!is_null($token)) { - $result = $this->loginWithToken($token->getUID()); - if ($result) { - // Login success - $this->updateToken($provider, $token); - return true; - } + try { + $token = $this->tokenProvider->validateToken($token); + if (!is_null($token)) { + $result = $this->loginWithToken($token->getUID()); + if ($result) { + // Login success + $this->updateToken($token); + return true; } - } catch (InvalidTokenException $ex) { - } + } catch (InvalidTokenException $ex) { + } return false; } /** - * @param IProvider $provider * @param IToken $token */ - private function updateToken(IProvider $provider, IToken $token) { + private function updateToken(IToken $token) { // To save unnecessary DB queries, this is only done once a minute $lastTokenUpdate = $this->session->get('last_token_update') ? : 0; $now = $this->timeFacory->getTime(); if ($lastTokenUpdate < ($now - 60)) { - $provider->updateToken($token); + $this->tokenProvider->updateToken($token); $this->session->set('last_token_update', $now); } } diff --git a/lib/public/encryption/exceptions/genericencryptionexception.php b/lib/public/Encryption/Exceptions/GenericEncryptionException.php index c1331689c7f..c1331689c7f 100644 --- a/lib/public/encryption/exceptions/genericencryptionexception.php +++ b/lib/public/Encryption/Exceptions/GenericEncryptionException.php diff --git a/lib/public/encryption/iencryptionmodule.php b/lib/public/Encryption/IEncryptionModule.php index 8d20a1ab57d..8d20a1ab57d 100644 --- a/lib/public/encryption/iencryptionmodule.php +++ b/lib/public/Encryption/IEncryptionModule.php diff --git a/lib/public/encryption/ifile.php b/lib/public/Encryption/IFile.php index 9933cb0164e..9933cb0164e 100644 --- a/lib/public/encryption/ifile.php +++ b/lib/public/Encryption/IFile.php diff --git a/lib/public/encryption/imanager.php b/lib/public/Encryption/IManager.php index b07de0cbb4f..b07de0cbb4f 100644 --- a/lib/public/encryption/imanager.php +++ b/lib/public/Encryption/IManager.php diff --git a/lib/public/encryption/keys/istorage.php b/lib/public/Encryption/Keys/IStorage.php index cfac4ba58f7..cfac4ba58f7 100644 --- a/lib/public/encryption/keys/istorage.php +++ b/lib/public/Encryption/Keys/IStorage.php diff --git a/lib/public/files/alreadyexistsexception.php b/lib/public/Files/AlreadyExistsException.php index 243129cb1db..243129cb1db 100644 --- a/lib/public/files/alreadyexistsexception.php +++ b/lib/public/Files/AlreadyExistsException.php diff --git a/lib/public/files/cache/icache.php b/lib/public/Files/Cache/ICache.php index 4ef88f6480f..4ef88f6480f 100644 --- a/lib/public/files/cache/icache.php +++ b/lib/public/Files/Cache/ICache.php diff --git a/lib/public/files/cache/icacheentry.php b/lib/public/Files/Cache/ICacheEntry.php index 00c8e201b9a..00c8e201b9a 100644 --- a/lib/public/files/cache/icacheentry.php +++ b/lib/public/Files/Cache/ICacheEntry.php diff --git a/lib/public/files/cache/ipropagator.php b/lib/public/Files/Cache/IPropagator.php index 5494ec9a54e..5494ec9a54e 100644 --- a/lib/public/files/cache/ipropagator.php +++ b/lib/public/Files/Cache/IPropagator.php diff --git a/lib/public/files/cache/iscanner.php b/lib/public/Files/Cache/IScanner.php index ce1f408028c..ce1f408028c 100644 --- a/lib/public/files/cache/iscanner.php +++ b/lib/public/Files/Cache/IScanner.php diff --git a/lib/public/files/cache/iupdater.php b/lib/public/Files/Cache/IUpdater.php index 5267aa6f023..5267aa6f023 100644 --- a/lib/public/files/cache/iupdater.php +++ b/lib/public/Files/Cache/IUpdater.php diff --git a/lib/public/files/cache/iwatcher.php b/lib/public/Files/Cache/IWatcher.php index c33129a2473..c33129a2473 100644 --- a/lib/public/files/cache/iwatcher.php +++ b/lib/public/Files/Cache/IWatcher.php diff --git a/lib/public/files/config/icachedmountinfo.php b/lib/public/Files/Config/ICachedMountInfo.php index e09c1a7f014..e09c1a7f014 100644 --- a/lib/public/files/config/icachedmountinfo.php +++ b/lib/public/Files/Config/ICachedMountInfo.php diff --git a/lib/public/Files/Config/IHomeMountProvider.php b/lib/public/Files/Config/IHomeMountProvider.php new file mode 100644 index 00000000000..bedcd3cfacc --- /dev/null +++ b/lib/public/Files/Config/IHomeMountProvider.php @@ -0,0 +1,43 @@ +<?php +/** + * @author Morris Jobke <hey@morrisjobke.de> + * @author Robin Appelman <icewind@owncloud.com> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OCP\Files\Config; + +use OCP\Files\Storage\IStorageFactory; +use OCP\IUser; + +/** + * Provides + * + * @since 9.1.0 + */ +interface IHomeMountProvider { + /** + * Get all mountpoints applicable for the user + * + * @param \OCP\IUser $user + * @param \OCP\Files\Storage\IStorageFactory $loader + * @return \OCP\Files\Mount\IMountPoint|null + * @since 9.1.0 + */ + public function getHomeMountForUser(IUser $user, IStorageFactory $loader); +} diff --git a/lib/public/files/config/imountprovider.php b/lib/public/Files/Config/IMountProvider.php index d1498fd5f61..d1498fd5f61 100644 --- a/lib/public/files/config/imountprovider.php +++ b/lib/public/Files/Config/IMountProvider.php diff --git a/lib/public/files/config/imountprovidercollection.php b/lib/public/Files/Config/IMountProviderCollection.php index 39da61812a9..29208cb6f53 100644 --- a/lib/public/files/config/imountprovidercollection.php +++ b/lib/public/Files/Config/IMountProviderCollection.php @@ -40,6 +40,15 @@ interface IMountProviderCollection { public function getMountsForUser(IUser $user); /** + * Get the configured home mount for this user + * + * @param \OCP\IUser $user + * @return \OCP\Files\Mount\IMountPoint + * @since 9.1.0 + */ + public function getHomeMountForUser(IUser $user); + + /** * Add a provider for mount points * * @param \OCP\Files\Config\IMountProvider $provider @@ -48,6 +57,14 @@ interface IMountProviderCollection { public function registerProvider(IMountProvider $provider); /** + * Add a provider for home mount points + * + * @param \OCP\Files\Config\IHomeMountProvider $provider + * @since 9.1.0 + */ + public function registerHomeProvider(IHomeMountProvider $provider); + + /** * Get the mount cache which can be used to search for mounts without setting up the filesystem * * @return IUserMountCache diff --git a/lib/public/files/config/iusermountcache.php b/lib/public/Files/Config/IUserMountCache.php index 2f2c11da1a0..2f2c11da1a0 100644 --- a/lib/public/files/config/iusermountcache.php +++ b/lib/public/Files/Config/IUserMountCache.php diff --git a/lib/public/files/entitytoolargeexception.php b/lib/public/Files/EntityTooLargeException.php index 8dabc08f8bb..8dabc08f8bb 100644 --- a/lib/public/files/entitytoolargeexception.php +++ b/lib/public/Files/EntityTooLargeException.php diff --git a/lib/public/files/file.php b/lib/public/Files/File.php index 553dd48c24f..553dd48c24f 100644 --- a/lib/public/files/file.php +++ b/lib/public/Files/File.php diff --git a/lib/public/files/fileinfo.php b/lib/public/Files/FileInfo.php index a9f05863e78..a9f05863e78 100644 --- a/lib/public/files/fileinfo.php +++ b/lib/public/Files/FileInfo.php diff --git a/lib/public/files/filenametoolongexception.php b/lib/public/Files/FileNameTooLongException.php index 68fba4ad516..68fba4ad516 100644 --- a/lib/public/files/filenametoolongexception.php +++ b/lib/public/Files/FileNameTooLongException.php diff --git a/lib/public/files/folder.php b/lib/public/Files/Folder.php index 0644ab62034..0644ab62034 100644 --- a/lib/public/files/folder.php +++ b/lib/public/Files/Folder.php diff --git a/lib/public/files/forbiddenexception.php b/lib/public/Files/ForbiddenException.php index 5a4f03d176d..5a4f03d176d 100644 --- a/lib/public/files/forbiddenexception.php +++ b/lib/public/Files/ForbiddenException.php diff --git a/lib/public/files/ihomestorage.php b/lib/public/Files/IHomeStorage.php index 4101545aafe..4101545aafe 100644 --- a/lib/public/files/ihomestorage.php +++ b/lib/public/Files/IHomeStorage.php diff --git a/lib/public/files/imimetypedetector.php b/lib/public/Files/IMimeTypeDetector.php index 7d9cd606e69..7d9cd606e69 100644 --- a/lib/public/files/imimetypedetector.php +++ b/lib/public/Files/IMimeTypeDetector.php diff --git a/lib/public/files/imimetypeloader.php b/lib/public/Files/IMimeTypeLoader.php index 57a6d7ba309..57a6d7ba309 100644 --- a/lib/public/files/imimetypeloader.php +++ b/lib/public/Files/IMimeTypeLoader.php diff --git a/lib/public/files/irootfolder.php b/lib/public/Files/IRootFolder.php index 3b6243f7638..3b6243f7638 100644 --- a/lib/public/files/irootfolder.php +++ b/lib/public/Files/IRootFolder.php diff --git a/lib/public/files/invalidcharacterinpathexception.php b/lib/public/Files/InvalidCharacterInPathException.php index 8e649b5bb62..8e649b5bb62 100644 --- a/lib/public/files/invalidcharacterinpathexception.php +++ b/lib/public/Files/InvalidCharacterInPathException.php diff --git a/lib/public/files/invalidcontentexception.php b/lib/public/Files/InvalidContentException.php index f25b7fef87f..f25b7fef87f 100644 --- a/lib/public/files/invalidcontentexception.php +++ b/lib/public/Files/InvalidContentException.php diff --git a/lib/public/files/invalidpathexception.php b/lib/public/Files/InvalidPathException.php index ee21d7432be..ee21d7432be 100644 --- a/lib/public/files/invalidpathexception.php +++ b/lib/public/Files/InvalidPathException.php diff --git a/lib/public/files/locknotacquiredexception.php b/lib/public/Files/LockNotAcquiredException.php index 247c9f5f5cb..247c9f5f5cb 100644 --- a/lib/public/files/locknotacquiredexception.php +++ b/lib/public/Files/LockNotAcquiredException.php diff --git a/lib/public/files/mount/imountmanager.php b/lib/public/Files/Mount/IMountManager.php index 9e3002a26d1..9e3002a26d1 100644 --- a/lib/public/files/mount/imountmanager.php +++ b/lib/public/Files/Mount/IMountManager.php diff --git a/lib/public/files/mount/imountpoint.php b/lib/public/Files/Mount/IMountPoint.php index bc7bf81709f..bc7bf81709f 100644 --- a/lib/public/files/mount/imountpoint.php +++ b/lib/public/Files/Mount/IMountPoint.php diff --git a/lib/public/files/node.php b/lib/public/Files/Node.php index c69077c7f2a..c69077c7f2a 100644 --- a/lib/public/files/node.php +++ b/lib/public/Files/Node.php diff --git a/lib/public/files/notenoughspaceexception.php b/lib/public/Files/NotEnoughSpaceException.php index 4e67ac26700..4e67ac26700 100644 --- a/lib/public/files/notenoughspaceexception.php +++ b/lib/public/Files/NotEnoughSpaceException.php diff --git a/lib/public/files/notfoundexception.php b/lib/public/Files/NotFoundException.php index 10a3dacda44..10a3dacda44 100644 --- a/lib/public/files/notfoundexception.php +++ b/lib/public/Files/NotFoundException.php diff --git a/lib/public/files/notpermittedexception.php b/lib/public/Files/NotPermittedException.php index 3dcbd9e499b..3dcbd9e499b 100644 --- a/lib/public/files/notpermittedexception.php +++ b/lib/public/Files/NotPermittedException.php diff --git a/lib/public/files/objectstore/iobjectstore.php b/lib/public/Files/ObjectStore/IObjectStore.php index 78be18fb2e9..78be18fb2e9 100644 --- a/lib/public/files/objectstore/iobjectstore.php +++ b/lib/public/Files/ObjectStore/IObjectStore.php diff --git a/lib/public/files/reservedwordexception.php b/lib/public/Files/ReservedWordException.php index 6a560a563fe..6a560a563fe 100644 --- a/lib/public/files/reservedwordexception.php +++ b/lib/public/Files/ReservedWordException.php diff --git a/lib/public/files/storage.php b/lib/public/Files/Storage.php index 2511690b7d3..2511690b7d3 100644 --- a/lib/public/files/storage.php +++ b/lib/public/Files/Storage.php diff --git a/lib/public/files/storage/ilockingstorage.php b/lib/public/Files/Storage/ILockingStorage.php index 7c46391f425..7c46391f425 100644 --- a/lib/public/files/storage/ilockingstorage.php +++ b/lib/public/Files/Storage/ILockingStorage.php diff --git a/lib/public/files/storage/istorage.php b/lib/public/Files/Storage/IStorage.php index ab1915bb93e..ab1915bb93e 100644 --- a/lib/public/files/storage/istorage.php +++ b/lib/public/Files/Storage/IStorage.php diff --git a/lib/public/files/storage/istoragefactory.php b/lib/public/Files/Storage/IStorageFactory.php index 01a05eeff12..01a05eeff12 100644 --- a/lib/public/files/storage/istoragefactory.php +++ b/lib/public/Files/Storage/IStorageFactory.php diff --git a/lib/public/files/storageauthexception.php b/lib/public/Files/StorageAuthException.php index 35a2907b856..35a2907b856 100644 --- a/lib/public/files/storageauthexception.php +++ b/lib/public/Files/StorageAuthException.php diff --git a/lib/public/files/storagebadconfigexception.php b/lib/public/Files/StorageBadConfigException.php index 1c340b18b7c..1c340b18b7c 100644 --- a/lib/public/files/storagebadconfigexception.php +++ b/lib/public/Files/StorageBadConfigException.php diff --git a/lib/public/files/storageconnectionexception.php b/lib/public/Files/StorageConnectionException.php index 8938a60265c..8938a60265c 100644 --- a/lib/public/files/storageconnectionexception.php +++ b/lib/public/Files/StorageConnectionException.php diff --git a/lib/public/files/storageinvalidexception.php b/lib/public/Files/StorageInvalidException.php index a34ee7ae49a..a34ee7ae49a 100644 --- a/lib/public/files/storageinvalidexception.php +++ b/lib/public/Files/StorageInvalidException.php diff --git a/lib/public/files/storagenotavailableexception.php b/lib/public/Files/StorageNotAvailableException.php index 7afb067f298..7afb067f298 100644 --- a/lib/public/files/storagenotavailableexception.php +++ b/lib/public/Files/StorageNotAvailableException.php diff --git a/lib/public/files/storagetimeoutexception.php b/lib/public/Files/StorageTimeoutException.php index ed4d98af89b..ed4d98af89b 100644 --- a/lib/public/files/storagetimeoutexception.php +++ b/lib/public/Files/StorageTimeoutException.php diff --git a/lib/public/http/client/iclient.php b/lib/public/Http/Client/IClient.php index 85db2a9ad02..85db2a9ad02 100644 --- a/lib/public/http/client/iclient.php +++ b/lib/public/Http/Client/IClient.php diff --git a/lib/public/http/client/iclientservice.php b/lib/public/Http/Client/IClientService.php index 907aa42fd3b..907aa42fd3b 100644 --- a/lib/public/http/client/iclientservice.php +++ b/lib/public/Http/Client/IClientService.php diff --git a/lib/public/http/client/iresponse.php b/lib/public/Http/Client/IResponse.php index 09189d77014..09189d77014 100644 --- a/lib/public/http/client/iresponse.php +++ b/lib/public/Http/Client/IResponse.php diff --git a/tests/lib/user/session.php b/tests/lib/user/session.php index c6ddeb416fb..710d5ae20b3 100644 --- a/tests/lib/user/session.php +++ b/tests/lib/user/session.php @@ -88,7 +88,7 @@ class Session extends \Test\TestCase { ->with($expectedUser->getUID()) ->will($this->returnValue($expectedUser)); - $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider, [$this->defaultProvider]); + $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider); $user = $userSession->getUser(); $this->assertSame($expectedUser, $user); } @@ -111,7 +111,7 @@ class Session extends \Test\TestCase { ->getMock(); $userSession = $this->getMockBuilder('\OC\User\Session') - ->setConstructorArgs([$manager, $session, $this->timeFactory, $this->defaultProvider, [$this->defaultProvider]]) + ->setConstructorArgs([$manager, $session, $this->timeFactory, $this->defaultProvider]) ->setMethods([ 'getUser' ]) @@ -138,7 +138,7 @@ class Session extends \Test\TestCase { ->method('getUID') ->will($this->returnValue('foo')); - $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider, [$this->defaultProvider]); + $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider); $userSession->setUser($user); } @@ -190,7 +190,7 @@ class Session extends \Test\TestCase { ->will($this->returnValue($user)); $userSession = $this->getMockBuilder('\OC\User\Session') - ->setConstructorArgs([$manager, $session, $this->timeFactory, $this->defaultProvider, [$this->defaultProvider]]) + ->setConstructorArgs([$manager, $session, $this->timeFactory, $this->defaultProvider]) ->setMethods([ 'prepareUserLogin' ]) @@ -237,7 +237,7 @@ class Session extends \Test\TestCase { ->with('foo', 'bar') ->will($this->returnValue($user)); - $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider, [$this->defaultProvider]); + $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider); $userSession->login('foo', 'bar'); } @@ -273,7 +273,7 @@ class Session extends \Test\TestCase { ->with('foo', 'bar') ->will($this->returnValue(false)); - $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider, [$this->defaultProvider]); + $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider); $userSession->login('foo', 'bar'); } @@ -293,7 +293,7 @@ class Session extends \Test\TestCase { ->with('foo', 'bar') ->will($this->returnValue(false)); - $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider, [$this->defaultProvider]); + $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider); $userSession->login('foo', 'bar'); } @@ -348,7 +348,7 @@ class Session extends \Test\TestCase { //override, otherwise tests will fail because of setcookie() array('setMagicInCookie'), //there are passed as parameters to the constructor - array($manager, $session, $this->timeFactory, $this->defaultProvider, [$this->defaultProvider])); + array($manager, $session, $this->timeFactory, $this->defaultProvider)); $granted = $userSession->loginWithCookie('foo', $token); @@ -393,7 +393,7 @@ class Session extends \Test\TestCase { $token = 'goodToken'; \OC::$server->getConfig()->setUserValue('foo', 'login_token', $token, time()); - $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider, [$this->defaultProvider]); + $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider); $granted = $userSession->loginWithCookie('foo', 'badToken'); $this->assertSame($granted, false); @@ -436,7 +436,7 @@ class Session extends \Test\TestCase { $token = 'goodToken'; \OC::$server->getConfig()->setUserValue('foo', 'login_token', $token, time()); - $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider, [$this->defaultProvider]); + $userSession = new \OC\User\Session($manager, $session, $this->timeFactory, $this->defaultProvider); $granted = $userSession->loginWithCookie('foo', $token); $this->assertSame($granted, false); @@ -461,7 +461,7 @@ class Session extends \Test\TestCase { $session = new Memory(''); $session->set('user_id', 'foo'); $userSession = $this->getMockBuilder('\OC\User\Session') - ->setConstructorArgs([$manager, $session, $this->timeFactory, $this->defaultProvider, [$this->defaultProvider]]) + ->setConstructorArgs([$manager, $session, $this->timeFactory, $this->defaultProvider]) ->setMethods([ 'validateSession' ]) |