diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/autoloader.php | 10 | ||||
-rw-r--r-- | lib/base.php | 7 | ||||
-rw-r--r-- | lib/l10n/es.js | 2 | ||||
-rw-r--r-- | lib/l10n/es.json | 2 | ||||
-rw-r--r-- | lib/l10n/pl.js | 1 | ||||
-rw-r--r-- | lib/l10n/pl.json | 1 | ||||
-rw-r--r-- | lib/l10n/ro.js | 13 | ||||
-rw-r--r-- | lib/l10n/ro.json | 13 | ||||
-rw-r--r-- | lib/l10n/ru.js | 7 | ||||
-rw-r--r-- | lib/l10n/ru.json | 7 | ||||
-rw-r--r-- | lib/l10n/zh_CN.js | 1 | ||||
-rw-r--r-- | lib/l10n/zh_CN.json | 1 | ||||
-rw-r--r-- | lib/private/AppFramework/DependencyInjection/DIContainer.php | 4 | ||||
-rw-r--r-- | lib/private/Authentication/Token/DefaultToken.php | 9 | ||||
-rw-r--r-- | lib/private/Authentication/Token/DefaultTokenMapper.php | 28 | ||||
-rw-r--r-- | lib/private/Authentication/Token/DefaultTokenProvider.php | 30 | ||||
-rw-r--r-- | lib/private/Authentication/Token/IProvider.php | 49 | ||||
-rw-r--r-- | lib/private/Authentication/Token/IToken.php | 10 | ||||
-rw-r--r-- | lib/private/Cache/File.php | 4 | ||||
-rw-r--r-- | lib/private/DB/Connection.php | 6 | ||||
-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/Group/Backend.php | 149 | ||||
-rw-r--r-- | lib/private/Group/Database.php | 338 | ||||
-rw-r--r-- | lib/private/Group/Group.php | 12 | ||||
-rw-r--r-- | lib/private/Group/Manager.php | 2 | ||||
-rw-r--r-- | lib/private/OCS/Provider.php | 96 | ||||
-rw-r--r-- | lib/private/Route/CachingRouter.php | 5 | ||||
-rw-r--r-- | lib/private/Server.php | 10 | ||||
-rw-r--r-- | lib/private/User/Session.php | 69 | ||||
-rw-r--r-- | lib/private/legacy/group.php | 2 | ||||
-rw-r--r-- | lib/private/legacy/group/backend.php | 114 | ||||
-rw-r--r-- | lib/private/legacy/group/database.php | 316 | ||||
-rw-r--r-- | lib/public/API.php (renamed from lib/public/api.php) | 0 | ||||
-rw-r--r-- | lib/public/App.php (renamed from lib/public/app.php) | 0 | ||||
-rw-r--r-- | lib/public/Authentication/IApacheBackend.php (renamed from lib/public/authentication/iapachebackend.php) | 0 | ||||
-rw-r--r-- | lib/public/AutoloadNotAllowedException.php (renamed from lib/public/autoloadnotallowedexception.php) | 0 | ||||
-rw-r--r-- | lib/public/BackgroundJob.php (renamed from lib/public/backgroundjob.php) | 0 | ||||
-rw-r--r-- | lib/public/Config.php (renamed from lib/public/config.php) | 0 | ||||
-rw-r--r-- | lib/public/Console/ConsoleEvent.php (renamed from lib/public/console/consoleevent.php) | 0 | ||||
-rw-r--r-- | lib/public/Constants.php (renamed from lib/public/constants.php) | 0 | ||||
-rw-r--r-- | lib/public/Contacts.php (renamed from lib/public/contacts.php) | 0 | ||||
-rw-r--r-- | lib/public/Contacts/IManager.php (renamed from lib/public/contacts/imanager.php) | 0 | ||||
-rw-r--r-- | lib/public/DB.php (renamed from lib/public/db.php) | 0 | ||||
-rw-r--r-- | lib/public/DB/QueryBuilder/ICompositeExpression.php (renamed from lib/public/db/querybuilder/icompositeexpression.php) | 4 | ||||
-rw-r--r-- | lib/public/DB/QueryBuilder/IExpressionBuilder.php (renamed from lib/public/db/querybuilder/iexpressionbuilder.php) | 0 | ||||
-rw-r--r-- | lib/public/DB/QueryBuilder/ILiteral.php (renamed from lib/public/db/querybuilder/iliteral.php) | 0 | ||||
-rw-r--r-- | lib/public/DB/QueryBuilder/IParameter.php (renamed from lib/public/db/querybuilder/iparameter.php) | 0 | ||||
-rw-r--r-- | lib/public/DB/QueryBuilder/IQueryBuilder.php (renamed from lib/public/db/querybuilder/iquerybuilder.php) | 0 | ||||
-rw-r--r-- | lib/public/DB/QueryBuilder/IQueryFunction.php (renamed from lib/public/db/querybuilder/iqueryfunction.php) | 0 | ||||
-rw-r--r-- | lib/public/Defaults.php (renamed from lib/public/defaults.php) | 0 | ||||
-rw-r--r-- | lib/public/Diagnostics/IEvent.php (renamed from lib/public/diagnostics/ievent.php) | 0 | ||||
-rw-r--r-- | lib/public/Diagnostics/IEventLogger.php (renamed from lib/public/diagnostics/ieventlogger.php) | 0 | ||||
-rw-r--r-- | lib/public/Diagnostics/IQuery.php (renamed from lib/public/diagnostics/iquery.php) | 0 | ||||
-rw-r--r-- | lib/public/Diagnostics/IQueryLogger.php (renamed from lib/public/diagnostics/iquerylogger.php) | 0 | ||||
-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.php (renamed from lib/public/files.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/GroupInterface.php (renamed from lib/public/groupinterface.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-- | lib/public/IAddressBook.php (renamed from lib/public/iaddressbook.php) | 0 | ||||
-rw-r--r-- | lib/public/IAppConfig.php (renamed from lib/public/iappconfig.php) | 0 | ||||
-rw-r--r-- | lib/public/IAvatar.php (renamed from lib/public/iavatar.php) | 0 | ||||
-rw-r--r-- | lib/public/IAvatarManager.php (renamed from lib/public/iavatarmanager.php) | 0 | ||||
-rw-r--r-- | lib/public/ICache.php (renamed from lib/public/icache.php) | 1 | ||||
-rw-r--r-- | lib/public/ICacheFactory.php (renamed from lib/public/icachefactory.php) | 0 | ||||
-rw-r--r-- | lib/public/ICertificate.php (renamed from lib/public/icertificate.php) | 0 | ||||
-rw-r--r-- | lib/public/ICertificateManager.php (renamed from lib/public/icertificatemanager.php) | 0 | ||||
-rw-r--r-- | lib/public/IConfig.php (renamed from lib/public/iconfig.php) | 0 | ||||
-rw-r--r-- | lib/public/IContainer.php (renamed from lib/public/icontainer.php) | 0 | ||||
-rw-r--r-- | lib/public/IDBConnection.php (renamed from lib/public/idbconnection.php) | 0 | ||||
-rw-r--r-- | lib/public/IDateTimeFormatter.php (renamed from lib/public/idatetimeformatter.php) | 0 | ||||
-rw-r--r-- | lib/public/IDateTimeZone.php (renamed from lib/public/idatetimezone.php) | 0 | ||||
-rw-r--r-- | lib/public/IDb.php (renamed from lib/public/idb.php) | 0 | ||||
-rw-r--r-- | lib/public/IEventSource.php (renamed from lib/public/ieventsource.php) | 0 | ||||
-rw-r--r-- | lib/public/IGroup.php (renamed from lib/public/igroup.php) | 0 | ||||
-rw-r--r-- | lib/public/IGroupManager.php (renamed from lib/public/igroupmanager.php) | 0 | ||||
-rw-r--r-- | lib/public/IHelper.php (renamed from lib/public/ihelper.php) | 0 | ||||
-rw-r--r-- | lib/public/IImage.php (renamed from lib/public/iimage.php) | 0 | ||||
-rw-r--r-- | lib/public/IL10N.php (renamed from lib/public/il10n.php) | 0 | ||||
-rw-r--r-- | lib/public/ILogger.php (renamed from lib/public/ilogger.php) | 0 | ||||
-rw-r--r-- | lib/public/IMemcache.php (renamed from lib/public/imemcache.php) | 0 | ||||
-rw-r--r-- | lib/public/IMemcacheTTL.php (renamed from lib/public/imemcachettl.php) | 0 | ||||
-rw-r--r-- | lib/public/INavigationManager.php (renamed from lib/public/inavigationmanager.php) | 0 | ||||
-rw-r--r-- | lib/public/IPreview.php (renamed from lib/public/ipreview.php) | 0 | ||||
-rw-r--r-- | lib/public/IRequest.php (renamed from lib/public/irequest.php) | 0 | ||||
-rw-r--r-- | lib/public/ISearch.php (renamed from lib/public/isearch.php) | 0 | ||||
-rw-r--r-- | lib/public/ISession.php (renamed from lib/public/isession.php) | 0 | ||||
-rw-r--r-- | lib/public/ITagManager.php (renamed from lib/public/itagmanager.php) | 0 | ||||
-rw-r--r-- | lib/public/ITags.php (renamed from lib/public/itags.php) | 0 | ||||
-rw-r--r-- | lib/public/ITempManager.php (renamed from lib/public/itempmanager.php) | 0 | ||||
-rw-r--r-- | lib/public/IURLGenerator.php (renamed from lib/public/iurlgenerator.php) | 0 | ||||
-rw-r--r-- | lib/public/IUser.php (renamed from lib/public/iuser.php) | 0 | ||||
-rw-r--r-- | lib/public/IUserBackend.php (renamed from lib/public/iuserbackend.php) | 0 | ||||
-rw-r--r-- | lib/public/IUserManager.php (renamed from lib/public/iusermanager.php) | 0 | ||||
-rw-r--r-- | lib/public/IUserSession.php (renamed from lib/public/iusersession.php) | 0 | ||||
-rw-r--r-- | lib/public/Image.php (renamed from lib/public/image.php) | 0 | ||||
-rw-r--r-- | lib/public/JSON.php (renamed from lib/public/json.php) | 0 | ||||
-rw-r--r-- | lib/public/L10N/IFactory.php (renamed from lib/public/l10n/ifactory.php) | 0 | ||||
-rw-r--r-- | lib/public/Lock/ILockingProvider.php (renamed from lib/public/lock/ilockingprovider.php) | 0 | ||||
-rw-r--r-- | lib/public/Lock/LockedException.php (renamed from lib/public/lock/lockedexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Mail/IMailer.php (renamed from lib/public/mail/imailer.php) | 0 | ||||
-rw-r--r-- | lib/public/Migration/IOutput.php (renamed from lib/public/migration/ioutput.php) | 0 | ||||
-rw-r--r-- | lib/public/Migration/IRepairStep.php (renamed from lib/public/migration/irepairstep.php) | 0 | ||||
-rw-r--r-- | lib/public/Notification/IAction.php (renamed from lib/public/notification/iaction.php) | 0 | ||||
-rw-r--r-- | lib/public/Notification/IApp.php (renamed from lib/public/notification/iapp.php) | 0 | ||||
-rw-r--r-- | lib/public/Notification/IManager.php (renamed from lib/public/notification/imanager.php) | 0 | ||||
-rw-r--r-- | lib/public/Notification/INotification.php (renamed from lib/public/notification/inotification.php) | 0 | ||||
-rw-r--r-- | lib/public/Notification/INotifier.php (renamed from lib/public/notification/inotifier.php) | 0 | ||||
-rw-r--r-- | lib/public/PreConditionNotMetException.php (renamed from lib/public/preconditionnotmetexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Preview/IProvider.php (renamed from lib/public/preview/iprovider.php) | 0 | ||||
-rw-r--r-- | lib/public/Response.php (renamed from lib/public/response.php) | 0 | ||||
-rw-r--r-- | lib/public/Route/IRoute.php (renamed from lib/public/route/iroute.php) | 0 | ||||
-rw-r--r-- | lib/public/Route/IRouter.php (renamed from lib/public/route/irouter.php) | 0 | ||||
-rw-r--r-- | lib/public/SabrePluginEvent.php (renamed from lib/public/sabrepluginevent.php) | 0 | ||||
-rw-r--r-- | lib/public/SabrePluginException.php (renamed from lib/public/sabrepluginexception.php) | 0 | ||||
-rw-r--r-- | lib/public/Security/IContentSecurityPolicyManager.php (renamed from lib/public/security/icontentsecuritypolicymanager.php) | 0 | ||||
-rw-r--r-- | lib/public/Security/ICredentialsManager.php (renamed from lib/public/security/icredentialsmanager.php) | 0 | ||||
-rw-r--r-- | lib/public/Security/ICrypto.php (renamed from lib/public/security/icrypto.php) | 0 | ||||
-rw-r--r-- | lib/public/Security/IHasher.php (renamed from lib/public/security/ihasher.php) | 0 | ||||
-rw-r--r-- | lib/public/Security/ISecureRandom.php (renamed from lib/public/security/isecurerandom.php) | 0 | ||||
-rw-r--r-- | lib/public/Security/StringUtils.php (renamed from lib/public/security/stringutils.php) | 0 | ||||
-rw-r--r-- | lib/public/Share.php (renamed from lib/public/share.php) | 0 | ||||
-rw-r--r-- | lib/public/Share_Backend.php (renamed from lib/public/share_backend.php) | 0 | ||||
-rw-r--r-- | lib/public/Share_Backend_Collection.php (renamed from lib/public/share_backend_collection.php) | 0 | ||||
-rw-r--r-- | lib/public/Share_Backend_File_Dependent.php (renamed from lib/public/share_backend_file_dependent.php) | 0 | ||||
-rw-r--r-- | lib/public/SystemTag/ISystemTag.php (renamed from lib/public/systemtag/isystemtag.php) | 0 | ||||
-rw-r--r-- | lib/public/SystemTag/ISystemTagManager.php (renamed from lib/public/systemtag/isystemtagmanager.php) | 0 | ||||
-rw-r--r-- | lib/public/SystemTag/ISystemTagManagerFactory.php (renamed from lib/public/systemtag/isystemtagmanagerfactory.php) | 0 | ||||
-rw-r--r-- | lib/public/SystemTag/ISystemTagObjectMapper.php (renamed from lib/public/systemtag/isystemtagobjectmapper.php) | 0 | ||||
-rw-r--r-- | lib/public/SystemTag/ManagerEvent.php (renamed from lib/public/systemtag/managerevent.php) | 0 | ||||
-rw-r--r-- | lib/public/SystemTag/MapperEvent.php (renamed from lib/public/systemtag/mapperevent.php) | 0 | ||||
-rw-r--r-- | lib/public/SystemTag/TagAlreadyExistsException.php (renamed from lib/public/systemtag/tagalreadyexistsexception.php) | 0 | ||||
-rw-r--r-- | lib/public/SystemTag/TagNotFoundException.php (renamed from lib/public/systemtag/tagnotfoundexception.php) | 0 | ||||
-rw-r--r-- | lib/public/User.php (renamed from lib/public/user.php) | 0 | ||||
-rw-r--r-- | lib/public/UserInterface.php (renamed from lib/public/userinterface.php) | 0 | ||||
-rw-r--r-- | lib/public/Util.php (renamed from lib/public/util.php) | 0 |
188 files changed, 1038 insertions, 541 deletions
diff --git a/lib/autoloader.php b/lib/autoloader.php index 9cc573c0997..73783603438 100644 --- a/lib/autoloader.php +++ b/lib/autoloader.php @@ -94,7 +94,7 @@ class Autoloader { $paths[] = \OC::$CLASSPATH[$class]; /** * @TODO: Remove this when necessary - * Remove "apps/" from inclusion path for smooth migration to mutli app dir + * Remove "apps/" from inclusion path for smooth migration to multi app dir */ if (strpos(\OC::$CLASSPATH[$class], 'apps/') === 0) { \OCP\Util::writeLog('core', 'include path for class "' . $class . '" starts with "apps/"', \OCP\Util::DEBUG); @@ -113,10 +113,10 @@ class Autoloader { // If not found in the root of the app directory, insert '/lib' after app id and try again. $paths[] = $appPath . '/lib/' . strtolower(str_replace('\\', '/', $rest) . '.php'); } - } elseif (strpos($class, 'Test_') === 0) { - $paths[] = \OC::$SERVERROOT . '/tests/lib/' . strtolower(str_replace('_', '/', substr($class, 5)) . '.php'); - } elseif (strpos($class, 'Test\\') === 0) { - $paths[] = \OC::$SERVERROOT . '/tests/lib/' . strtolower(str_replace('\\', '/', substr($class, 5)) . '.php'); + } elseif ($class === 'Test\\TestCase') { + // This File is considered public API, so we make sure that the class + // can still be loaded, although the PSR-4 paths have not been loaded. + $paths[] = \OC::$SERVERROOT . '/tests/lib/TestCase.php'; } return $paths; } diff --git a/lib/base.php b/lib/base.php index cc0429af110..eddcec97b1f 100644 --- a/lib/base.php +++ b/lib/base.php @@ -53,7 +53,7 @@ * */ -require_once 'public/constants.php'; +require_once 'public/Constants.php'; /** * Class that is a namespace for all global OC variables @@ -620,7 +620,7 @@ class OC { } OC_User::useBackend(new \OC\User\Database()); - OC_Group::useBackend(new OC_Group_Database()); + OC_Group::useBackend(new \OC\Group\Database()); // Subscribe to the hook \OCP\Util::connectHook( @@ -633,6 +633,9 @@ class OC { //setup extra user backends if (!self::checkUpgrade(false)) { OC_User::setupBackends(); + } else { + // Run upgrades in incognito mode + OC_User::setIncognitoMode(true); } self::registerCacheHooks(); diff --git a/lib/l10n/es.js b/lib/l10n/es.js index 9c4d280fbb9..9e108b52ec7 100644 --- a/lib/l10n/es.js +++ b/lib/l10n/es.js @@ -98,7 +98,7 @@ OC.L10N.register( "Sharing backend for %s not found" : "Motor compartido para %s no encontrado", "Sharing failed, because the user %s is the original sharer" : "Se ha fallado al compartir, ya que el usuario %s es el compartidor original", "Sharing %s failed, because the permissions exceed permissions granted to %s" : "Se ha fallado al compartir %s, ya que los permisos superan los permisos otorgados a %s", - "Sharing %s failed, because resharing is not allowed" : "Se ha fallado al compartir %s, ya que volver a compartir no está permitido", + "Sharing %s failed, because resharing is not allowed" : "Fallo al compartir %s, ya que no está permitido volverlo a compartir", "Sharing %s failed, because the sharing backend for %s could not find its source" : "Se ha fallado al compartir %s porque el motor compartido para %s podría no encontrar su origen", "Sharing %s failed, because the file could not be found in the file cache" : "Se ha fallado al compartir %s, ya que el archivo no pudo ser encontrado en el cache de archivo", "Cannot increase permissions of %s" : "No se pueden incrementar los permisos de %s", diff --git a/lib/l10n/es.json b/lib/l10n/es.json index c5a14b77e0f..36f8a63c317 100644 --- a/lib/l10n/es.json +++ b/lib/l10n/es.json @@ -96,7 +96,7 @@ "Sharing backend for %s not found" : "Motor compartido para %s no encontrado", "Sharing failed, because the user %s is the original sharer" : "Se ha fallado al compartir, ya que el usuario %s es el compartidor original", "Sharing %s failed, because the permissions exceed permissions granted to %s" : "Se ha fallado al compartir %s, ya que los permisos superan los permisos otorgados a %s", - "Sharing %s failed, because resharing is not allowed" : "Se ha fallado al compartir %s, ya que volver a compartir no está permitido", + "Sharing %s failed, because resharing is not allowed" : "Fallo al compartir %s, ya que no está permitido volverlo a compartir", "Sharing %s failed, because the sharing backend for %s could not find its source" : "Se ha fallado al compartir %s porque el motor compartido para %s podría no encontrar su origen", "Sharing %s failed, because the file could not be found in the file cache" : "Se ha fallado al compartir %s, ya que el archivo no pudo ser encontrado en el cache de archivo", "Cannot increase permissions of %s" : "No se pueden incrementar los permisos de %s", 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 a26078f965e..e8f3ab7c5bb 100644 --- a/lib/l10n/ro.js +++ b/lib/l10n/ro.js @@ -2,24 +2,35 @@ OC.L10N.register( "lib", { "Cannot write into \"config\" directory!" : "Nu se poate scrie în folderul \"config\"!", - "This can usually be fixed by giving the webserver write access to the config directory" : "Aceasta se poate repara de obicei prin permiterea accesului de scriere la dosarul de configurarea a webserverului", + "This can usually be fixed by giving the webserver write access to the config directory" : "Aceasta se poate repara de obicei prin permiterea accesului de scriere la dosarul de configurare al serverului Web", "See %s" : "Vezi %s", + "This can usually be fixed by %sgiving the webserver write access to the config directory%s." : "Aceasta se poate repara de obicei de %s prin acordarea accesului de scriere către serverul Web pentru directorul de configurare %s. ", + "Sample configuration detected" : "A fost detectată o configurație exemplu", + "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "S-a detectat copierea configurației exemplu. Acest lucru poate duce la oprirea instanței tale și nu este suportat. Te rugăm să citești documentația înainte de a face modificări în fișierul config.php", "PHP %s or higher is required." : "Versiunea PHP %s sau mai mare este necesară.", "PHP with a version lower than %s is required." : "Este necesară o versiune PHP mai mică decât %s", + "Following databases are supported: %s" : "Următoarele baze de date sunt suportate: %s", + "The command line tool %s could not be found" : "Unealta în linie de comandă %s nu a fost găsită", + "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 b659c19d399..ea93ecbd9b0 100644 --- a/lib/l10n/ro.json +++ b/lib/l10n/ro.json @@ -1,23 +1,34 @@ { "translations": { "Cannot write into \"config\" directory!" : "Nu se poate scrie în folderul \"config\"!", - "This can usually be fixed by giving the webserver write access to the config directory" : "Aceasta se poate repara de obicei prin permiterea accesului de scriere la dosarul de configurarea a webserverului", + "This can usually be fixed by giving the webserver write access to the config directory" : "Aceasta se poate repara de obicei prin permiterea accesului de scriere la dosarul de configurare al serverului Web", "See %s" : "Vezi %s", + "This can usually be fixed by %sgiving the webserver write access to the config directory%s." : "Aceasta se poate repara de obicei de %s prin acordarea accesului de scriere către serverul Web pentru directorul de configurare %s. ", + "Sample configuration detected" : "A fost detectată o configurație exemplu", + "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "S-a detectat copierea configurației exemplu. Acest lucru poate duce la oprirea instanței tale și nu este suportat. Te rugăm să citești documentația înainte de a face modificări în fișierul config.php", "PHP %s or higher is required." : "Versiunea PHP %s sau mai mare este necesară.", "PHP with a version lower than %s is required." : "Este necesară o versiune PHP mai mică decât %s", + "Following databases are supported: %s" : "Următoarele baze de date sunt suportate: %s", + "The command line tool %s could not be found" : "Unealta în linie de comandă %s nu a fost găsită", + "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/ru.js b/lib/l10n/ru.js index a7be9b2f4e9..337d3b28641 100644 --- a/lib/l10n/ru.js +++ b/lib/l10n/ru.js @@ -9,6 +9,7 @@ OC.L10N.register( "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Была обнаружена конфигурация из примера. Такая конфигурация не поддерживается и может повредить вашей системе. Прочтите документацию перед внесением изменений в файл config.php", "PHP %s or higher is required." : "Требуется PHP %s или выше", "PHP with a version lower than %s is required." : "Требуется версия PHP ниже %s.", + "%sbit or higher PHP required." : "%sbit или требуется новая версия PHP.", "Following databases are supported: %s" : "Поддерживаются следующие СУБД: %s", "The command line tool %s could not be found" : "Утилита командной строки %s не найдена", "The library %s is not available." : "Библиотека %s недоступна.", @@ -45,6 +46,7 @@ OC.L10N.register( "Archives of type %s are not supported" : "Архивы %s не поддерживаются", "Failed to open archive when installing app" : "Ошибка открытия архива при установке приложения", "App does not provide an info.xml file" : "Приложение не имеет файла info.xml", + "App cannot be installed because appinfo file cannot be read." : "Приложение не может быть установлено, так как файл с информацией о приложении не может быть прочтен.", "Signature could not get checked. Please contact the app developer and check your admin screen." : "Подпись не может быть проверена. Пожалуйста, свяжитесь с разработчиком приложения и проверьте свою страницу администратора.", "App can't be installed because of not allowed code in the App" : "Приложение невозможно установить. В нем содержится запрещенный код.", "App can't be installed because it is not compatible with this version of ownCloud" : "Приложение невозможно установить. Не совместимо с текущей версией ownCloud.", @@ -100,6 +102,8 @@ OC.L10N.register( "Sharing %s failed, because the sharing backend for %s could not find its source" : "Не удалось поделиться %s, бэкенд общего доступа не нашел путь до %s", "Sharing %s failed, because the file could not be found in the file cache" : "Не удалось поделиться %s, элемент не найден в файловом кеше.", "Cannot increase permissions of %s" : "Невозможно увеличить права доступа для %s", + "Files can't be shared with delete permissions" : "Файлы не могут иметь общий доступ с правами на удаление", + "Files can't be shared with create permissions" : "Файлы не могут иметь общий доступ с правами на создание", "Expiration date is in the past" : "Дата окончания срока действия уже прошла", "Cannot set expiration date more than %s days in the future" : "Невозможно установить дату окончания срока действия более %s дней", "Could not find category \"%s\"" : "Категория \"%s\" не найдена", @@ -109,11 +113,14 @@ OC.L10N.register( "Username contains whitespace at the beginning or at the end" : "Имя пользователя содержит пробел в начале или в конце", "A valid password must be provided" : "Укажите правильный пароль", "The username is already being used" : "Имя пользователя уже используется", + "Login canceled by app" : "Вход отменен приложением", + "User disabled" : "Пользователь отключен", "Help" : "Помощь", "Personal" : "Личное", "Users" : "Пользователи", "Admin" : "Администрирование", "Recommended" : "Рекомендовано", + "App \"%s\" cannot be installed because appinfo file cannot be read." : "Приложение \"%s\" не может быть установлено, так как файл с информацией о приложении не может быть прочтен.", "App \"%s\" cannot be installed because it is not compatible with this version of ownCloud." : "Приложение \"%s\" не может быть установлено, так как оно не совместимо с этой версией ownCloud.", "App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "Приложение \"%s\" не может быть установлено, так как следующие зависимости не выполнены: %s", "No app name specified" : "Не указано имя приложения", diff --git a/lib/l10n/ru.json b/lib/l10n/ru.json index 1d5683b3a50..1cf5687aab4 100644 --- a/lib/l10n/ru.json +++ b/lib/l10n/ru.json @@ -7,6 +7,7 @@ "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "Была обнаружена конфигурация из примера. Такая конфигурация не поддерживается и может повредить вашей системе. Прочтите документацию перед внесением изменений в файл config.php", "PHP %s or higher is required." : "Требуется PHP %s или выше", "PHP with a version lower than %s is required." : "Требуется версия PHP ниже %s.", + "%sbit or higher PHP required." : "%sbit или требуется новая версия PHP.", "Following databases are supported: %s" : "Поддерживаются следующие СУБД: %s", "The command line tool %s could not be found" : "Утилита командной строки %s не найдена", "The library %s is not available." : "Библиотека %s недоступна.", @@ -43,6 +44,7 @@ "Archives of type %s are not supported" : "Архивы %s не поддерживаются", "Failed to open archive when installing app" : "Ошибка открытия архива при установке приложения", "App does not provide an info.xml file" : "Приложение не имеет файла info.xml", + "App cannot be installed because appinfo file cannot be read." : "Приложение не может быть установлено, так как файл с информацией о приложении не может быть прочтен.", "Signature could not get checked. Please contact the app developer and check your admin screen." : "Подпись не может быть проверена. Пожалуйста, свяжитесь с разработчиком приложения и проверьте свою страницу администратора.", "App can't be installed because of not allowed code in the App" : "Приложение невозможно установить. В нем содержится запрещенный код.", "App can't be installed because it is not compatible with this version of ownCloud" : "Приложение невозможно установить. Не совместимо с текущей версией ownCloud.", @@ -98,6 +100,8 @@ "Sharing %s failed, because the sharing backend for %s could not find its source" : "Не удалось поделиться %s, бэкенд общего доступа не нашел путь до %s", "Sharing %s failed, because the file could not be found in the file cache" : "Не удалось поделиться %s, элемент не найден в файловом кеше.", "Cannot increase permissions of %s" : "Невозможно увеличить права доступа для %s", + "Files can't be shared with delete permissions" : "Файлы не могут иметь общий доступ с правами на удаление", + "Files can't be shared with create permissions" : "Файлы не могут иметь общий доступ с правами на создание", "Expiration date is in the past" : "Дата окончания срока действия уже прошла", "Cannot set expiration date more than %s days in the future" : "Невозможно установить дату окончания срока действия более %s дней", "Could not find category \"%s\"" : "Категория \"%s\" не найдена", @@ -107,11 +111,14 @@ "Username contains whitespace at the beginning or at the end" : "Имя пользователя содержит пробел в начале или в конце", "A valid password must be provided" : "Укажите правильный пароль", "The username is already being used" : "Имя пользователя уже используется", + "Login canceled by app" : "Вход отменен приложением", + "User disabled" : "Пользователь отключен", "Help" : "Помощь", "Personal" : "Личное", "Users" : "Пользователи", "Admin" : "Администрирование", "Recommended" : "Рекомендовано", + "App \"%s\" cannot be installed because appinfo file cannot be read." : "Приложение \"%s\" не может быть установлено, так как файл с информацией о приложении не может быть прочтен.", "App \"%s\" cannot be installed because it is not compatible with this version of ownCloud." : "Приложение \"%s\" не может быть установлено, так как оно не совместимо с этой версией ownCloud.", "App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "Приложение \"%s\" не может быть установлено, так как следующие зависимости не выполнены: %s", "No app name specified" : "Не указано имя приложения", diff --git a/lib/l10n/zh_CN.js b/lib/l10n/zh_CN.js index 49e3b3a2f41..8951d48b5c3 100644 --- a/lib/l10n/zh_CN.js +++ b/lib/l10n/zh_CN.js @@ -80,6 +80,7 @@ OC.L10N.register( "Recommended" : "推荐", "No app name specified" : "没有指定的 App 名称", "web services under your control" : "您控制的网络服务", + "File is currently busy, please try again later" : "文件当前正忙,请稍后再试", "Can't read file" : "无法读取文件", "Application is not enabled" : "应用程序未启用", "Authentication error" : "认证出错", diff --git a/lib/l10n/zh_CN.json b/lib/l10n/zh_CN.json index 970e883acfe..c502c21ad8a 100644 --- a/lib/l10n/zh_CN.json +++ b/lib/l10n/zh_CN.json @@ -78,6 +78,7 @@ "Recommended" : "推荐", "No app name specified" : "没有指定的 App 名称", "web services under your control" : "您控制的网络服务", + "File is currently busy, please try again later" : "文件当前正忙,请稍后再试", "Can't read file" : "无法读取文件", "Application is not enabled" : "应用程序未启用", "Authentication error" : "认证出错", diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index 2951ee536d2..439b631b50f 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -148,6 +148,10 @@ class DIContainer extends SimpleContainer implements IAppContainer { return $this->getServer()->getRootFolder(); }); + $this->registerService('OCP\\Http\\Client\\IClientService', function($c) { + return $this->getServer()->getHTTPClientService(); + }); + $this->registerService('OCP\\IGroupManager', function($c) { return $this->getServer()->getGroupManager(); }); 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/DefaultTokenMapper.php b/lib/private/Authentication/Token/DefaultTokenMapper.php index 18adbe48d78..9f173571270 100644 --- a/lib/private/Authentication/Token/DefaultTokenMapper.php +++ b/lib/private/Authentication/Token/DefaultTokenMapper.php @@ -26,6 +26,7 @@ use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\Mapper; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; +use OCP\IUser; class DefaultTokenMapper extends Mapper { @@ -83,4 +84,31 @@ class DefaultTokenMapper extends Mapper { return DefaultToken::fromRow($data); } + /** + * Get all token of a user + * + * The provider may limit the number of result rows in case of an abuse + * where a high number of (session) tokens is generated + * + * @param IUser $user + * @return DefaultToken[] + */ + public function getTokenByUser(IUser $user) { + /* @var $qb IQueryBuilder */ + $qb = $this->db->getQueryBuilder(); + $qb->select('id', 'uid', 'password', 'name', 'type', 'token', 'last_activity') + ->from('authtoken') + ->where($qb->expr()->eq('uid', $qb->createNamedParameter($user->getUID()))) + ->setMaxResults(1000); + $result = $qb->execute(); + $data = $result->fetchAll(); + $result->closeCursor(); + + $entities = array_map(function ($row) { + return DefaultToken::fromRow($row); + }, $data); + + return $entities; + } + } diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php index deca5b409e8..6c69d852d7b 100644 --- a/lib/private/Authentication/Token/DefaultTokenProvider.php +++ b/lib/private/Authentication/Token/DefaultTokenProvider.php @@ -28,6 +28,7 @@ use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Utility\ITimeFactory; use OCP\IConfig; use OCP\ILogger; +use OCP\IUser; use OCP\Security\ICrypto; class DefaultTokenProvider implements IProvider { @@ -103,25 +104,40 @@ class DefaultTokenProvider implements IProvider { } /** - * @param string $token + * Get all token of a user + * + * The provider may limit the number of result rows in case of an abuse + * where a high number of (session) tokens is generated + * + * @param IUser $user + * @return IToken[] + */ + public function getTokenByUser(IUser $user) { + return $this->mapper->getTokenByUser($user); + } + + /** + * 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..a5c5faa5639 100644 --- a/lib/private/Authentication/Token/IProvider.php +++ b/lib/private/Authentication/Token/IProvider.php @@ -23,10 +23,32 @@ namespace OC\Authentication\Token; use OC\Authentication\Exceptions\InvalidTokenException; +use OCP\IUser; 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 +56,36 @@ 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 all token of a user + * + * The provider may limit the number of result rows in case of an abuse + * where a high number of (session) tokens is generated + * + * @param IUser $user + * @return IToken[] + */ + public function getTokenByUser(IUser $user); + + /** + * 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/Cache/File.php b/lib/private/Cache/File.php index 989e05275b7..38f88959bd7 100644 --- a/lib/private/Cache/File.php +++ b/lib/private/Cache/File.php @@ -172,7 +172,9 @@ class File implements ICache { public function gc() { $storage = $this->getStorage(); if ($storage and $storage->is_dir('/')) { - $now = time(); + // extra hour safety, in case of stray part chunks that take longer to write, + // because touch() is only called after the chunk was finished + $now = time() - 3600; $dh = $storage->opendir('/'); if (!is_resource($dh)) { return null; diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 7904fab0726..7cdc13a7c6d 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -33,7 +33,7 @@ use Doctrine\Common\EventManager; use OC\DB\QueryBuilder\QueryBuilder; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; -use OCP\PreconditionNotMetException; +use OCP\PreConditionNotMetException; class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { /** @@ -262,7 +262,7 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { * @param array $updatePreconditionValues ensure values match preconditions (column name => value) * @return int number of new rows * @throws \Doctrine\DBAL\DBALException - * @throws PreconditionNotMetException + * @throws PreConditionNotMetException */ public function setValues($table, array $keys, array $values, array $updatePreconditionValues = []) { try { @@ -294,7 +294,7 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { $affected = $updateQb->execute(); if ($affected === 0 && !empty($updatePreconditionValues)) { - throw new PreconditionNotMetException(); + throw new PreConditionNotMetException(); } return 0; 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/Group/Backend.php b/lib/private/Group/Backend.php new file mode 100644 index 00000000000..6dd5bdc3507 --- /dev/null +++ b/lib/private/Group/Backend.php @@ -0,0 +1,149 @@ +<?php +/** + * @author Arthur Schiwon <blizzz@owncloud.com> + * @author Bart Visscher <bartv@thisnet.nl> + * @author Jakob Sack <mail@jakobsack.de> + * @author Joas Schilling <nickvergessen@owncloud.com> + * @author Jörn Friedrich Dreyer <jfd@butonic.de> + * @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 Robin McCorkell <robin@mccorkell.me.uk> + * @author Thomas Müller <thomas.mueller@tmit.eu> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ + +namespace OC\Group; + +/** + * Abstract base class for user management + */ +abstract class Backend implements \OCP\GroupInterface { + /** + * error code for functions not provided by the group backend + */ + const NOT_IMPLEMENTED = -501; + + /** + * actions that user backends can define + */ + const CREATE_GROUP = 0x00000001; + const DELETE_GROUP = 0x00000010; + const ADD_TO_GROUP = 0x00000100; + const REMOVE_FROM_GOUP = 0x00001000; + //OBSOLETE const GET_DISPLAYNAME = 0x00010000; + const COUNT_USERS = 0x00100000; + + protected $possibleActions = array( + self::CREATE_GROUP => 'createGroup', + self::DELETE_GROUP => 'deleteGroup', + self::ADD_TO_GROUP => 'addToGroup', + self::REMOVE_FROM_GOUP => 'removeFromGroup', + self::COUNT_USERS => 'countUsersInGroup', + ); + + /** + * Get all supported actions + * @return int bitwise-or'ed actions + * + * Returns the supported actions as int to be + * compared with \OC\Group\Backend::CREATE_GROUP etc. + */ + public function getSupportedActions() { + $actions = 0; + foreach($this->possibleActions AS $action => $methodName) { + if(method_exists($this, $methodName)) { + $actions |= $action; + } + } + + return $actions; + } + + /** + * Check if backend implements actions + * @param int $actions bitwise-or'ed actions + * @return bool + * + * Returns the supported actions as int to be + * compared with \OC\Group\Backend::CREATE_GROUP etc. + */ + public function implementsActions($actions) { + return (bool)($this->getSupportedActions() & $actions); + } + + /** + * is user in group? + * @param string $uid uid of the user + * @param string $gid gid of the group + * @return bool + * + * Checks whether the user is member of a group or not. + */ + public function inGroup($uid, $gid) { + return in_array($gid, $this->getUserGroups($uid)); + } + + /** + * Get all groups a user belongs to + * @param string $uid Name of the user + * @return array an array of group names + * + * This function fetches all groups a user belongs to. It does not check + * if the user exists at all. + */ + public function getUserGroups($uid) { + return array(); + } + + /** + * get a list of all groups + * @param string $search + * @param int $limit + * @param int $offset + * @return array an array of group names + * + * Returns a list with all groups + */ + + public function getGroups($search = '', $limit = -1, $offset = 0) { + return array(); + } + + /** + * check if a group exists + * @param string $gid + * @return bool + */ + public function groupExists($gid) { + return in_array($gid, $this->getGroups($gid, 1)); + } + + /** + * get a list of all users in a group + * @param string $gid + * @param string $search + * @param int $limit + * @param int $offset + * @return array an array of user ids + */ + public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { + return array(); + } +} diff --git a/lib/private/Group/Database.php b/lib/private/Group/Database.php new file mode 100644 index 00000000000..9fefdd77300 --- /dev/null +++ b/lib/private/Group/Database.php @@ -0,0 +1,338 @@ +<?php +/** + * @author Arthur Schiwon <blizzz@owncloud.com> + * @author Bart Visscher <bartv@thisnet.nl> + * @author Jakob Sack <mail@jakobsack.de> + * @author Joas Schilling <nickvergessen@owncloud.com> + * @author Jörn Friedrich Dreyer <jfd@butonic.de> + * @author Michael Gapczynski <GapczynskiM@gmail.com> + * @author michag86 <micha_g@arcor.de> + * @author Morris Jobke <hey@morrisjobke.de> + * @author Robin Appelman <icewind@owncloud.com> + * @author Robin McCorkell <robin@mccorkell.me.uk> + * @author Roeland Jago Douma <rullzer@owncloud.com> + * @author Thomas Müller <thomas.mueller@tmit.eu> + * + * @copyright Copyright (c) 2016, ownCloud, Inc. + * @license AGPL-3.0 + * + * This code is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License, version 3, + * along with this program. If not, see <http://www.gnu.org/licenses/> + * + */ +/* + * + * The following SQL statement is just a help for developers and will not be + * executed! + * + * CREATE TABLE `groups` ( + * `gid` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + * PRIMARY KEY (`gid`) + * ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + * + * CREATE TABLE `group_user` ( + * `gid` varchar(64) COLLATE utf8_unicode_ci NOT NULL, + * `uid` varchar(64) COLLATE utf8_unicode_ci NOT NULL + * ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + * + */ + +namespace OC\Group; + +/** + * Class for group management in a SQL Database (e.g. MySQL, SQLite) + */ +class Database extends \OC\Group\Backend { + + /** @var string[] */ + private $groupCache = []; + + /** @var \OCP\IDBConnection */ + private $dbConn; + + /** + * \OC\Group\Database constructor. + * + * @param \OCP\IDBConnection|null $dbConn + */ + public function __construct(\OCP\IDBConnection $dbConn = null) { + $this->dbConn = $dbConn; + } + + /** + * FIXME: This function should not be required! + */ + private function fixDI() { + if ($this->dbConn === null) { + $this->dbConn = \OC::$server->getDatabaseConnection(); + } + } + + /** + * Try to create a new group + * @param string $gid The name of the group to create + * @return bool + * + * Tries to create a new group. If the group name already exists, false will + * be returned. + */ + public function createGroup( $gid ) { + $this->fixDI(); + + // Add group + $result = $this->dbConn->insertIfNotExist('*PREFIX*groups', [ + 'gid' => $gid, + ]); + + // Add to cache + $this->groupCache[$gid] = $gid; + + return $result === 1; + } + + /** + * delete a group + * @param string $gid gid of the group to delete + * @return bool + * + * Deletes a group and removes it from the group_user-table + */ + public function deleteGroup( $gid ) { + $this->fixDI(); + + // Delete the group + $qb = $this->dbConn->getQueryBuilder(); + $qb->delete('groups') + ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) + ->execute(); + + // Delete the group-user relation + $qb = $this->dbConn->getQueryBuilder(); + $qb->delete('group_user') + ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) + ->execute(); + + // Delete the group-groupadmin relation + $qb = $this->dbConn->getQueryBuilder(); + $qb->delete('group_admin') + ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) + ->execute(); + + // Delete from cache + unset($this->groupCache[$gid]); + + return true; + } + + /** + * is user in group? + * @param string $uid uid of the user + * @param string $gid gid of the group + * @return bool + * + * Checks whether the user is member of a group or not. + */ + public function inGroup( $uid, $gid ) { + $this->fixDI(); + + // check + $qb = $this->dbConn->getQueryBuilder(); + $cursor = $qb->select('uid') + ->from('group_user') + ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) + ->andWhere($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) + ->execute(); + + $result = $cursor->fetch(); + $cursor->closeCursor(); + + return $result ? true : false; + } + + /** + * Add a user to a group + * @param string $uid Name of the user to add to group + * @param string $gid Name of the group in which add the user + * @return bool + * + * Adds a user to a group. + */ + public function addToGroup( $uid, $gid ) { + $this->fixDI(); + + // No duplicate entries! + if( !$this->inGroup( $uid, $gid )) { + $qb = $this->dbConn->getQueryBuilder(); + $qb->insert('group_user') + ->setValue('uid', $qb->createNamedParameter($uid)) + ->setValue('gid', $qb->createNamedParameter($gid)) + ->execute(); + return true; + }else{ + return false; + } + } + + /** + * Removes a user from a group + * @param string $uid Name of the user to remove from group + * @param string $gid Name of the group from which remove the user + * @return bool + * + * removes the user from a group. + */ + public function removeFromGroup( $uid, $gid ) { + $this->fixDI(); + + $qb = $this->dbConn->getQueryBuilder(); + $qb->delete('group_user') + ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) + ->andWhere($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) + ->execute(); + + return true; + } + + /** + * Get all groups a user belongs to + * @param string $uid Name of the user + * @return array an array of group names + * + * This function fetches all groups a user belongs to. It does not check + * if the user exists at all. + */ + public function getUserGroups( $uid ) { + $this->fixDI(); + + // No magic! + $qb = $this->dbConn->getQueryBuilder(); + $cursor = $qb->select('gid') + ->from('group_user') + ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) + ->execute(); + + $groups = []; + while( $row = $cursor->fetch()) { + $groups[] = $row["gid"]; + $this->groupCache[$row['gid']] = $row['gid']; + } + $cursor->closeCursor(); + + return $groups; + } + + /** + * get a list of all groups + * @param string $search + * @param int $limit + * @param int $offset + * @return array an array of group names + * + * Returns a list with all groups + */ + public function getGroups($search = '', $limit = null, $offset = null) { + $parameters = []; + $searchLike = ''; + if ($search !== '') { + $parameters[] = '%' . $search . '%'; + $searchLike = ' WHERE LOWER(`gid`) LIKE LOWER(?)'; + } + + $stmt = \OC_DB::prepare('SELECT `gid` FROM `*PREFIX*groups`' . $searchLike . ' ORDER BY `gid` ASC', $limit, $offset); + $result = $stmt->execute($parameters); + $groups = array(); + while ($row = $result->fetchRow()) { + $groups[] = $row['gid']; + } + return $groups; + } + + /** + * check if a group exists + * @param string $gid + * @return bool + */ + public function groupExists($gid) { + $this->fixDI(); + + // Check cache first + if (isset($this->groupCache[$gid])) { + return true; + } + + $qb = $this->dbConn->getQueryBuilder(); + $cursor = $qb->select('gid') + ->from('groups') + ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) + ->execute(); + $result = $cursor->fetch(); + $cursor->closeCursor(); + + if ($result !== false) { + $this->groupCache[$gid] = $gid; + return true; + } + return false; + } + + /** + * get a list of all users in a group + * @param string $gid + * @param string $search + * @param int $limit + * @param int $offset + * @return array an array of user ids + */ + public function usersInGroup($gid, $search = '', $limit = null, $offset = null) { + $parameters = [$gid]; + $searchLike = ''; + if ($search !== '') { + $parameters[] = '%' . $search . '%'; + $searchLike = ' AND `uid` LIKE ?'; + } + + $stmt = \OC_DB::prepare('SELECT `uid` FROM `*PREFIX*group_user` WHERE `gid` = ?' . $searchLike . ' ORDER BY `uid` ASC', + $limit, + $offset); + $result = $stmt->execute($parameters); + $users = array(); + while ($row = $result->fetchRow()) { + $users[] = $row['uid']; + } + return $users; + } + + /** + * get the number of all users matching the search string in a group + * @param string $gid + * @param string $search + * @return int|false + * @throws \OC\DatabaseException + */ + public function countUsersInGroup($gid, $search = '') { + $parameters = [$gid]; + $searchLike = ''; + if ($search !== '') { + $parameters[] = '%' . $search . '%'; + $searchLike = ' AND `uid` LIKE ?'; + } + + $stmt = \OC_DB::prepare('SELECT COUNT(`uid`) AS `count` FROM `*PREFIX*group_user` WHERE `gid` = ?' . $searchLike); + $result = $stmt->execute($parameters); + $count = $result->fetchOne(); + if($count !== false) { + $count = intval($count); + } + return $count; + } + +} diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php index 064b9f899e6..c42f53af9a6 100644 --- a/lib/private/Group/Group.php +++ b/lib/private/Group/Group.php @@ -46,7 +46,7 @@ class Group implements IGroup { private $usersLoaded; /** - * @var \OC_Group_Backend[]|\OC_Group_Database[] $backend + * @var \OC\Group\Backend[]|\OC\Group\Database[] $backend */ private $backends; @@ -62,7 +62,7 @@ class Group implements IGroup { /** * @param string $gid - * @param \OC_Group_Backend[] $backends + * @param \OC\Group\Backend[] $backends * @param \OC\User\Manager $userManager * @param \OC\Hooks\PublicEmitter $emitter */ @@ -136,7 +136,7 @@ class Group implements IGroup { $this->emitter->emit('\OC\Group', 'preAddUser', array($this, $user)); } foreach ($this->backends as $backend) { - if ($backend->implementsActions(\OC_Group_Backend::ADD_TO_GROUP)) { + if ($backend->implementsActions(\OC\Group\Backend::ADD_TO_GROUP)) { $backend->addToGroup($user->getUID(), $this->gid); if ($this->users) { $this->users[$user->getUID()] = $user; @@ -160,7 +160,7 @@ class Group implements IGroup { $this->emitter->emit('\OC\Group', 'preRemoveUser', array($this, $user)); } foreach ($this->backends as $backend) { - if ($backend->implementsActions(\OC_Group_Backend::REMOVE_FROM_GOUP) and $backend->inGroup($user->getUID(), $this->gid)) { + if ($backend->implementsActions(\OC\Group\Backend::REMOVE_FROM_GOUP) and $backend->inGroup($user->getUID(), $this->gid)) { $backend->removeFromGroup($user->getUID(), $this->gid); $result = true; } @@ -209,7 +209,7 @@ class Group implements IGroup { public function count($search = '') { $users = false; foreach ($this->backends as $backend) { - if($backend->implementsActions(\OC_Group_Backend::COUNT_USERS)) { + if($backend->implementsActions(\OC\Group\Backend::COUNT_USERS)) { if($users === false) { //we could directly add to a bool variable, but this would //be ugly @@ -257,7 +257,7 @@ class Group implements IGroup { $this->emitter->emit('\OC\Group', 'preDelete', array($this)); } foreach ($this->backends as $backend) { - if ($backend->implementsActions(\OC_Group_Backend::DELETE_GROUP)) { + if ($backend->implementsActions(\OC\Group\Backend::DELETE_GROUP)) { $result = true; $backend->deleteGroup($this->gid); } diff --git a/lib/private/Group/Manager.php b/lib/private/Group/Manager.php index e82a1d4f2e6..22367180edd 100644 --- a/lib/private/Group/Manager.php +++ b/lib/private/Group/Manager.php @@ -190,7 +190,7 @@ class Manager extends PublicEmitter implements IGroupManager { } else { $this->emit('\OC\Group', 'preCreate', array($gid)); foreach ($this->backends as $backend) { - if ($backend->implementsActions(\OC_Group_Backend::CREATE_GROUP)) { + if ($backend->implementsActions(\OC\Group\Backend::CREATE_GROUP)) { $backend->createGroup($gid); $group = $this->getGroupObject($gid); $this->emit('\OC\Group', 'postCreate', array($group)); diff --git a/lib/private/OCS/Provider.php b/lib/private/OCS/Provider.php new file mode 100644 index 00000000000..4a7caa79fa5 --- /dev/null +++ b/lib/private/OCS/Provider.php @@ -0,0 +1,96 @@ +<?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 OC\OCS; + +class Provider extends \OCP\AppFramework\Controller { + /** @var \OCP\App\IAppManager */ + private $appManager; + + /** + * @param string $appName + * @param \OCP\IRequest $request + * @param \OCP\App\IAppManager $appManager + */ + public function __construct($appName, + \OCP\IRequest $request, + \OCP\App\IAppManager $appManager) { + parent::__construct($appName, $request); + $this->appManager = $appManager; + } + + /** + * @return \OCP\AppFramework\Http\JSONResponse + */ + public function buildProviderList() { + $services = [ + 'PRIVATE_DATA' => [ + 'version' => 1, + 'endpoints' => [ + 'store' => '/ocs/v2.php/privatedata/setattribute', + 'read' => '/ocs/v2.php/privatedata/getattribute', + 'delete' => '/ocs/v2.php/privatedata/deleteattribute', + ], + ], + ]; + + if($this->appManager->isEnabledForUser('files_sharing')) { + $services['SHARING'] = [ + 'version' => 1, + 'endpoints' => [ + 'share' => '/ocs/v2.php/apps/files_sharing/api/v1/shares', + ], + ]; + $services['FEDERATED_SHARING'] = [ + 'version' => 1, + 'endpoints' => [ + 'share' => '/ocs/v2.php/cloud/shares', + 'webdav' => '/public.php/webdav/', + ], + ]; + } + + if($this->appManager->isEnabledForUser('activity')) { + $services['ACTIVITY'] = [ + 'version' => 1, + 'endpoints' => [ + 'list' => '/ocs/v2.php/cloud/activity', + ], + ]; + } + + if($this->appManager->isEnabledForUser('provisioning_api')) { + $services['PROVISIONING'] = [ + 'version' => 1, + 'endpoints' => [ + 'user' => '/ocs/v2.php/cloud/users', + 'groups' => '/ocs/v2.php/cloud/groups', + 'apps' => '/ocs/v2.php/cloud/apps', + ], + ]; + } + + return new \OCP\AppFramework\Http\JSONResponse([ + 'version' => 2, + 'services' => $services, + ]); + } +} diff --git a/lib/private/Route/CachingRouter.php b/lib/private/Route/CachingRouter.php index d6270dcf2c7..063d389e98b 100644 --- a/lib/private/Route/CachingRouter.php +++ b/lib/private/Route/CachingRouter.php @@ -50,8 +50,9 @@ class CachingRouter extends Router { public function generate($name, $parameters = array(), $absolute = false) { asort($parameters); $key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . intval($absolute); - if ($this->cache->hasKey($key)) { - return $this->cache->get($key); + $cachedKey = $this->cache->get($key); + if ($cachedKey) { + return $cachedKey; } else { $url = parent::generate($name, $parameters, $absolute); $this->cache->set($key, $url, 3600); 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..7104f46fea2 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); } /** @@ -380,6 +362,10 @@ class Session implements IUserSession, Emitter { // user does not exist return false; } + if (!$user->isEnabled()) { + // disabled users can not log in + return false; + } //login $this->setUser($user); @@ -418,34 +404,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/private/legacy/group.php b/lib/private/legacy/group.php index f1b84069a38..ceb99389942 100644 --- a/lib/private/legacy/group.php +++ b/lib/private/legacy/group.php @@ -66,7 +66,7 @@ class OC_Group { /** * set the group backend - * @param \OC_Group_Backend $backend The backend to use for user management + * @param \OC\Group\Backend $backend The backend to use for user management * @return bool */ public static function useBackend($backend) { diff --git a/lib/private/legacy/group/backend.php b/lib/private/legacy/group/backend.php index 3d8d71b1529..a5df9c339b9 100644 --- a/lib/private/legacy/group/backend.php +++ b/lib/private/legacy/group/backend.php @@ -53,117 +53,7 @@ define('OC_GROUP_BACKEND_COUNT_USERS', 0x00100000); /** * Abstract base class for user management + * @deprecated Since 9.1.0 use \OC\Group\Backend */ -abstract class OC_Group_Backend implements \OCP\GroupInterface { - /** - * error code for functions not provided by the group backend - */ - const NOT_IMPLEMENTED = -501; - - /** - * actions that user backends can define - */ - const CREATE_GROUP = 0x00000001; - const DELETE_GROUP = 0x00000010; - const ADD_TO_GROUP = 0x00000100; - const REMOVE_FROM_GOUP = 0x00001000; - //OBSOLETE const GET_DISPLAYNAME = 0x00010000; - const COUNT_USERS = 0x00100000; - - protected $possibleActions = array( - self::CREATE_GROUP => 'createGroup', - self::DELETE_GROUP => 'deleteGroup', - self::ADD_TO_GROUP => 'addToGroup', - self::REMOVE_FROM_GOUP => 'removeFromGroup', - self::COUNT_USERS => 'countUsersInGroup', - ); - - /** - * Get all supported actions - * @return int bitwise-or'ed actions - * - * Returns the supported actions as int to be - * compared with \OC_Group_Backend::CREATE_GROUP etc. - */ - public function getSupportedActions() { - $actions = 0; - foreach($this->possibleActions AS $action => $methodName) { - if(method_exists($this, $methodName)) { - $actions |= $action; - } - } - - return $actions; - } - - /** - * Check if backend implements actions - * @param int $actions bitwise-or'ed actions - * @return bool - * - * Returns the supported actions as int to be - * compared with \OC_Group_Backend::CREATE_GROUP etc. - */ - public function implementsActions($actions) { - return (bool)($this->getSupportedActions() & $actions); - } - - /** - * is user in group? - * @param string $uid uid of the user - * @param string $gid gid of the group - * @return bool - * - * Checks whether the user is member of a group or not. - */ - public function inGroup($uid, $gid) { - return in_array($gid, $this->getUserGroups($uid)); - } - - /** - * Get all groups a user belongs to - * @param string $uid Name of the user - * @return array an array of group names - * - * This function fetches all groups a user belongs to. It does not check - * if the user exists at all. - */ - public function getUserGroups($uid) { - return array(); - } - - /** - * get a list of all groups - * @param string $search - * @param int $limit - * @param int $offset - * @return array an array of group names - * - * Returns a list with all groups - */ - - public function getGroups($search = '', $limit = -1, $offset = 0) { - return array(); - } - - /** - * check if a group exists - * @param string $gid - * @return bool - */ - public function groupExists($gid) { - return in_array($gid, $this->getGroups($gid, 1)); - } - - /** - * get a list of all users in a group - * @param string $gid - * @param string $search - * @param int $limit - * @param int $offset - * @return array an array of user ids - */ - public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) { - return array(); - } +abstract class OC_Group_Backend extends \OC\Group\Backend { } diff --git a/lib/private/legacy/group/database.php b/lib/private/legacy/group/database.php index 9ea0bbb8242..3969b3681fe 100644 --- a/lib/private/legacy/group/database.php +++ b/lib/private/legacy/group/database.php @@ -1,17 +1,8 @@ <?php /** - * @author Arthur Schiwon <blizzz@owncloud.com> - * @author Bart Visscher <bartv@thisnet.nl> * @author Jakob Sack <mail@jakobsack.de> - * @author Joas Schilling <nickvergessen@owncloud.com> - * @author Jörn Friedrich Dreyer <jfd@butonic.de> - * @author Michael Gapczynski <GapczynskiM@gmail.com> - * @author michag86 <micha_g@arcor.de> * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <icewind@owncloud.com> - * @author Robin McCorkell <robin@mccorkell.me.uk> * @author Roeland Jago Douma <rullzer@owncloud.com> - * @author Thomas Müller <thomas.mueller@tmit.eu> * * @copyright Copyright (c) 2016, ownCloud, Inc. * @license AGPL-3.0 @@ -29,308 +20,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ -/* - * - * The following SQL statement is just a help for developers and will not be - * executed! - * - * CREATE TABLE `groups` ( - * `gid` varchar(64) COLLATE utf8_unicode_ci NOT NULL, - * PRIMARY KEY (`gid`) - * ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - * - * CREATE TABLE `group_user` ( - * `gid` varchar(64) COLLATE utf8_unicode_ci NOT NULL, - * `uid` varchar(64) COLLATE utf8_unicode_ci NOT NULL - * ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; - * - */ /** - * Class for group management in a SQL Database (e.g. MySQL, SQLite) + * Class OC_Group_Database + * @deprecated Since 9.1.0 use \OC\Group\Database */ -class OC_Group_Database extends OC_Group_Backend { - - /** @var string[] */ - private $groupCache = []; - - /** @var \OCP\IDBConnection */ - private $dbConn; - - /** - * OC_Group_Database constructor. - * - * @param \OCP\IDBConnection|null $dbConn - */ - public function __construct(\OCP\IDBConnection $dbConn = null) { - $this->dbConn = $dbConn; - } - - /** - * FIXME: This function should not be required! - */ - private function fixDI() { - if ($this->dbConn === null) { - $this->dbConn = \OC::$server->getDatabaseConnection(); - } - } - - /** - * Try to create a new group - * @param string $gid The name of the group to create - * @return bool - * - * Tries to create a new group. If the group name already exists, false will - * be returned. - */ - public function createGroup( $gid ) { - $this->fixDI(); - - // Add group - $result = $this->dbConn->insertIfNotExist('*PREFIX*groups', [ - 'gid' => $gid, - ]); - - // Add to cache - $this->groupCache[$gid] = $gid; - - return $result === 1; - } - - /** - * delete a group - * @param string $gid gid of the group to delete - * @return bool - * - * Deletes a group and removes it from the group_user-table - */ - public function deleteGroup( $gid ) { - $this->fixDI(); - - // Delete the group - $qb = $this->dbConn->getQueryBuilder(); - $qb->delete('groups') - ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); - - // Delete the group-user relation - $qb = $this->dbConn->getQueryBuilder(); - $qb->delete('group_user') - ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); - - // Delete the group-groupadmin relation - $qb = $this->dbConn->getQueryBuilder(); - $qb->delete('group_admin') - ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); - - // Delete from cache - unset($this->groupCache[$gid]); - - return true; - } - - /** - * is user in group? - * @param string $uid uid of the user - * @param string $gid gid of the group - * @return bool - * - * Checks whether the user is member of a group or not. - */ - public function inGroup( $uid, $gid ) { - $this->fixDI(); - - // check - $qb = $this->dbConn->getQueryBuilder(); - $cursor = $qb->select('uid') - ->from('group_user') - ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->andWhere($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) - ->execute(); - - $result = $cursor->fetch(); - $cursor->closeCursor(); - - return $result ? true : false; - } - - /** - * Add a user to a group - * @param string $uid Name of the user to add to group - * @param string $gid Name of the group in which add the user - * @return bool - * - * Adds a user to a group. - */ - public function addToGroup( $uid, $gid ) { - $this->fixDI(); - - // No duplicate entries! - if( !$this->inGroup( $uid, $gid )) { - $qb = $this->dbConn->getQueryBuilder(); - $qb->insert('group_user') - ->setValue('uid', $qb->createNamedParameter($uid)) - ->setValue('gid', $qb->createNamedParameter($gid)) - ->execute(); - return true; - }else{ - return false; - } - } - - /** - * Removes a user from a group - * @param string $uid Name of the user to remove from group - * @param string $gid Name of the group from which remove the user - * @return bool - * - * removes the user from a group. - */ - public function removeFromGroup( $uid, $gid ) { - $this->fixDI(); - - $qb = $this->dbConn->getQueryBuilder(); - $qb->delete('group_user') - ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) - ->andWhere($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); - - return true; - } - - /** - * Get all groups a user belongs to - * @param string $uid Name of the user - * @return array an array of group names - * - * This function fetches all groups a user belongs to. It does not check - * if the user exists at all. - */ - public function getUserGroups( $uid ) { - $this->fixDI(); - - // No magic! - $qb = $this->dbConn->getQueryBuilder(); - $cursor = $qb->select('gid') - ->from('group_user') - ->where($qb->expr()->eq('uid', $qb->createNamedParameter($uid))) - ->execute(); - - $groups = []; - while( $row = $cursor->fetch()) { - $groups[] = $row["gid"]; - $this->groupCache[$row['gid']] = $row['gid']; - } - $cursor->closeCursor(); - - return $groups; - } - - /** - * get a list of all groups - * @param string $search - * @param int $limit - * @param int $offset - * @return array an array of group names - * - * Returns a list with all groups - */ - public function getGroups($search = '', $limit = null, $offset = null) { - $parameters = []; - $searchLike = ''; - if ($search !== '') { - $parameters[] = '%' . $search . '%'; - $searchLike = ' WHERE LOWER(`gid`) LIKE LOWER(?)'; - } - - $stmt = OC_DB::prepare('SELECT `gid` FROM `*PREFIX*groups`' . $searchLike . ' ORDER BY `gid` ASC', $limit, $offset); - $result = $stmt->execute($parameters); - $groups = array(); - while ($row = $result->fetchRow()) { - $groups[] = $row['gid']; - } - return $groups; - } - - /** - * check if a group exists - * @param string $gid - * @return bool - */ - public function groupExists($gid) { - $this->fixDI(); - - // Check cache first - if (isset($this->groupCache[$gid])) { - return true; - } - - $qb = $this->dbConn->getQueryBuilder(); - $cursor = $qb->select('gid') - ->from('groups') - ->where($qb->expr()->eq('gid', $qb->createNamedParameter($gid))) - ->execute(); - $result = $cursor->fetch(); - $cursor->closeCursor(); - - if ($result !== false) { - $this->groupCache[$gid] = $gid; - return true; - } - return false; - } - - /** - * get a list of all users in a group - * @param string $gid - * @param string $search - * @param int $limit - * @param int $offset - * @return array an array of user ids - */ - public function usersInGroup($gid, $search = '', $limit = null, $offset = null) { - $parameters = [$gid]; - $searchLike = ''; - if ($search !== '') { - $parameters[] = '%' . $search . '%'; - $searchLike = ' AND `uid` LIKE ?'; - } - - $stmt = OC_DB::prepare('SELECT `uid` FROM `*PREFIX*group_user` WHERE `gid` = ?' . $searchLike . ' ORDER BY `uid` ASC', - $limit, - $offset); - $result = $stmt->execute($parameters); - $users = array(); - while ($row = $result->fetchRow()) { - $users[] = $row['uid']; - } - return $users; - } - - /** - * get the number of all users matching the search string in a group - * @param string $gid - * @param string $search - * @return int|false - * @throws \OC\DatabaseException - */ - public function countUsersInGroup($gid, $search = '') { - $parameters = [$gid]; - $searchLike = ''; - if ($search !== '') { - $parameters[] = '%' . $search . '%'; - $searchLike = ' AND `uid` LIKE ?'; - } - - $stmt = OC_DB::prepare('SELECT COUNT(`uid`) AS `count` FROM `*PREFIX*group_user` WHERE `gid` = ?' . $searchLike); - $result = $stmt->execute($parameters); - $count = $result->fetchOne(); - if($count !== false) { - $count = intval($count); - } - return $count; - } - -} +class OC_Group_Database extends \OC\Group\Database { + +}
\ No newline at end of file diff --git a/lib/public/api.php b/lib/public/API.php index 4d68bef6f29..4d68bef6f29 100644 --- a/lib/public/api.php +++ b/lib/public/API.php diff --git a/lib/public/app.php b/lib/public/App.php index c3ba90cea41..c3ba90cea41 100644 --- a/lib/public/app.php +++ b/lib/public/App.php diff --git a/lib/public/authentication/iapachebackend.php b/lib/public/Authentication/IApacheBackend.php index f1f408cfa6d..f1f408cfa6d 100644 --- a/lib/public/authentication/iapachebackend.php +++ b/lib/public/Authentication/IApacheBackend.php diff --git a/lib/public/autoloadnotallowedexception.php b/lib/public/AutoloadNotAllowedException.php index f0028b7d49d..f0028b7d49d 100644 --- a/lib/public/autoloadnotallowedexception.php +++ b/lib/public/AutoloadNotAllowedException.php diff --git a/lib/public/backgroundjob.php b/lib/public/BackgroundJob.php index f532a97c747..f532a97c747 100644 --- a/lib/public/backgroundjob.php +++ b/lib/public/BackgroundJob.php diff --git a/lib/public/config.php b/lib/public/Config.php index 5b5dcb0e78e..5b5dcb0e78e 100644 --- a/lib/public/config.php +++ b/lib/public/Config.php diff --git a/lib/public/console/consoleevent.php b/lib/public/Console/ConsoleEvent.php index b3f1229f0e8..b3f1229f0e8 100644 --- a/lib/public/console/consoleevent.php +++ b/lib/public/Console/ConsoleEvent.php diff --git a/lib/public/constants.php b/lib/public/Constants.php index abf5f95eb96..abf5f95eb96 100644 --- a/lib/public/constants.php +++ b/lib/public/Constants.php diff --git a/lib/public/contacts.php b/lib/public/Contacts.php index 590fd9af1bd..590fd9af1bd 100644 --- a/lib/public/contacts.php +++ b/lib/public/Contacts.php diff --git a/lib/public/contacts/imanager.php b/lib/public/Contacts/IManager.php index c6d557eaba7..c6d557eaba7 100644 --- a/lib/public/contacts/imanager.php +++ b/lib/public/Contacts/IManager.php diff --git a/lib/public/db.php b/lib/public/DB.php index 4706c5e95ee..4706c5e95ee 100644 --- a/lib/public/db.php +++ b/lib/public/DB.php diff --git a/lib/public/db/querybuilder/icompositeexpression.php b/lib/public/DB/QueryBuilder/ICompositeExpression.php index c47ba1deb1e..1a5366c6ce4 100644 --- a/lib/public/db/querybuilder/icompositeexpression.php +++ b/lib/public/DB/QueryBuilder/ICompositeExpression.php @@ -31,7 +31,7 @@ interface ICompositeExpression { * * @param array $parts * - * @return \OCP\DB\ICompositeExpression + * @return ICompositeExpression * @since 8.2.0 */ public function addMultiple(array $parts = array()); @@ -41,7 +41,7 @@ interface ICompositeExpression { * * @param mixed $part * - * @return \OCP\DB\ICompositeExpression + * @return ICompositeExpression * @since 8.2.0 */ public function add($part); diff --git a/lib/public/db/querybuilder/iexpressionbuilder.php b/lib/public/DB/QueryBuilder/IExpressionBuilder.php index 0db25704dd7..0db25704dd7 100644 --- a/lib/public/db/querybuilder/iexpressionbuilder.php +++ b/lib/public/DB/QueryBuilder/IExpressionBuilder.php diff --git a/lib/public/db/querybuilder/iliteral.php b/lib/public/DB/QueryBuilder/ILiteral.php index ab1cc59229a..ab1cc59229a 100644 --- a/lib/public/db/querybuilder/iliteral.php +++ b/lib/public/DB/QueryBuilder/ILiteral.php diff --git a/lib/public/db/querybuilder/iparameter.php b/lib/public/DB/QueryBuilder/IParameter.php index be141cea9a7..be141cea9a7 100644 --- a/lib/public/db/querybuilder/iparameter.php +++ b/lib/public/DB/QueryBuilder/IParameter.php diff --git a/lib/public/db/querybuilder/iquerybuilder.php b/lib/public/DB/QueryBuilder/IQueryBuilder.php index 444910a9c5a..444910a9c5a 100644 --- a/lib/public/db/querybuilder/iquerybuilder.php +++ b/lib/public/DB/QueryBuilder/IQueryBuilder.php diff --git a/lib/public/db/querybuilder/iqueryfunction.php b/lib/public/DB/QueryBuilder/IQueryFunction.php index 8050bd295e4..8050bd295e4 100644 --- a/lib/public/db/querybuilder/iqueryfunction.php +++ b/lib/public/DB/QueryBuilder/IQueryFunction.php diff --git a/lib/public/defaults.php b/lib/public/Defaults.php index 58b25d5914a..58b25d5914a 100644 --- a/lib/public/defaults.php +++ b/lib/public/Defaults.php diff --git a/lib/public/diagnostics/ievent.php b/lib/public/Diagnostics/IEvent.php index a3e42ee137f..a3e42ee137f 100644 --- a/lib/public/diagnostics/ievent.php +++ b/lib/public/Diagnostics/IEvent.php diff --git a/lib/public/diagnostics/ieventlogger.php b/lib/public/Diagnostics/IEventLogger.php index 34e521db10c..34e521db10c 100644 --- a/lib/public/diagnostics/ieventlogger.php +++ b/lib/public/Diagnostics/IEventLogger.php diff --git a/lib/public/diagnostics/iquery.php b/lib/public/Diagnostics/IQuery.php index 3b4d1b4c965..3b4d1b4c965 100644 --- a/lib/public/diagnostics/iquery.php +++ b/lib/public/Diagnostics/IQuery.php diff --git a/lib/public/diagnostics/iquerylogger.php b/lib/public/Diagnostics/IQueryLogger.php index 285a85efde1..285a85efde1 100644 --- a/lib/public/diagnostics/iquerylogger.php +++ b/lib/public/Diagnostics/IQueryLogger.php 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.php b/lib/public/Files.php index f7f0b30bf86..f7f0b30bf86 100644 --- a/lib/public/files.php +++ b/lib/public/Files.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/groupinterface.php b/lib/public/GroupInterface.php index 628bc2f42ef..628bc2f42ef 100644 --- a/lib/public/groupinterface.php +++ b/lib/public/GroupInterface.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/lib/public/iaddressbook.php b/lib/public/IAddressBook.php index 63e7e061448..63e7e061448 100644 --- a/lib/public/iaddressbook.php +++ b/lib/public/IAddressBook.php diff --git a/lib/public/iappconfig.php b/lib/public/IAppConfig.php index 1406e8a56d6..1406e8a56d6 100644 --- a/lib/public/iappconfig.php +++ b/lib/public/IAppConfig.php diff --git a/lib/public/iavatar.php b/lib/public/IAvatar.php index 7b811b26b68..7b811b26b68 100644 --- a/lib/public/iavatar.php +++ b/lib/public/IAvatar.php diff --git a/lib/public/iavatarmanager.php b/lib/public/IAvatarManager.php index ef6b00ffd13..ef6b00ffd13 100644 --- a/lib/public/iavatarmanager.php +++ b/lib/public/IAvatarManager.php diff --git a/lib/public/icache.php b/lib/public/ICache.php index 3319013ddfa..a1ce068d819 100644 --- a/lib/public/icache.php +++ b/lib/public/ICache.php @@ -60,6 +60,7 @@ interface ICache { * @param string $key * @return bool * @since 6.0.0 + * @deprecated 9.1.0 Directly read from GET to prevent race conditions */ public function hasKey($key); diff --git a/lib/public/icachefactory.php b/lib/public/ICacheFactory.php index 233a4f5525d..233a4f5525d 100644 --- a/lib/public/icachefactory.php +++ b/lib/public/ICacheFactory.php diff --git a/lib/public/icertificate.php b/lib/public/ICertificate.php index c3a003fbf0a..c3a003fbf0a 100644 --- a/lib/public/icertificate.php +++ b/lib/public/ICertificate.php diff --git a/lib/public/icertificatemanager.php b/lib/public/ICertificateManager.php index 27eebcf0491..27eebcf0491 100644 --- a/lib/public/icertificatemanager.php +++ b/lib/public/ICertificateManager.php diff --git a/lib/public/iconfig.php b/lib/public/IConfig.php index 8dac390a99c..8dac390a99c 100644 --- a/lib/public/iconfig.php +++ b/lib/public/IConfig.php diff --git a/lib/public/icontainer.php b/lib/public/IContainer.php index d23ee5ea3b5..d23ee5ea3b5 100644 --- a/lib/public/icontainer.php +++ b/lib/public/IContainer.php diff --git a/lib/public/idbconnection.php b/lib/public/IDBConnection.php index 780fcd26364..780fcd26364 100644 --- a/lib/public/idbconnection.php +++ b/lib/public/IDBConnection.php diff --git a/lib/public/idatetimeformatter.php b/lib/public/IDateTimeFormatter.php index e8d357ae50f..e8d357ae50f 100644 --- a/lib/public/idatetimeformatter.php +++ b/lib/public/IDateTimeFormatter.php diff --git a/lib/public/idatetimezone.php b/lib/public/IDateTimeZone.php index 3df705a2413..3df705a2413 100644 --- a/lib/public/idatetimezone.php +++ b/lib/public/IDateTimeZone.php diff --git a/lib/public/idb.php b/lib/public/IDb.php index f21fedd1f54..f21fedd1f54 100644 --- a/lib/public/idb.php +++ b/lib/public/IDb.php diff --git a/lib/public/ieventsource.php b/lib/public/IEventSource.php index b643d1c9da7..b643d1c9da7 100644 --- a/lib/public/ieventsource.php +++ b/lib/public/IEventSource.php diff --git a/lib/public/igroup.php b/lib/public/IGroup.php index 02f2ef201fd..02f2ef201fd 100644 --- a/lib/public/igroup.php +++ b/lib/public/IGroup.php diff --git a/lib/public/igroupmanager.php b/lib/public/IGroupManager.php index cda40606f9d..cda40606f9d 100644 --- a/lib/public/igroupmanager.php +++ b/lib/public/IGroupManager.php diff --git a/lib/public/ihelper.php b/lib/public/IHelper.php index 4ad1d5704fd..4ad1d5704fd 100644 --- a/lib/public/ihelper.php +++ b/lib/public/IHelper.php diff --git a/lib/public/iimage.php b/lib/public/IImage.php index db0ca0f93be..db0ca0f93be 100644 --- a/lib/public/iimage.php +++ b/lib/public/IImage.php diff --git a/lib/public/il10n.php b/lib/public/IL10N.php index f1954eeb4b9..f1954eeb4b9 100644 --- a/lib/public/il10n.php +++ b/lib/public/IL10N.php diff --git a/lib/public/ilogger.php b/lib/public/ILogger.php index fa947612fcd..fa947612fcd 100644 --- a/lib/public/ilogger.php +++ b/lib/public/ILogger.php diff --git a/lib/public/imemcache.php b/lib/public/IMemcache.php index b5c0cef923d..b5c0cef923d 100644 --- a/lib/public/imemcache.php +++ b/lib/public/IMemcache.php diff --git a/lib/public/imemcachettl.php b/lib/public/IMemcacheTTL.php index f2d03dcdf40..f2d03dcdf40 100644 --- a/lib/public/imemcachettl.php +++ b/lib/public/IMemcacheTTL.php diff --git a/lib/public/inavigationmanager.php b/lib/public/INavigationManager.php index 243f6ea3eea..243f6ea3eea 100644 --- a/lib/public/inavigationmanager.php +++ b/lib/public/INavigationManager.php diff --git a/lib/public/ipreview.php b/lib/public/IPreview.php index cfcbebd8639..cfcbebd8639 100644 --- a/lib/public/ipreview.php +++ b/lib/public/IPreview.php diff --git a/lib/public/irequest.php b/lib/public/IRequest.php index 296c70f4ecc..296c70f4ecc 100644 --- a/lib/public/irequest.php +++ b/lib/public/IRequest.php diff --git a/lib/public/isearch.php b/lib/public/ISearch.php index ec6673dabbd..ec6673dabbd 100644 --- a/lib/public/isearch.php +++ b/lib/public/ISearch.php diff --git a/lib/public/isession.php b/lib/public/ISession.php index 7bc8654a1b9..7bc8654a1b9 100644 --- a/lib/public/isession.php +++ b/lib/public/ISession.php diff --git a/lib/public/itagmanager.php b/lib/public/ITagManager.php index e6d67ddd02c..e6d67ddd02c 100644 --- a/lib/public/itagmanager.php +++ b/lib/public/ITagManager.php diff --git a/lib/public/itags.php b/lib/public/ITags.php index cbc178c37bf..cbc178c37bf 100644 --- a/lib/public/itags.php +++ b/lib/public/ITags.php diff --git a/lib/public/itempmanager.php b/lib/public/ITempManager.php index 025e43d8563..025e43d8563 100644 --- a/lib/public/itempmanager.php +++ b/lib/public/ITempManager.php diff --git a/lib/public/iurlgenerator.php b/lib/public/IURLGenerator.php index a702ca47bfc..a702ca47bfc 100644 --- a/lib/public/iurlgenerator.php +++ b/lib/public/IURLGenerator.php diff --git a/lib/public/iuser.php b/lib/public/IUser.php index 16617a2f2f6..16617a2f2f6 100644 --- a/lib/public/iuser.php +++ b/lib/public/IUser.php diff --git a/lib/public/iuserbackend.php b/lib/public/IUserBackend.php index 5cd7945dd7a..5cd7945dd7a 100644 --- a/lib/public/iuserbackend.php +++ b/lib/public/IUserBackend.php diff --git a/lib/public/iusermanager.php b/lib/public/IUserManager.php index 00c0bbc8721..00c0bbc8721 100644 --- a/lib/public/iusermanager.php +++ b/lib/public/IUserManager.php diff --git a/lib/public/iusersession.php b/lib/public/IUserSession.php index 2196f2c8ce0..2196f2c8ce0 100644 --- a/lib/public/iusersession.php +++ b/lib/public/IUserSession.php diff --git a/lib/public/image.php b/lib/public/Image.php index 4a7ffe8bc9a..4a7ffe8bc9a 100644 --- a/lib/public/image.php +++ b/lib/public/Image.php diff --git a/lib/public/json.php b/lib/public/JSON.php index fceffa0001e..fceffa0001e 100644 --- a/lib/public/json.php +++ b/lib/public/JSON.php diff --git a/lib/public/l10n/ifactory.php b/lib/public/L10N/IFactory.php index 264c9719639..264c9719639 100644 --- a/lib/public/l10n/ifactory.php +++ b/lib/public/L10N/IFactory.php diff --git a/lib/public/lock/ilockingprovider.php b/lib/public/Lock/ILockingProvider.php index b4b579bbc7a..b4b579bbc7a 100644 --- a/lib/public/lock/ilockingprovider.php +++ b/lib/public/Lock/ILockingProvider.php diff --git a/lib/public/lock/lockedexception.php b/lib/public/Lock/LockedException.php index d084046046e..d084046046e 100644 --- a/lib/public/lock/lockedexception.php +++ b/lib/public/Lock/LockedException.php diff --git a/lib/public/mail/imailer.php b/lib/public/Mail/IMailer.php index e3c751277ac..e3c751277ac 100644 --- a/lib/public/mail/imailer.php +++ b/lib/public/Mail/IMailer.php diff --git a/lib/public/migration/ioutput.php b/lib/public/Migration/IOutput.php index d3b43028495..d3b43028495 100644 --- a/lib/public/migration/ioutput.php +++ b/lib/public/Migration/IOutput.php diff --git a/lib/public/migration/irepairstep.php b/lib/public/Migration/IRepairStep.php index 07830a935f9..07830a935f9 100644 --- a/lib/public/migration/irepairstep.php +++ b/lib/public/Migration/IRepairStep.php diff --git a/lib/public/notification/iaction.php b/lib/public/Notification/IAction.php index 1f4d1d5b7fe..1f4d1d5b7fe 100644 --- a/lib/public/notification/iaction.php +++ b/lib/public/Notification/IAction.php diff --git a/lib/public/notification/iapp.php b/lib/public/Notification/IApp.php index 98da265559b..98da265559b 100644 --- a/lib/public/notification/iapp.php +++ b/lib/public/Notification/IApp.php diff --git a/lib/public/notification/imanager.php b/lib/public/Notification/IManager.php index a18af747b10..a18af747b10 100644 --- a/lib/public/notification/imanager.php +++ b/lib/public/Notification/IManager.php diff --git a/lib/public/notification/inotification.php b/lib/public/Notification/INotification.php index 2d8557ec64d..2d8557ec64d 100644 --- a/lib/public/notification/inotification.php +++ b/lib/public/Notification/INotification.php diff --git a/lib/public/notification/inotifier.php b/lib/public/Notification/INotifier.php index 0d9cecc88b8..0d9cecc88b8 100644 --- a/lib/public/notification/inotifier.php +++ b/lib/public/Notification/INotifier.php diff --git a/lib/public/preconditionnotmetexception.php b/lib/public/PreConditionNotMetException.php index 212efc08ded..212efc08ded 100644 --- a/lib/public/preconditionnotmetexception.php +++ b/lib/public/PreConditionNotMetException.php diff --git a/lib/public/preview/iprovider.php b/lib/public/Preview/IProvider.php index 8231e90f000..8231e90f000 100644 --- a/lib/public/preview/iprovider.php +++ b/lib/public/Preview/IProvider.php diff --git a/lib/public/response.php b/lib/public/Response.php index a2a7667684a..a2a7667684a 100644 --- a/lib/public/response.php +++ b/lib/public/Response.php diff --git a/lib/public/route/iroute.php b/lib/public/Route/IRoute.php index 904cb81b0bd..904cb81b0bd 100644 --- a/lib/public/route/iroute.php +++ b/lib/public/Route/IRoute.php diff --git a/lib/public/route/irouter.php b/lib/public/Route/IRouter.php index b4573fb39f2..b4573fb39f2 100644 --- a/lib/public/route/irouter.php +++ b/lib/public/Route/IRouter.php diff --git a/lib/public/sabrepluginevent.php b/lib/public/SabrePluginEvent.php index 11d939aee47..11d939aee47 100644 --- a/lib/public/sabrepluginevent.php +++ b/lib/public/SabrePluginEvent.php diff --git a/lib/public/sabrepluginexception.php b/lib/public/SabrePluginException.php index 2c5a799c4f7..2c5a799c4f7 100644 --- a/lib/public/sabrepluginexception.php +++ b/lib/public/SabrePluginException.php diff --git a/lib/public/security/icontentsecuritypolicymanager.php b/lib/public/Security/IContentSecurityPolicyManager.php index 10f1efe995f..10f1efe995f 100644 --- a/lib/public/security/icontentsecuritypolicymanager.php +++ b/lib/public/Security/IContentSecurityPolicyManager.php diff --git a/lib/public/security/icredentialsmanager.php b/lib/public/Security/ICredentialsManager.php index d576bbcfbd8..d576bbcfbd8 100644 --- a/lib/public/security/icredentialsmanager.php +++ b/lib/public/Security/ICredentialsManager.php diff --git a/lib/public/security/icrypto.php b/lib/public/Security/ICrypto.php index 62f27017ab7..62f27017ab7 100644 --- a/lib/public/security/icrypto.php +++ b/lib/public/Security/ICrypto.php diff --git a/lib/public/security/ihasher.php b/lib/public/Security/IHasher.php index 39ba5094b12..39ba5094b12 100644 --- a/lib/public/security/ihasher.php +++ b/lib/public/Security/IHasher.php diff --git a/lib/public/security/isecurerandom.php b/lib/public/Security/ISecureRandom.php index 9b346afe680..9b346afe680 100644 --- a/lib/public/security/isecurerandom.php +++ b/lib/public/Security/ISecureRandom.php diff --git a/lib/public/security/stringutils.php b/lib/public/Security/StringUtils.php index ff1e290315a..ff1e290315a 100644 --- a/lib/public/security/stringutils.php +++ b/lib/public/Security/StringUtils.php diff --git a/lib/public/share.php b/lib/public/Share.php index 9c62ec703e4..9c62ec703e4 100644 --- a/lib/public/share.php +++ b/lib/public/Share.php diff --git a/lib/public/share_backend.php b/lib/public/Share_Backend.php index 110403c1f49..110403c1f49 100644 --- a/lib/public/share_backend.php +++ b/lib/public/Share_Backend.php diff --git a/lib/public/share_backend_collection.php b/lib/public/Share_Backend_Collection.php index 185cf32ce3e..185cf32ce3e 100644 --- a/lib/public/share_backend_collection.php +++ b/lib/public/Share_Backend_Collection.php diff --git a/lib/public/share_backend_file_dependent.php b/lib/public/Share_Backend_File_Dependent.php index 64b3bf43319..64b3bf43319 100644 --- a/lib/public/share_backend_file_dependent.php +++ b/lib/public/Share_Backend_File_Dependent.php diff --git a/lib/public/systemtag/isystemtag.php b/lib/public/SystemTag/ISystemTag.php index 02d02037293..02d02037293 100644 --- a/lib/public/systemtag/isystemtag.php +++ b/lib/public/SystemTag/ISystemTag.php diff --git a/lib/public/systemtag/isystemtagmanager.php b/lib/public/SystemTag/ISystemTagManager.php index 983bfd636ce..983bfd636ce 100644 --- a/lib/public/systemtag/isystemtagmanager.php +++ b/lib/public/SystemTag/ISystemTagManager.php diff --git a/lib/public/systemtag/isystemtagmanagerfactory.php b/lib/public/SystemTag/ISystemTagManagerFactory.php index ad7467633b1..ad7467633b1 100644 --- a/lib/public/systemtag/isystemtagmanagerfactory.php +++ b/lib/public/SystemTag/ISystemTagManagerFactory.php diff --git a/lib/public/systemtag/isystemtagobjectmapper.php b/lib/public/SystemTag/ISystemTagObjectMapper.php index 59b988a3656..59b988a3656 100644 --- a/lib/public/systemtag/isystemtagobjectmapper.php +++ b/lib/public/SystemTag/ISystemTagObjectMapper.php diff --git a/lib/public/systemtag/managerevent.php b/lib/public/SystemTag/ManagerEvent.php index a0429fc9f67..a0429fc9f67 100644 --- a/lib/public/systemtag/managerevent.php +++ b/lib/public/SystemTag/ManagerEvent.php diff --git a/lib/public/systemtag/mapperevent.php b/lib/public/SystemTag/MapperEvent.php index e05a5ce09c8..e05a5ce09c8 100644 --- a/lib/public/systemtag/mapperevent.php +++ b/lib/public/SystemTag/MapperEvent.php diff --git a/lib/public/systemtag/tagalreadyexistsexception.php b/lib/public/SystemTag/TagAlreadyExistsException.php index 5c3d86ad642..5c3d86ad642 100644 --- a/lib/public/systemtag/tagalreadyexistsexception.php +++ b/lib/public/SystemTag/TagAlreadyExistsException.php diff --git a/lib/public/systemtag/tagnotfoundexception.php b/lib/public/SystemTag/TagNotFoundException.php index 12feda8f58a..12feda8f58a 100644 --- a/lib/public/systemtag/tagnotfoundexception.php +++ b/lib/public/SystemTag/TagNotFoundException.php diff --git a/lib/public/user.php b/lib/public/User.php index 64ac92d2100..64ac92d2100 100644 --- a/lib/public/user.php +++ b/lib/public/User.php diff --git a/lib/public/userinterface.php b/lib/public/UserInterface.php index 954c2d68133..954c2d68133 100644 --- a/lib/public/userinterface.php +++ b/lib/public/UserInterface.php diff --git a/lib/public/util.php b/lib/public/Util.php index 45df62ac735..45df62ac735 100644 --- a/lib/public/util.php +++ b/lib/public/Util.php |