diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-09 17:53:57 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-10-09 17:53:57 +0200 |
commit | 926b3c9b7be2c3f0d71a64a60006d373f689da39 (patch) | |
tree | 20957e2f0454879f73da01d0dea131cb702f3632 /lib | |
parent | 48b5c1d5f934fb4f6c58bf196b81ee8089217e52 (diff) | |
parent | 223adc3167d82d8bcd88b19aae78b1da2773e729 (diff) | |
download | nextcloud-server-926b3c9b7be2c3f0d71a64a60006d373f689da39.tar.gz nextcloud-server-926b3c9b7be2c3f0d71a64a60006d373f689da39.zip |
Merge branch 'master' into activities-api
Diffstat (limited to 'lib')
-rw-r--r-- | lib/apphelper.php | 25 | ||||
-rw-r--r-- | lib/autoloader.php | 11 | ||||
-rw-r--r-- | lib/base.php | 34 | ||||
-rw-r--r-- | lib/l10n/ady.php | 8 | ||||
-rw-r--r-- | lib/l10n/ar.php | 4 | ||||
-rw-r--r-- | lib/l10n/bg_BG.php | 4 | ||||
-rw-r--r-- | lib/l10n/ca.php | 4 | ||||
-rw-r--r-- | lib/l10n/cs_CZ.php | 4 | ||||
-rw-r--r-- | lib/l10n/cy_GB.php | 4 | ||||
-rw-r--r-- | lib/l10n/da.php | 4 | ||||
-rw-r--r-- | lib/l10n/de.php | 4 | ||||
-rw-r--r-- | lib/l10n/de_CH.php | 4 | ||||
-rw-r--r-- | lib/l10n/de_DE.php | 4 | ||||
-rw-r--r-- | lib/l10n/el.php | 4 | ||||
-rw-r--r-- | lib/l10n/en_GB.php | 4 | ||||
-rw-r--r-- | lib/l10n/eo.php | 4 | ||||
-rw-r--r-- | lib/l10n/es.php | 7 | ||||
-rw-r--r-- | lib/l10n/es_AR.php | 4 | ||||
-rw-r--r-- | lib/l10n/et_EE.php | 4 | ||||
-rw-r--r-- | lib/l10n/eu.php | 4 | ||||
-rw-r--r-- | lib/l10n/fa.php | 4 | ||||
-rw-r--r-- | lib/l10n/fi_FI.php | 4 | ||||
-rw-r--r-- | lib/l10n/fr.php | 4 | ||||
-rw-r--r-- | lib/l10n/gl.php | 4 | ||||
-rw-r--r-- | lib/l10n/he.php | 4 | ||||
-rw-r--r-- | lib/l10n/hu_HU.php | 11 | ||||
-rw-r--r-- | lib/l10n/id.php | 4 | ||||
-rw-r--r-- | lib/l10n/is.php | 4 | ||||
-rw-r--r-- | lib/l10n/it.php | 4 | ||||
-rw-r--r-- | lib/l10n/ja_JP.php | 4 | ||||
-rw-r--r-- | lib/l10n/ka_GE.php | 4 | ||||
-rw-r--r-- | lib/l10n/ko.php | 8 | ||||
-rw-r--r-- | lib/l10n/lt_LT.php | 4 | ||||
-rw-r--r-- | lib/l10n/lv.php | 4 | ||||
-rw-r--r-- | lib/l10n/mk.php | 5 | ||||
-rw-r--r-- | lib/l10n/my_MM.php | 4 | ||||
-rw-r--r-- | lib/l10n/nb_NO.php | 4 | ||||
-rw-r--r-- | lib/l10n/nl.php | 4 | ||||
-rw-r--r-- | lib/l10n/pl.php | 7 | ||||
-rw-r--r-- | lib/l10n/pt_BR.php | 4 | ||||
-rw-r--r-- | lib/l10n/pt_PT.php | 4 | ||||
-rw-r--r-- | lib/l10n/ro.php | 4 | ||||
-rw-r--r-- | lib/l10n/ru.php | 4 | ||||
-rw-r--r-- | lib/l10n/sk_SK.php | 4 | ||||
-rw-r--r-- | lib/l10n/sl.php | 4 | ||||
-rw-r--r-- | lib/l10n/sq.php | 4 | ||||
-rw-r--r-- | lib/l10n/sr.php | 4 | ||||
-rw-r--r-- | lib/l10n/sv.php | 4 | ||||
-rw-r--r-- | lib/l10n/ta_LK.php | 4 | ||||
-rw-r--r-- | lib/l10n/th_TH.php | 4 | ||||
-rw-r--r-- | lib/l10n/tr.php | 4 | ||||
-rw-r--r-- | lib/l10n/uk.php | 4 | ||||
-rw-r--r-- | lib/l10n/vi.php | 4 | ||||
-rw-r--r-- | lib/l10n/zh_CN.php | 4 | ||||
-rw-r--r-- | lib/l10n/zh_TW.php | 7 | ||||
-rw-r--r-- | lib/private/allconfig.php (renamed from lib/allconfig.php) | 0 | ||||
-rw-r--r-- | lib/private/api.php (renamed from lib/api.php) | 0 | ||||
-rw-r--r-- | lib/private/app.php (renamed from lib/app.php) | 13 | ||||
-rw-r--r-- | lib/private/appconfig.php (renamed from lib/appconfig.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/app.php (renamed from lib/appframework/app.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/controller/controller.php (renamed from lib/appframework/controller/controller.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/core/api.php (renamed from lib/appframework/core/api.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/dependencyinjection/dicontainer.php (renamed from lib/appframework/dependencyinjection/dicontainer.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/http/dispatcher.php (renamed from lib/appframework/http/dispatcher.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/http/downloadresponse.php (renamed from lib/appframework/http/downloadresponse.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/http/http.php (renamed from lib/appframework/http/http.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/http/redirectresponse.php (renamed from lib/appframework/http/redirectresponse.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/http/request.php (renamed from lib/appframework/http/request.php) | 148 | ||||
-rw-r--r-- | lib/private/appframework/middleware/middlewaredispatcher.php (renamed from lib/appframework/middleware/middlewaredispatcher.php) | 2 | ||||
-rw-r--r-- | lib/private/appframework/middleware/security/securityexception.php (renamed from lib/appframework/middleware/security/securityexception.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/middleware/security/securitymiddleware.php (renamed from lib/appframework/middleware/security/securitymiddleware.php) | 2 | ||||
-rw-r--r-- | lib/private/appframework/routing/routeactionhandler.php (renamed from lib/appframework/routing/routeactionhandler.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/routing/routeconfig.php (renamed from lib/appframework/routing/routeconfig.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/utility/methodannotationreader.php (renamed from lib/appframework/utility/methodannotationreader.php) | 0 | ||||
-rw-r--r-- | lib/private/appframework/utility/simplecontainer.php (renamed from lib/appframework/utility/simplecontainer.php) | 2 | ||||
-rw-r--r-- | lib/private/appframework/utility/timefactory.php (renamed from lib/appframework/utility/timefactory.php) | 0 | ||||
-rw-r--r-- | lib/private/archive.php (renamed from lib/archive.php) | 0 | ||||
-rw-r--r-- | lib/private/archive/tar.php (renamed from lib/archive/tar.php) | 0 | ||||
-rw-r--r-- | lib/private/archive/zip.php (renamed from lib/archive/zip.php) | 0 | ||||
-rw-r--r-- | lib/private/arrayparser.php (renamed from lib/arrayparser.php) | 0 | ||||
-rw-r--r-- | lib/private/avatar.php (renamed from lib/avatar.php) | 0 | ||||
-rw-r--r-- | lib/private/backgroundjob.php (renamed from lib/backgroundjob.php) | 0 | ||||
-rw-r--r-- | lib/private/backgroundjob/job.php (renamed from lib/backgroundjob/job.php) | 0 | ||||
-rw-r--r-- | lib/private/backgroundjob/joblist.php (renamed from lib/backgroundjob/joblist.php) | 0 | ||||
-rw-r--r-- | lib/private/backgroundjob/legacy/queuedjob.php (renamed from lib/backgroundjob/legacy/queuedjob.php) | 0 | ||||
-rw-r--r-- | lib/private/backgroundjob/legacy/regularjob.php (renamed from lib/backgroundjob/legacy/regularjob.php) | 0 | ||||
-rw-r--r-- | lib/private/backgroundjob/queuedjob.php (renamed from lib/backgroundjob/queuedjob.php) | 0 | ||||
-rw-r--r-- | lib/private/backgroundjob/timedjob.php (renamed from lib/backgroundjob/timedjob.php) | 0 | ||||
-rw-r--r-- | lib/private/cache.php (renamed from lib/cache.php) | 0 | ||||
-rw-r--r-- | lib/private/cache/broker.php (renamed from lib/cache/broker.php) | 0 | ||||
-rw-r--r-- | lib/private/cache/file.php (renamed from lib/cache/file.php) | 0 | ||||
-rw-r--r-- | lib/private/cache/fileglobal.php (renamed from lib/cache/fileglobal.php) | 0 | ||||
-rw-r--r-- | lib/private/cache/fileglobalgc.php (renamed from lib/cache/fileglobalgc.php) | 0 | ||||
-rw-r--r-- | lib/private/cache/usercache.php (renamed from lib/cache/usercache.php) | 0 | ||||
-rw-r--r-- | lib/private/config.php (renamed from lib/config.php) | 2 | ||||
-rw-r--r-- | lib/private/connector/sabre/ServiceUnavailable.php (renamed from lib/connector/sabre/ServiceUnavailable.php) | 0 | ||||
-rw-r--r-- | lib/private/connector/sabre/aborteduploaddetectionplugin.php | 107 | ||||
-rw-r--r-- | lib/private/connector/sabre/auth.php (renamed from lib/connector/sabre/auth.php) | 5 | ||||
-rw-r--r-- | lib/private/connector/sabre/directory.php (renamed from lib/connector/sabre/directory.php) | 65 | ||||
-rw-r--r-- | lib/private/connector/sabre/file.php (renamed from lib/connector/sabre/file.php) | 76 | ||||
-rw-r--r-- | lib/private/connector/sabre/locks.php (renamed from lib/connector/sabre/locks.php) | 0 | ||||
-rw-r--r-- | lib/private/connector/sabre/maintenanceplugin.php (renamed from lib/connector/sabre/maintenanceplugin.php) | 0 | ||||
-rw-r--r-- | lib/private/connector/sabre/node.php (renamed from lib/connector/sabre/node.php) | 37 | ||||
-rw-r--r-- | lib/private/connector/sabre/objecttree.php (renamed from lib/connector/sabre/objecttree.php) | 47 | ||||
-rw-r--r-- | lib/private/connector/sabre/principal.php (renamed from lib/connector/sabre/principal.php) | 0 | ||||
-rw-r--r-- | lib/private/connector/sabre/quotaplugin.php (renamed from lib/connector/sabre/quotaplugin.php) | 0 | ||||
-rw-r--r-- | lib/private/connector/sabre/request.php (renamed from lib/connector/sabre/request.php) | 0 | ||||
-rw-r--r-- | lib/private/contactsmanager.php (renamed from lib/contactsmanager.php) | 0 | ||||
-rw-r--r-- | lib/private/db.php (renamed from lib/db.php) | 0 | ||||
-rw-r--r-- | lib/private/db/adapter.php (renamed from lib/db/adapter.php) | 0 | ||||
-rw-r--r-- | lib/private/db/adapteroci8.php (renamed from lib/db/adapteroci8.php) | 0 | ||||
-rw-r--r-- | lib/private/db/adapterpgsql.php (renamed from lib/db/adapterpgsql.php) | 0 | ||||
-rw-r--r-- | lib/private/db/adaptersqlite.php (renamed from lib/db/adaptersqlite.php) | 0 | ||||
-rw-r--r-- | lib/private/db/adaptersqlsrv.php (renamed from lib/db/adaptersqlsrv.php) | 0 | ||||
-rw-r--r-- | lib/private/db/connection.php (renamed from lib/db/connection.php) | 0 | ||||
-rw-r--r-- | lib/private/db/mdb2schemamanager.php (renamed from lib/db/mdb2schemamanager.php) | 0 | ||||
-rw-r--r-- | lib/private/db/mdb2schemareader.php (renamed from lib/db/mdb2schemareader.php) | 0 | ||||
-rw-r--r-- | lib/private/db/mdb2schemawriter.php (renamed from lib/db/mdb2schemawriter.php) | 0 | ||||
-rw-r--r-- | lib/private/db/oracleconnection.php (renamed from lib/db/oracleconnection.php) | 0 | ||||
-rw-r--r-- | lib/private/db/statementwrapper.php (renamed from lib/db/statementwrapper.php) | 0 | ||||
-rw-r--r-- | lib/private/defaults.php (renamed from lib/defaults.php) | 5 | ||||
-rw-r--r-- | lib/private/eventsource.php (renamed from lib/eventsource.php) | 0 | ||||
-rw-r--r-- | lib/private/filechunking.php (renamed from lib/filechunking.php) | 0 | ||||
-rw-r--r-- | lib/private/fileproxy.php (renamed from lib/fileproxy.php) | 0 | ||||
-rw-r--r-- | lib/private/fileproxy/fileoperations.php (renamed from lib/fileproxy/fileoperations.php) | 0 | ||||
-rw-r--r-- | lib/private/files.php (renamed from lib/files.php) | 0 | ||||
-rw-r--r-- | lib/private/files/cache/backgroundwatcher.php (renamed from lib/files/cache/backgroundwatcher.php) | 0 | ||||
-rw-r--r-- | lib/private/files/cache/cache.php (renamed from lib/files/cache/cache.php) | 47 | ||||
-rw-r--r-- | lib/private/files/cache/legacy.php (renamed from lib/files/cache/legacy.php) | 0 | ||||
-rw-r--r-- | lib/private/files/cache/permissions.php (renamed from lib/files/cache/permissions.php) | 0 | ||||
-rw-r--r-- | lib/private/files/cache/scanner.php (renamed from lib/files/cache/scanner.php) | 0 | ||||
-rw-r--r-- | lib/private/files/cache/storage.php (renamed from lib/files/cache/storage.php) | 0 | ||||
-rw-r--r-- | lib/private/files/cache/updater.php (renamed from lib/files/cache/updater.php) | 0 | ||||
-rw-r--r-- | lib/private/files/cache/upgrade.php (renamed from lib/files/cache/upgrade.php) | 10 | ||||
-rw-r--r-- | lib/private/files/cache/watcher.php (renamed from lib/files/cache/watcher.php) | 0 | ||||
-rw-r--r-- | lib/private/files/filesystem.php (renamed from lib/files/filesystem.php) | 0 | ||||
-rw-r--r-- | lib/private/files/mapper.php (renamed from lib/files/mapper.php) | 0 | ||||
-rw-r--r-- | lib/private/files/mount/manager.php (renamed from lib/files/mount/manager.php) | 0 | ||||
-rw-r--r-- | lib/private/files/mount/mount.php (renamed from lib/files/mount/mount.php) | 0 | ||||
-rw-r--r-- | lib/private/files/node/file.php (renamed from lib/files/node/file.php) | 0 | ||||
-rw-r--r-- | lib/private/files/node/folder.php (renamed from lib/files/node/folder.php) | 0 | ||||
-rw-r--r-- | lib/private/files/node/node.php (renamed from lib/files/node/node.php) | 0 | ||||
-rw-r--r-- | lib/private/files/node/nonexistingfile.php (renamed from lib/files/node/nonexistingfile.php) | 0 | ||||
-rw-r--r-- | lib/private/files/node/nonexistingfolder.php (renamed from lib/files/node/nonexistingfolder.php) | 0 | ||||
-rw-r--r-- | lib/private/files/node/root.php (renamed from lib/files/node/root.php) | 0 | ||||
-rw-r--r-- | lib/private/files/storage/common.php (renamed from lib/files/storage/common.php) | 0 | ||||
-rw-r--r-- | lib/private/files/storage/commontest.php (renamed from lib/files/storage/commontest.php) | 0 | ||||
-rw-r--r-- | lib/private/files/storage/loader.php (renamed from lib/files/storage/loader.php) | 0 | ||||
-rw-r--r-- | lib/private/files/storage/local.php (renamed from lib/files/storage/local.php) | 0 | ||||
-rw-r--r-- | lib/private/files/storage/mappedlocal.php (renamed from lib/files/storage/mappedlocal.php) | 0 | ||||
-rw-r--r-- | lib/private/files/storage/storage.php (renamed from lib/files/storage/storage.php) | 0 | ||||
-rw-r--r-- | lib/private/files/storage/temporary.php (renamed from lib/files/storage/temporary.php) | 0 | ||||
-rw-r--r-- | lib/private/files/storage/wrapper/quota.php (renamed from lib/files/storage/wrapper/quota.php) | 0 | ||||
-rw-r--r-- | lib/private/files/storage/wrapper/wrapper.php (renamed from lib/files/storage/wrapper/wrapper.php) | 0 | ||||
-rw-r--r-- | lib/private/files/stream/close.php (renamed from lib/files/stream/close.php) | 0 | ||||
-rw-r--r-- | lib/private/files/stream/dir.php (renamed from lib/files/stream/dir.php) | 0 | ||||
-rw-r--r-- | lib/private/files/stream/oc.php (renamed from lib/files/stream/oc.php) | 0 | ||||
-rw-r--r-- | lib/private/files/stream/quota.php (renamed from lib/files/stream/quota.php) | 0 | ||||
-rw-r--r-- | lib/private/files/stream/staticstream.php (renamed from lib/files/stream/staticstream.php) | 0 | ||||
-rw-r--r-- | lib/private/files/type/detection.php (renamed from lib/files/type/detection.php) | 0 | ||||
-rw-r--r-- | lib/private/files/type/templatemanager.php (renamed from lib/files/type/templatemanager.php) | 0 | ||||
-rw-r--r-- | lib/private/files/utils/scanner.php (renamed from lib/files/utils/scanner.php) | 0 | ||||
-rw-r--r-- | lib/private/files/view.php (renamed from lib/files/view.php) | 0 | ||||
-rw-r--r-- | lib/private/geo.php (renamed from lib/geo.php) | 0 | ||||
-rw-r--r-- | lib/private/group.php (renamed from lib/group.php) | 0 | ||||
-rw-r--r-- | lib/private/group/backend.php (renamed from lib/group/backend.php) | 0 | ||||
-rw-r--r-- | lib/private/group/database.php (renamed from lib/group/database.php) | 0 | ||||
-rw-r--r-- | lib/private/group/dummy.php (renamed from lib/group/dummy.php) | 0 | ||||
-rw-r--r-- | lib/private/group/example.php (renamed from lib/group/example.php) | 0 | ||||
-rw-r--r-- | lib/private/group/group.php (renamed from lib/group/group.php) | 0 | ||||
-rw-r--r-- | lib/private/group/interface.php (renamed from lib/group/interface.php) | 0 | ||||
-rw-r--r-- | lib/private/group/manager.php (renamed from lib/group/manager.php) | 0 | ||||
-rw-r--r-- | lib/private/helper.php (renamed from lib/helper.php) | 52 | ||||
-rw-r--r-- | lib/private/hintexception.php (renamed from lib/hintexception.php) | 0 | ||||
-rw-r--r-- | lib/private/hook.php (renamed from lib/hook.php) | 0 | ||||
-rw-r--r-- | lib/private/hooks/basicemitter.php (renamed from lib/hooks/basicemitter.php) | 0 | ||||
-rw-r--r-- | lib/private/hooks/emitter.php (renamed from lib/hooks/emitter.php) | 0 | ||||
-rw-r--r-- | lib/private/hooks/forwardingemitter.php (renamed from lib/hooks/forwardingemitter.php) | 0 | ||||
-rw-r--r-- | lib/private/hooks/legacyemitter.php (renamed from lib/hooks/legacyemitter.php) | 0 | ||||
-rw-r--r-- | lib/private/hooks/publicemitter.php (renamed from lib/hooks/publicemitter.php) | 0 | ||||
-rw-r--r-- | lib/private/image.php (renamed from lib/image.php) | 0 | ||||
-rw-r--r-- | lib/private/installer.php (renamed from lib/installer.php) | 0 | ||||
-rw-r--r-- | lib/private/json.php (renamed from lib/json.php) | 0 | ||||
-rw-r--r-- | lib/private/l10n.php (renamed from lib/l10n.php) | 18 | ||||
-rw-r--r-- | lib/private/l10n/factory.php | 34 | ||||
-rw-r--r-- | lib/private/l10n/string.php (renamed from lib/l10n/string.php) | 0 | ||||
-rw-r--r-- | lib/private/legacy/cache.php (renamed from lib/legacy/cache.php) | 0 | ||||
-rw-r--r-- | lib/private/legacy/cache/fileglobalgc.php | 4 | ||||
-rw-r--r-- | lib/private/legacy/config.php (renamed from lib/legacy/config.php) | 12 | ||||
-rw-r--r-- | lib/private/legacy/filesystem.php (renamed from lib/legacy/filesystem.php) | 0 | ||||
-rw-r--r-- | lib/private/legacy/filesystemview.php (renamed from lib/legacy/filesystemview.php) | 0 | ||||
-rw-r--r-- | lib/private/legacy/log.php (renamed from lib/legacy/log.php) | 0 | ||||
-rw-r--r-- | lib/private/legacy/preferences.php (renamed from lib/legacy/preferences.php) | 0 | ||||
-rw-r--r-- | lib/private/legacy/updater.php (renamed from lib/legacy/updater.php) | 0 | ||||
-rw-r--r-- | lib/private/log.php (renamed from lib/log.php) | 0 | ||||
-rw-r--r-- | lib/private/log/errorhandler.php (renamed from lib/log/errorhandler.php) | 0 | ||||
-rw-r--r-- | lib/private/log/owncloud.php (renamed from lib/log/owncloud.php) | 10 | ||||
-rw-r--r-- | lib/private/log/rotate.php (renamed from lib/log/rotate.php) | 0 | ||||
-rw-r--r-- | lib/private/log/syslog.php (renamed from lib/log/syslog.php) | 0 | ||||
-rw-r--r-- | lib/private/mail.php (renamed from lib/mail.php) | 0 | ||||
-rw-r--r-- | lib/private/memcache/apc.php (renamed from lib/memcache/apc.php) | 0 | ||||
-rw-r--r-- | lib/private/memcache/apcu.php (renamed from lib/memcache/apcu.php) | 0 | ||||
-rw-r--r-- | lib/private/memcache/cache.php (renamed from lib/memcache/cache.php) | 0 | ||||
-rw-r--r-- | lib/private/memcache/factory.php (renamed from lib/memcache/factory.php) | 0 | ||||
-rw-r--r-- | lib/private/memcache/memcached.php (renamed from lib/memcache/memcached.php) | 0 | ||||
-rw-r--r-- | lib/private/memcache/xcache.php (renamed from lib/memcache/xcache.php) | 0 | ||||
-rw-r--r-- | lib/private/migrate.php (renamed from lib/migrate.php) | 0 | ||||
-rw-r--r-- | lib/private/migration/content.php (renamed from lib/migration/content.php) | 0 | ||||
-rw-r--r-- | lib/private/migration/provider.php (renamed from lib/migration/provider.php) | 0 | ||||
-rw-r--r-- | lib/private/mimetypes.list.php (renamed from lib/mimetypes.list.php) | 0 | ||||
-rw-r--r-- | lib/private/minimizer.php (renamed from lib/minimizer.php) | 0 | ||||
-rw-r--r-- | lib/private/minimizer/css.php (renamed from lib/minimizer/css.php) | 0 | ||||
-rw-r--r-- | lib/private/minimizer/js.php (renamed from lib/minimizer/js.php) | 0 | ||||
-rw-r--r-- | lib/private/navigationmanager.php (renamed from lib/navigationmanager.php) | 0 | ||||
-rw-r--r-- | lib/private/notsquareexception.php (renamed from lib/notsquareexception.php) | 0 | ||||
-rw-r--r-- | lib/private/ocs.php (renamed from lib/ocs.php) | 0 | ||||
-rw-r--r-- | lib/private/ocs/cloud.php (renamed from lib/ocs/cloud.php) | 0 | ||||
-rw-r--r-- | lib/private/ocs/config.php (renamed from lib/ocs/config.php) | 0 | ||||
-rw-r--r-- | lib/private/ocs/person.php (renamed from lib/ocs/person.php) | 0 | ||||
-rw-r--r-- | lib/private/ocs/privatedata.php (renamed from lib/ocs/privatedata.php) | 0 | ||||
-rw-r--r-- | lib/private/ocs/result.php (renamed from lib/ocs/result.php) | 0 | ||||
-rw-r--r-- | lib/private/ocsclient.php (renamed from lib/ocsclient.php) | 7 | ||||
-rw-r--r-- | lib/private/preferences.php (renamed from lib/preferences.php) | 0 | ||||
-rwxr-xr-x | lib/private/preview.php (renamed from lib/preview.php) | 0 | ||||
-rw-r--r-- | lib/private/preview/image.php (renamed from lib/preview/image.php) | 0 | ||||
-rw-r--r-- | lib/private/preview/movies.php (renamed from lib/preview/movies.php) | 0 | ||||
-rw-r--r-- | lib/private/preview/mp3.php (renamed from lib/preview/mp3.php) | 0 | ||||
-rw-r--r-- | lib/private/preview/office-cl.php (renamed from lib/preview/office-cl.php) | 0 | ||||
-rw-r--r-- | lib/private/preview/office-fallback.php (renamed from lib/preview/office-fallback.php) | 0 | ||||
-rw-r--r-- | lib/private/preview/office.php (renamed from lib/preview/office.php) | 0 | ||||
-rw-r--r-- | lib/private/preview/pdf.php (renamed from lib/preview/pdf.php) | 0 | ||||
-rw-r--r-- | lib/private/preview/provider.php (renamed from lib/preview/provider.php) | 0 | ||||
-rw-r--r-- | lib/private/preview/svg.php (renamed from lib/preview/svg.php) | 0 | ||||
-rw-r--r-- | lib/private/preview/txt.php (renamed from lib/preview/txt.php) | 10 | ||||
-rw-r--r-- | lib/private/preview/unknown.php (renamed from lib/preview/unknown.php) | 0 | ||||
-rwxr-xr-x | lib/private/previewmanager.php (renamed from lib/previewmanager.php) | 0 | ||||
-rwxr-xr-x | lib/private/request.php (renamed from lib/request.php) | 0 | ||||
-rw-r--r-- | lib/private/response.php (renamed from lib/response.php) | 0 | ||||
-rw-r--r-- | lib/private/route.php (renamed from lib/route.php) | 8 | ||||
-rw-r--r-- | lib/private/router.php (renamed from lib/router.php) | 0 | ||||
-rw-r--r-- | lib/private/search.php (renamed from lib/search.php) | 0 | ||||
-rw-r--r-- | lib/private/search/provider.php (renamed from lib/search/provider.php) | 0 | ||||
-rw-r--r-- | lib/private/search/provider/file.php (renamed from lib/search/provider/file.php) | 0 | ||||
-rw-r--r-- | lib/private/search/result.php (renamed from lib/search/result.php) | 0 | ||||
-rw-r--r-- | lib/private/server.php (renamed from lib/server.php) | 50 | ||||
-rw-r--r-- | lib/private/session/internal.php (renamed from lib/session/internal.php) | 0 | ||||
-rw-r--r-- | lib/private/session/memory.php (renamed from lib/session/memory.php) | 0 | ||||
-rw-r--r-- | lib/private/session/session.php (renamed from lib/session/session.php) | 0 | ||||
-rw-r--r-- | lib/private/setup.php (renamed from lib/setup.php) | 0 | ||||
-rw-r--r-- | lib/private/setup/abstractdatabase.php (renamed from lib/setup/abstractdatabase.php) | 0 | ||||
-rw-r--r-- | lib/private/setup/mssql.php (renamed from lib/setup/mssql.php) | 0 | ||||
-rw-r--r-- | lib/private/setup/mysql.php (renamed from lib/setup/mysql.php) | 0 | ||||
-rw-r--r-- | lib/private/setup/oci.php (renamed from lib/setup/oci.php) | 0 | ||||
-rw-r--r-- | lib/private/setup/postgresql.php (renamed from lib/setup/postgresql.php) | 0 | ||||
-rw-r--r-- | lib/private/setup/sqlite.php (renamed from lib/setup/sqlite.php) | 0 | ||||
-rw-r--r-- | lib/private/subadmin.php (renamed from lib/subadmin.php) | 0 | ||||
-rw-r--r-- | lib/private/tagmanager.php (renamed from lib/tagmanager.php) | 0 | ||||
-rw-r--r-- | lib/private/tags.php (renamed from lib/tags.php) | 0 | ||||
-rw-r--r-- | lib/private/template.php (renamed from lib/template.php) | 0 | ||||
-rw-r--r-- | lib/private/template/base.php (renamed from lib/template/base.php) | 0 | ||||
-rw-r--r-- | lib/private/template/cssresourcelocator.php (renamed from lib/template/cssresourcelocator.php) | 0 | ||||
-rw-r--r-- | lib/private/template/functions.php (renamed from lib/template/functions.php) | 45 | ||||
-rw-r--r-- | lib/private/template/jsresourcelocator.php (renamed from lib/template/jsresourcelocator.php) | 0 | ||||
-rw-r--r-- | lib/private/template/resourcelocator.php (renamed from lib/template/resourcelocator.php) | 0 | ||||
-rw-r--r-- | lib/private/template/templatefilelocator.php (renamed from lib/template/templatefilelocator.php) | 0 | ||||
-rw-r--r-- | lib/private/templatelayout.php (renamed from lib/templatelayout.php) | 0 | ||||
-rw-r--r-- | lib/private/updater.php (renamed from lib/updater.php) | 2 | ||||
-rw-r--r-- | lib/private/user.php (renamed from lib/user.php) | 85 | ||||
-rw-r--r-- | lib/private/user/backend.php (renamed from lib/user/backend.php) | 0 | ||||
-rw-r--r-- | lib/private/user/database.php (renamed from lib/user/database.php) | 0 | ||||
-rw-r--r-- | lib/private/user/dummy.php (renamed from lib/user/dummy.php) | 4 | ||||
-rw-r--r-- | lib/private/user/example.php (renamed from lib/user/example.php) | 0 | ||||
-rw-r--r-- | lib/private/user/http.php (renamed from lib/user/http.php) | 0 | ||||
-rw-r--r-- | lib/private/user/interface.php (renamed from lib/user/interface.php) | 0 | ||||
-rw-r--r-- | lib/private/user/manager.php (renamed from lib/user/manager.php) | 0 | ||||
-rw-r--r-- | lib/private/user/session.php (renamed from lib/user/session.php) | 0 | ||||
-rw-r--r-- | lib/private/user/user.php (renamed from lib/user/user.php) | 0 | ||||
-rwxr-xr-x | lib/private/util.php (renamed from lib/util.php) | 163 | ||||
-rw-r--r-- | lib/private/vobject.php (renamed from lib/vobject.php) | 0 | ||||
-rw-r--r-- | lib/private/vobject/compoundproperty.php (renamed from lib/vobject/compoundproperty.php) | 0 | ||||
-rw-r--r-- | lib/private/vobject/stringproperty.php (renamed from lib/vobject/stringproperty.php) | 0 | ||||
-rw-r--r-- | lib/public/appframework/imiddleware.php | 88 | ||||
-rw-r--r-- | lib/public/appframework/middleware.php (renamed from lib/appframework/middleware/middleware.php) | 2 | ||||
-rw-r--r-- | lib/public/authentication/iapachebackend.php | 49 | ||||
-rw-r--r-- | lib/public/ihelper.php | 23 | ||||
-rw-r--r-- | lib/public/il10n.php | 67 | ||||
-rw-r--r-- | lib/public/irequest.php | 31 | ||||
-rw-r--r-- | lib/public/iservercontainer.php | 17 | ||||
-rw-r--r-- | lib/public/iurlgenerator.php | 47 | ||||
-rw-r--r-- | lib/public/share.php | 90 | ||||
-rw-r--r-- | lib/public/template.php | 4 | ||||
-rw-r--r-- | lib/urlgenerator.php | 111 |
292 files changed, 1411 insertions, 493 deletions
diff --git a/lib/apphelper.php b/lib/apphelper.php new file mode 100644 index 00000000000..bd02f3aabfa --- /dev/null +++ b/lib/apphelper.php @@ -0,0 +1,25 @@ +<?php +/** + * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + * + */ + +namespace OC; + +/** + * TODO: Description + */ +class AppHelper implements \OCP\IHelper { + /** + * Gets the content of an URL by using CURL or a fallback if it is not + * installed + * @param string $url the url that should be fetched + * @return string the content of the webpage + */ + public function getUrlContent($url) { + return \OC_Util::getUrlContent($url); + } +} diff --git a/lib/autoloader.php b/lib/autoloader.php index 01841f831be..b5b58918372 100644 --- a/lib/autoloader.php +++ b/lib/autoloader.php @@ -73,9 +73,10 @@ class Autoloader { } } elseif (strpos($class, 'OC_') === 0) { // first check for legacy classes if underscores are used - $paths[] = 'legacy/' . strtolower(str_replace('_', '/', substr($class, 3)) . '.php'); - $paths[] = strtolower(str_replace('_', '/', substr($class, 3)) . '.php'); + $paths[] = 'private/legacy/' . strtolower(str_replace('_', '/', substr($class, 3)) . '.php'); + $paths[] = 'private/' . strtolower(str_replace('_', '/', substr($class, 3)) . '.php'); } elseif (strpos($class, 'OC\\') === 0) { + $paths[] = 'private/' . strtolower(str_replace('\\', '/', substr($class, 3)) . '.php'); $paths[] = strtolower(str_replace('\\', '/', substr($class, 3)) . '.php'); } elseif (strpos($class, 'OCP\\') === 0) { $paths[] = 'public/' . strtolower(str_replace('\\', '/', substr($class, 4)) . '.php'); @@ -117,7 +118,11 @@ class Autoloader { // Does this PHP have an in-memory cache? We cache the paths there if ($this->constructingMemoryCache && !$this->memoryCache) { $this->constructingMemoryCache = false; - $this->memoryCache = \OC\Memcache\Factory::createLowLatency('Autoloader'); + try { + $this->memoryCache = \OC\Memcache\Factory::createLowLatency('Autoloader'); + } catch(\Exception $ex) { + // no caching then - fine with me + } } if ($this->memoryCache) { $pathsToRequire = $this->memoryCache->get($class); diff --git a/lib/base.php b/lib/base.php index 58894be03ee..b0b2dca502f 100644 --- a/lib/base.php +++ b/lib/base.php @@ -164,7 +164,7 @@ class OC { // set the right include path set_include_path( - OC::$SERVERROOT . '/lib' . PATH_SEPARATOR . + OC::$SERVERROOT . '/lib/private' . PATH_SEPARATOR . OC::$SERVERROOT . '/config' . PATH_SEPARATOR . OC::$THIRDPARTYROOT . '/3rdparty' . PATH_SEPARATOR . implode($paths, PATH_SEPARATOR) . PATH_SEPARATOR . @@ -489,6 +489,11 @@ class OC { if (isset($_SERVER['PHP_AUTH_USER']) && self::$session->exists('user_id') && $_SERVER['PHP_AUTH_USER'] != self::$session->get('user_id')) { + $sessionUser = self::$session->get('user_id'); + $serverUser = $_SERVER['PHP_AUTH_USER']; + OC_Log::write('core', + "Session user-id ($sessionUser) doesn't match SERVER[PHP_AUTH_USER] ($serverUser).", + OC_Log::WARN); OC_User::logout(); } @@ -743,11 +748,17 @@ class OC { protected static function handleLogin() { OC_App::loadApps(array('prelogin')); $error = array(); + + // auth possible via apache module? + if (OC::tryApacheAuth()) { + $error[] = 'apacheauthfailed'; + } // remember was checked after last login - if (OC::tryRememberLogin()) { + elseif (OC::tryRememberLogin()) { $error[] = 'invalidcookie'; - // Someone wants to log in : - } elseif (OC::tryFormLogin()) { + } + // logon via web form + elseif (OC::tryFormLogin()) { $error[] = 'invalidpassword'; } @@ -765,11 +776,26 @@ class OC { } } + protected static function tryApacheAuth() { + $return = OC_User::handleApacheAuth(); + + // if return is true we are logged in -> redirect to the default page + if ($return === true) { + $_REQUEST['redirect_url'] = \OC_Request::requestUri(); + OC_Util::redirectToDefaultPage(); + exit; + } + + // in case $return is null apache based auth is not enabled + return is_null($return) ? false : true; + } + protected static function tryRememberLogin() { if (!isset($_COOKIE["oc_remember_login"]) || !isset($_COOKIE["oc_token"]) || !isset($_COOKIE["oc_username"]) || !$_COOKIE["oc_remember_login"] + || !OC_Util::rememberLoginAllowed() ) { return false; } diff --git a/lib/l10n/ady.php b/lib/l10n/ady.php new file mode 100644 index 00000000000..15f78e0bce6 --- /dev/null +++ b/lib/l10n/ady.php @@ -0,0 +1,8 @@ +<?php +$TRANSLATIONS = array( +"_%n minute ago_::_%n minutes ago_" => array("",""), +"_%n hour ago_::_%n hours ago_" => array("",""), +"_%n day go_::_%n days ago_" => array("",""), +"_%n month ago_::_%n months ago_" => array("","") +); +$PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/ar.php b/lib/l10n/ar.php index f626dcdfda6..6870c549940 100644 --- a/lib/l10n/ar.php +++ b/lib/l10n/ar.php @@ -35,6 +35,7 @@ $TRANSLATIONS = array( "Set an admin password." => "اعداد كلمة مرور للمدير", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "اعدادات خادمك غير صحيحة بشكل تسمح لك بمزامنة ملفاتك وذلك بسبب أن واجهة WebDAV تبدو معطلة", "Please double check the <a href='%s'>installation guides</a>." => "الرجاء التحقق من <a href='%s'>دليل التنصيب</a>.", +"Could not find category \"%s\"" => "تعذر العثور على المجلد \"%s\"", "seconds ago" => "منذ ثواني", "_%n minute ago_::_%n minutes ago_" => array("","","","","",""), "_%n hour ago_::_%n hours ago_" => array("","","","","",""), @@ -44,7 +45,6 @@ $TRANSLATIONS = array( "last month" => "الشهر الماضي", "_%n month ago_::_%n months ago_" => array("","","","","",""), "last year" => "السنةالماضية", -"years ago" => "سنة مضت", -"Could not find category \"%s\"" => "تعذر العثور على المجلد \"%s\"" +"years ago" => "سنة مضت" ); $PLURAL_FORMS = "nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;"; diff --git a/lib/l10n/bg_BG.php b/lib/l10n/bg_BG.php index b6cc949eb8a..c9de3d64d89 100644 --- a/lib/l10n/bg_BG.php +++ b/lib/l10n/bg_BG.php @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Въведете парола за администратор.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Вашият web сървър все още не е удачно настроен да позволява синхронизация на файлове, защото WebDAV интерфейсът изглежда не работи.", "Please double check the <a href='%s'>installation guides</a>." => "Моля направете повторна справка с <a href='%s'>ръководството за инсталиране</a>.", +"Could not find category \"%s\"" => "Невъзможно откриване на категорията \"%s\"", "seconds ago" => "преди секунди", "_%n minute ago_::_%n minutes ago_" => array("",""), "_%n hour ago_::_%n hours ago_" => array("",""), @@ -45,7 +46,6 @@ $TRANSLATIONS = array( "last month" => "последният месец", "_%n month ago_::_%n months ago_" => array("",""), "last year" => "последната година", -"years ago" => "последните години", -"Could not find category \"%s\"" => "Невъзможно откриване на категорията \"%s\"" +"years ago" => "последните години" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/ca.php b/lib/l10n/ca.php index a8769224705..fef5dc3cb22 100644 --- a/lib/l10n/ca.php +++ b/lib/l10n/ca.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Establiu una contrasenya per l'administrador.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "El servidor web no està configurat correctament per permetre la sincronització de fitxers perquè la interfície WebDAV sembla no funcionar correctament.", "Please double check the <a href='%s'>installation guides</a>." => "Comproveu les <a href='%s'>guies d'instal·lació</a>.", +"Could not find category \"%s\"" => "No s'ha trobat la categoria \"%s\"", "seconds ago" => "segons enrere", "_%n minute ago_::_%n minutes ago_" => array("fa %n minut","fa %n minuts"), "_%n hour ago_::_%n hours ago_" => array("fa %n hora","fa %n hores"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("fa %n mes","fa %n mesos"), "last year" => "l'any passat", "years ago" => "anys enrere", -"Caused by:" => "Provocat per:", -"Could not find category \"%s\"" => "No s'ha trobat la categoria \"%s\"" +"Caused by:" => "Provocat per:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/cs_CZ.php b/lib/l10n/cs_CZ.php index ed31ae79529..145078c0bd2 100644 --- a/lib/l10n/cs_CZ.php +++ b/lib/l10n/cs_CZ.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Zadejte heslo správce.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Váš webový server není správně nastaven pro umožnění synchronizace, rozhraní WebDAV se zdá být rozbité.", "Please double check the <a href='%s'>installation guides</a>." => "Zkonzultujte, prosím, <a href='%s'>průvodce instalací</a>.", +"Could not find category \"%s\"" => "Nelze nalézt kategorii \"%s\"", "seconds ago" => "před pár sekundami", "_%n minute ago_::_%n minutes ago_" => array("před %n minutou","před %n minutami","před %n minutami"), "_%n hour ago_::_%n hours ago_" => array("před %n hodinou","před %n hodinami","před %n hodinami"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("před %n měsícem","před %n měsíci","před %n měsíci"), "last year" => "minulý rok", "years ago" => "před lety", -"Caused by:" => "Příčina:", -"Could not find category \"%s\"" => "Nelze nalézt kategorii \"%s\"" +"Caused by:" => "Příčina:" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/lib/l10n/cy_GB.php b/lib/l10n/cy_GB.php index 6973b51878f..0a52f5df776 100644 --- a/lib/l10n/cy_GB.php +++ b/lib/l10n/cy_GB.php @@ -35,6 +35,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Gosod cyfrinair y gweinyddwr.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Nid yw eich gweinydd wedi'i gyflunio eto i ganiatáu cydweddu ffeiliau oherwydd bod y rhyngwyneb WebDAV wedi torri.", "Please double check the <a href='%s'>installation guides</a>." => "Gwiriwch y <a href='%s'>canllawiau gosod</a> eto.", +"Could not find category \"%s\"" => "Methu canfod categori \"%s\"", "seconds ago" => "eiliad yn ôl", "_%n minute ago_::_%n minutes ago_" => array("","","",""), "_%n hour ago_::_%n hours ago_" => array("","","",""), @@ -44,7 +45,6 @@ $TRANSLATIONS = array( "last month" => "mis diwethaf", "_%n month ago_::_%n months ago_" => array("","","",""), "last year" => "y llynedd", -"years ago" => "blwyddyn yn ôl", -"Could not find category \"%s\"" => "Methu canfod categori \"%s\"" +"years ago" => "blwyddyn yn ôl" ); $PLURAL_FORMS = "nplurals=4; plural=(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3;"; diff --git a/lib/l10n/da.php b/lib/l10n/da.php index 05a43f42ed9..e4734755ae0 100644 --- a/lib/l10n/da.php +++ b/lib/l10n/da.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Angiv et admin kodeord.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Din webserver er endnu ikke sat op til at tillade fil synkronisering fordi WebDAV grænsefladen virker ødelagt.", "Please double check the <a href='%s'>installation guides</a>." => "Dobbelttjek venligst <a href='%s'>installations vejledningerne</a>.", +"Could not find category \"%s\"" => "Kunne ikke finde kategorien \"%s\"", "seconds ago" => "sekunder siden", "_%n minute ago_::_%n minutes ago_" => array("%n minut siden","%n minutter siden"), "_%n hour ago_::_%n hours ago_" => array("%n time siden","%n timer siden"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("%n måned siden","%n måneder siden"), "last year" => "sidste år", "years ago" => "år siden", -"Caused by:" => "Forårsaget af:", -"Could not find category \"%s\"" => "Kunne ikke finde kategorien \"%s\"" +"Caused by:" => "Forårsaget af:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/de.php b/lib/l10n/de.php index 87e7a67b47b..136cdc6476f 100644 --- a/lib/l10n/de.php +++ b/lib/l10n/de.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Setze Administrator Passwort", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Dein Web-Server ist noch nicht für Datei-Synchronisation bereit, weil die WebDAV-Schnittstelle vermutlich defekt ist.", "Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfe die <a href='%s'>Installationsanleitungen</a>.", +"Could not find category \"%s\"" => "Die Kategorie \"%s\" konnte nicht gefunden werden.", "seconds ago" => "Gerade eben", "_%n minute ago_::_%n minutes ago_" => array("","Vor %n Minuten"), "_%n hour ago_::_%n hours ago_" => array("","Vor %n Stunden"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("","Vor %n Monaten"), "last year" => "Letztes Jahr", "years ago" => "Vor Jahren", -"Caused by:" => "Verursacht durch:", -"Could not find category \"%s\"" => "Die Kategorie \"%s\" konnte nicht gefunden werden." +"Caused by:" => "Verursacht durch:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/de_CH.php b/lib/l10n/de_CH.php index 33f3446a693..c4f06520b50 100644 --- a/lib/l10n/de_CH.php +++ b/lib/l10n/de_CH.php @@ -43,6 +43,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Setze Administrator Passwort", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ihr Web-Server ist noch nicht für eine Datei-Synchronisation konfiguriert, weil die WebDAV-Schnittstelle vermutlich defekt ist.", "Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfen Sie die <a href='%s'>Installationsanleitungen</a>.", +"Could not find category \"%s\"" => "Die Kategorie «%s» konnte nicht gefunden werden.", "seconds ago" => "Gerade eben", "_%n minute ago_::_%n minutes ago_" => array("","Vor %n Minuten"), "_%n hour ago_::_%n hours ago_" => array("","Vor %n Stunden"), @@ -53,7 +54,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("","Vor %n Monaten"), "last year" => "Letztes Jahr", "years ago" => "Vor Jahren", -"Caused by:" => "Verursacht durch:", -"Could not find category \"%s\"" => "Die Kategorie «%s» konnte nicht gefunden werden." +"Caused by:" => "Verursacht durch:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/de_DE.php b/lib/l10n/de_DE.php index 09be0eea22d..76f0ee8457e 100644 --- a/lib/l10n/de_DE.php +++ b/lib/l10n/de_DE.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Setze Administrator Passwort", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ihr Web-Server ist noch nicht für eine Datei-Synchronisation konfiguriert, weil die WebDAV-Schnittstelle vermutlich defekt ist.", "Please double check the <a href='%s'>installation guides</a>." => "Bitte prüfen Sie die <a href='%s'>Installationsanleitungen</a>.", +"Could not find category \"%s\"" => "Die Kategorie \"%s\" konnte nicht gefunden werden.", "seconds ago" => "Gerade eben", "_%n minute ago_::_%n minutes ago_" => array("Vor %n Minute","Vor %n Minuten"), "_%n hour ago_::_%n hours ago_" => array("Vor %n Stunde","Vor %n Stunden"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("Vor %n Monat","Vor %n Monaten"), "last year" => "Letztes Jahr", "years ago" => "Vor Jahren", -"Caused by:" => "Verursacht durch:", -"Could not find category \"%s\"" => "Die Kategorie \"%s\" konnte nicht gefunden werden." +"Caused by:" => "Verursacht durch:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/el.php b/lib/l10n/el.php index dcbf82d4a4b..7f74dafca74 100644 --- a/lib/l10n/el.php +++ b/lib/l10n/el.php @@ -39,6 +39,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Εισάγετε συνθηματικό διαχειριστή.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ο διακομιστής σας δεν έχει ρυθμιστεί κατάλληλα ώστε να επιτρέπει τον συγχρονισμό αρχείων γιατί η διεπαφή WebDAV πιθανόν να είναι κατεστραμμένη.", "Please double check the <a href='%s'>installation guides</a>." => "Ελέγξτε ξανά τις <a href='%s'>οδηγίες εγκατάστασης</a>.", +"Could not find category \"%s\"" => "Αδυναμία εύρεσης κατηγορίας \"%s\"", "seconds ago" => "δευτερόλεπτα πριν", "_%n minute ago_::_%n minutes ago_" => array("",""), "_%n hour ago_::_%n hours ago_" => array("",""), @@ -49,7 +50,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("",""), "last year" => "τελευταίο χρόνο", "years ago" => "χρόνια πριν", -"Caused by:" => "Προκλήθηκε από:", -"Could not find category \"%s\"" => "Αδυναμία εύρεσης κατηγορίας \"%s\"" +"Caused by:" => "Προκλήθηκε από:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/en_GB.php b/lib/l10n/en_GB.php index d02f553eda8..26d44f39893 100644 --- a/lib/l10n/en_GB.php +++ b/lib/l10n/en_GB.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Set an admin password.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Your web server is not yet properly setup to allow files synchronisation because the WebDAV interface seems to be broken.", "Please double check the <a href='%s'>installation guides</a>." => "Please double check the <a href='%s'>installation guides</a>.", +"Could not find category \"%s\"" => "Could not find category \"%s\"", "seconds ago" => "seconds ago", "_%n minute ago_::_%n minutes ago_" => array("%n minute ago","%n minutes ago"), "_%n hour ago_::_%n hours ago_" => array("%n hour ago","%n hours ago"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("%n month ago","%n months ago"), "last year" => "last year", "years ago" => "years ago", -"Caused by:" => "Caused by:", -"Could not find category \"%s\"" => "Could not find category \"%s\"" +"Caused by:" => "Caused by:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/eo.php b/lib/l10n/eo.php index 5311dd6eb15..53d1ec1854d 100644 --- a/lib/l10n/eo.php +++ b/lib/l10n/eo.php @@ -33,6 +33,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Starigi administran pasvorton.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Via TTT-servilo ankoraŭ ne ĝuste agordiĝis por permesi sinkronigi dosierojn ĉar la WebDAV-interfaco ŝajnas rompita.", "Please double check the <a href='%s'>installation guides</a>." => "Bonvolu duoble kontroli la <a href='%s'>gvidilon por instalo</a>.", +"Could not find category \"%s\"" => "Ne troviĝis kategorio “%s”", "seconds ago" => "sekundoj antaŭe", "_%n minute ago_::_%n minutes ago_" => array("",""), "_%n hour ago_::_%n hours ago_" => array("",""), @@ -42,7 +43,6 @@ $TRANSLATIONS = array( "last month" => "lastamonate", "_%n month ago_::_%n months ago_" => array("",""), "last year" => "lastajare", -"years ago" => "jaroj antaŭe", -"Could not find category \"%s\"" => "Ne troviĝis kategorio “%s”" +"years ago" => "jaroj antaŭe" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/es.php b/lib/l10n/es.php index 047d5d955bb..289ef360d1c 100644 --- a/lib/l10n/es.php +++ b/lib/l10n/es.php @@ -8,6 +8,9 @@ $TRANSLATIONS = array( "Users" => "Usuarios", "Admin" => "Administración", "Failed to upgrade \"%s\"." => "Falló la actualización \"%s\".", +"Custom profile pictures don't work with encryption yet" => "Las imágenes de perfil personalizadas no funcionan con el cifrado aún", +"Unknown filetype" => "Tipo de archivo desconocido", +"Invalid image" => "Imagen inválida", "web services under your control" => "Servicios web bajo su control", "cannot open \"%s\"" => "No se puede abrir \"%s\"", "ZIP download is turned off." => "La descarga en ZIP está desactivada.", @@ -53,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Configurar la contraseña del administrador.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Su servidor web aún no está configurado adecuadamente para permitir sincronización de archivos ya que la interfaz WebDAV parece no estar funcionando.", "Please double check the <a href='%s'>installation guides</a>." => "Por favor, vuelva a comprobar las <a href='%s'>guías de instalación</a>.", +"Could not find category \"%s\"" => "No puede encontrar la categoria \"%s\"", "seconds ago" => "hace segundos", "_%n minute ago_::_%n minutes ago_" => array("Hace %n minuto","Hace %n minutos"), "_%n hour ago_::_%n hours ago_" => array("Hace %n hora","Hace %n horas"), @@ -63,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("Hace %n mes","Hace %n meses"), "last year" => "año pasado", "years ago" => "hace años", -"Caused by:" => "Causado por:", -"Could not find category \"%s\"" => "No puede encontrar la categoria \"%s\"" +"Caused by:" => "Causado por:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/es_AR.php b/lib/l10n/es_AR.php index f637eb403ed..668c46b7b10 100644 --- a/lib/l10n/es_AR.php +++ b/lib/l10n/es_AR.php @@ -53,6 +53,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Configurar una contraseña de administrador.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Tu servidor web no está configurado todavía para permitir sincronización de archivos porque la interfaz WebDAV parece no funcionar.", "Please double check the <a href='%s'>installation guides</a>." => "Por favor, comprobá nuevamente la <a href='%s'>guía de instalación</a>.", +"Could not find category \"%s\"" => "No fue posible encontrar la categoría \"%s\"", "seconds ago" => "segundos atrás", "_%n minute ago_::_%n minutes ago_" => array("Hace %n minuto","Hace %n minutos"), "_%n hour ago_::_%n hours ago_" => array("Hace %n hora","Hace %n horas"), @@ -63,7 +64,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("Hace %n mes","Hace %n meses"), "last year" => "el año pasado", "years ago" => "años atrás", -"Caused by:" => "Provocado por:", -"Could not find category \"%s\"" => "No fue posible encontrar la categoría \"%s\"" +"Caused by:" => "Provocado por:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/et_EE.php b/lib/l10n/et_EE.php index 85dfaeb52d5..c1881141636 100644 --- a/lib/l10n/et_EE.php +++ b/lib/l10n/et_EE.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Määra admini parool.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Veebiserveri ei ole veel korralikult seadistatud võimaldamaks failide sünkroniseerimist, kuna WebDAV liides näib olevat mittetoimiv.", "Please double check the <a href='%s'>installation guides</a>." => "Palun tutvu veelkord <a href='%s'>paigalduse juhenditega</a>.", +"Could not find category \"%s\"" => "Ei leia kategooriat \"%s\"", "seconds ago" => "sekundit tagasi", "_%n minute ago_::_%n minutes ago_" => array("","%n minutit tagasi"), "_%n hour ago_::_%n hours ago_" => array("","%n tundi tagasi"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("","%n kuud tagasi"), "last year" => "viimasel aastal", "years ago" => "aastat tagasi", -"Caused by:" => "Põhjustaja:", -"Could not find category \"%s\"" => "Ei leia kategooriat \"%s\"" +"Caused by:" => "Põhjustaja:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/eu.php b/lib/l10n/eu.php index 413819f4f94..9758fdd1f32 100644 --- a/lib/l10n/eu.php +++ b/lib/l10n/eu.php @@ -39,6 +39,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Ezarri administraziorako pasahitza.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Zure web zerbitzaria ez dago oraindik ongi konfiguratuta fitxategien sinkronizazioa egiteko, WebDAV interfazea ongi ez dagoela dirudi.", "Please double check the <a href='%s'>installation guides</a>." => "Mesedez begiratu <a href='%s'>instalazio gidak</a>.", +"Could not find category \"%s\"" => "Ezin da \"%s\" kategoria aurkitu", "seconds ago" => "segundu", "_%n minute ago_::_%n minutes ago_" => array("orain dela minutu %n","orain dela %n minutu"), "_%n hour ago_::_%n hours ago_" => array("orain dela ordu %n","orain dela %n ordu"), @@ -49,7 +50,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("orain dela hilabete %n","orain dela %n hilabete"), "last year" => "joan den urtean", "years ago" => "urte", -"Caused by:" => "Honek eraginda:", -"Could not find category \"%s\"" => "Ezin da \"%s\" kategoria aurkitu" +"Caused by:" => "Honek eraginda:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/fa.php b/lib/l10n/fa.php index e9cb695bade..788b3703966 100644 --- a/lib/l10n/fa.php +++ b/lib/l10n/fa.php @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Set an admin password." => "یک رمزعبور برای مدیر تنظیم نمایید.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "احتمالاً وب سرور شما طوری تنظیم نشده است که اجازه ی همگام سازی فایلها را بدهد زیرا به نظر میرسد رابط WebDAV از کار افتاده است.", "Please double check the <a href='%s'>installation guides</a>." => "لطفاً دوباره <a href='%s'>راهنمای نصب</a>را بررسی کنید.", +"Could not find category \"%s\"" => "دسته بندی %s یافت نشد", "seconds ago" => "ثانیهها پیش", "_%n minute ago_::_%n minutes ago_" => array(""), "_%n hour ago_::_%n hours ago_" => array(""), @@ -45,7 +46,6 @@ $TRANSLATIONS = array( "last month" => "ماه قبل", "_%n month ago_::_%n months ago_" => array(""), "last year" => "سال قبل", -"years ago" => "سالهای قبل", -"Could not find category \"%s\"" => "دسته بندی %s یافت نشد" +"years ago" => "سالهای قبل" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/fi_FI.php b/lib/l10n/fi_FI.php index 1d2bdab749c..5e9a9a1a1f3 100644 --- a/lib/l10n/fi_FI.php +++ b/lib/l10n/fi_FI.php @@ -46,6 +46,7 @@ $TRANSLATIONS = array( "Set an admin username." => "Aseta ylläpitäjän käyttäjätunnus.", "Set an admin password." => "Aseta ylläpitäjän salasana.", "Please double check the <a href='%s'>installation guides</a>." => "Lue tarkasti <a href='%s'>asennusohjeet</a>.", +"Could not find category \"%s\"" => "Luokkaa \"%s\" ei löytynyt", "seconds ago" => "sekuntia sitten", "_%n minute ago_::_%n minutes ago_" => array("%n minuutti sitten","%n minuuttia sitten"), "_%n hour ago_::_%n hours ago_" => array("%n tunti sitten","%n tuntia sitten"), @@ -56,7 +57,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("%n kuukausi sitten","%n kuukautta sitten"), "last year" => "viime vuonna", "years ago" => "vuotta sitten", -"Caused by:" => "Aiheuttaja:", -"Could not find category \"%s\"" => "Luokkaa \"%s\" ei löytynyt" +"Caused by:" => "Aiheuttaja:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/fr.php b/lib/l10n/fr.php index ab3d618849e..73cb724a58a 100644 --- a/lib/l10n/fr.php +++ b/lib/l10n/fr.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Spécifiez un mot de passe administrateur.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Votre serveur web, n'est pas correctement configuré pour permettre la synchronisation des fichiers, car l'interface WebDav ne fonctionne pas comme il faut.", "Please double check the <a href='%s'>installation guides</a>." => "Veuillez vous référer au <a href='%s'>guide d'installation</a>.", +"Could not find category \"%s\"" => "Impossible de trouver la catégorie \"%s\"", "seconds ago" => "il y a quelques secondes", "_%n minute ago_::_%n minutes ago_" => array("","il y a %n minutes"), "_%n hour ago_::_%n hours ago_" => array("","Il y a %n heures"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("","Il y a %n mois"), "last year" => "l'année dernière", "years ago" => "il y a plusieurs années", -"Caused by:" => "Causé par :", -"Could not find category \"%s\"" => "Impossible de trouver la catégorie \"%s\"" +"Caused by:" => "Causé par :" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/lib/l10n/gl.php b/lib/l10n/gl.php index 406272d690f..ce3c7ecf488 100644 --- a/lib/l10n/gl.php +++ b/lib/l10n/gl.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Estabeleza un contrasinal de administrador", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "O seu servidor web non está aínda configurado adecuadamente para permitir a sincronización de ficheiros xa que semella que a interface WebDAV non está a funcionar.", "Please double check the <a href='%s'>installation guides</a>." => "Volva comprobar as <a href='%s'>guías de instalación</a>", +"Could not find category \"%s\"" => "Non foi posíbel atopar a categoría «%s»", "seconds ago" => "segundos atrás", "_%n minute ago_::_%n minutes ago_" => array("hai %n minuto","hai %n minutos"), "_%n hour ago_::_%n hours ago_" => array("hai %n hora","hai %n horas"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("hai %n mes","hai %n meses"), "last year" => "último ano", "years ago" => "anos atrás", -"Caused by:" => "Causado por:", -"Could not find category \"%s\"" => "Non foi posíbel atopar a categoría «%s»" +"Caused by:" => "Causado por:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/he.php b/lib/l10n/he.php index ced6244ee91..5bbfffe9ae9 100644 --- a/lib/l10n/he.php +++ b/lib/l10n/he.php @@ -18,6 +18,7 @@ $TRANSLATIONS = array( "Images" => "תמונות", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "שרת האינטרנט שלך אינו מוגדר לצורכי סנכרון קבצים עדיין כיוון שמנשק ה־WebDAV כנראה אינו תקין.", "Please double check the <a href='%s'>installation guides</a>." => "נא לעיין שוב ב<a href='%s'>מדריכי ההתקנה</a>.", +"Could not find category \"%s\"" => "לא ניתן למצוא את הקטגוריה „%s“", "seconds ago" => "שניות", "_%n minute ago_::_%n minutes ago_" => array("","לפני %n דקות"), "_%n hour ago_::_%n hours ago_" => array("","לפני %n שעות"), @@ -27,7 +28,6 @@ $TRANSLATIONS = array( "last month" => "חודש שעבר", "_%n month ago_::_%n months ago_" => array("","לפני %n חודשים"), "last year" => "שנה שעברה", -"years ago" => "שנים", -"Could not find category \"%s\"" => "לא ניתן למצוא את הקטגוריה „%s“" +"years ago" => "שנים" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/hu_HU.php b/lib/l10n/hu_HU.php index 7ec7621a655..e944291caee 100644 --- a/lib/l10n/hu_HU.php +++ b/lib/l10n/hu_HU.php @@ -1,11 +1,14 @@ <?php $TRANSLATIONS = array( +"No app name specified" => "Nincs az alkalmazás név megadva.", "Help" => "Súgó", "Personal" => "Személyes", "Settings" => "Beállítások", "Users" => "Felhasználók", "Admin" => "Adminsztráció", "Failed to upgrade \"%s\"." => "Sikertelen Frissítés \"%s\".", +"Unknown filetype" => "Ismeretlen file tipús", +"Invalid image" => "Hibás kép", "web services under your control" => "webszolgáltatások saját kézben", "cannot open \"%s\"" => "nem sikerült megnyitni \"%s\"", "ZIP download is turned off." => "A ZIP-letöltés nincs engedélyezve.", @@ -13,6 +16,10 @@ $TRANSLATIONS = array( "Back to Files" => "Vissza a Fájlokhoz", "Selected files too large to generate zip file." => "A kiválasztott fájlok túl nagyok a zip tömörítéshez.", "Download the files in smaller chunks, seperately or kindly ask your administrator." => "Tölts le a fileokat kisebb chunkokban, kölün vagy kérj segitséget a rendszergazdádtól.", +"App does not provide an info.xml file" => "Az alkalmazás nem szolgáltatott info.xml file-t", +"App can't be installed because it is not compatible with this version of ownCloud" => "Az alalmazás nem telepíthető, mert nem kompatibilis az ownClod ezzel a verziójával.", +"App directory already exists" => "Az alkalmazás mappája már létezik", +"Can't create app folder. Please fix permissions. %s" => "Nem lehetett létrehozni az alkalmzás mappáját. Kérlek ellenőrizd a jogosultásgokat. %s", "Application is not enabled" => "Az alkalmazás nincs engedélyezve", "Authentication error" => "Azonosítási hiba", "Token expired. Please reload page." => "A token lejárt. Frissítse az oldalt.", @@ -39,6 +46,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Állítson be egy jelszót az adminisztrációhoz.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Az Ön webkiszolgálója nincs megfelelően beállítva az állományok szinkronizálásához, mert a WebDAV-elérés úgy tűnik, nem működik.", "Please double check the <a href='%s'>installation guides</a>." => "Kérjük tüzetesen tanulmányozza át a <a href='%s'>telepítési útmutatót</a>.", +"Could not find category \"%s\"" => "Ez a kategória nem található: \"%s\"", "seconds ago" => "pár másodperce", "_%n minute ago_::_%n minutes ago_" => array("",""), "_%n hour ago_::_%n hours ago_" => array("",""), @@ -49,7 +57,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("",""), "last year" => "tavaly", "years ago" => "több éve", -"Caused by:" => "Okozta:", -"Could not find category \"%s\"" => "Ez a kategória nem található: \"%s\"" +"Caused by:" => "Okozta:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/id.php b/lib/l10n/id.php index 080faddb321..0cbcddcc6dd 100644 --- a/lib/l10n/id.php +++ b/lib/l10n/id.php @@ -35,6 +35,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Setel sandi admin.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Web server Anda belum dikonfigurasikan dengan baik untuk mengizinkan sinkronisasi berkas karena tampaknya antarmuka WebDAV rusak.", "Please double check the <a href='%s'>installation guides</a>." => "Silakan periksa ulang <a href='%s'>panduan instalasi</a>.", +"Could not find category \"%s\"" => "Tidak dapat menemukan kategori \"%s\"", "seconds ago" => "beberapa detik yang lalu", "_%n minute ago_::_%n minutes ago_" => array(""), "_%n hour ago_::_%n hours ago_" => array(""), @@ -44,7 +45,6 @@ $TRANSLATIONS = array( "last month" => "bulan kemarin", "_%n month ago_::_%n months ago_" => array(""), "last year" => "tahun kemarin", -"years ago" => "beberapa tahun lalu", -"Could not find category \"%s\"" => "Tidak dapat menemukan kategori \"%s\"" +"years ago" => "beberapa tahun lalu" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/is.php b/lib/l10n/is.php index 7512d278fb8..032289fd304 100644 --- a/lib/l10n/is.php +++ b/lib/l10n/is.php @@ -16,6 +16,7 @@ $TRANSLATIONS = array( "Files" => "Skrár", "Text" => "Texti", "Images" => "Myndir", +"Could not find category \"%s\"" => "Fann ekki flokkinn \"%s\"", "seconds ago" => "sek.", "_%n minute ago_::_%n minutes ago_" => array("",""), "_%n hour ago_::_%n hours ago_" => array("",""), @@ -25,7 +26,6 @@ $TRANSLATIONS = array( "last month" => "síðasta mánuði", "_%n month ago_::_%n months ago_" => array("",""), "last year" => "síðasta ári", -"years ago" => "einhverjum árum", -"Could not find category \"%s\"" => "Fann ekki flokkinn \"%s\"" +"years ago" => "einhverjum árum" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/it.php b/lib/l10n/it.php index b00789bc86f..91efcca7f49 100644 --- a/lib/l10n/it.php +++ b/lib/l10n/it.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Imposta una password di amministrazione.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Il tuo server web non è configurato correttamente per consentire la sincronizzazione dei file poiché l'interfaccia WebDAV sembra essere danneggiata.", "Please double check the <a href='%s'>installation guides</a>." => "Leggi attentamente le <a href='%s'>guide d'installazione</a>.", +"Could not find category \"%s\"" => "Impossibile trovare la categoria \"%s\"", "seconds ago" => "secondi fa", "_%n minute ago_::_%n minutes ago_" => array("%n minuto fa","%n minuti fa"), "_%n hour ago_::_%n hours ago_" => array("%n ora fa","%n ore fa"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("%n mese fa","%n mesi fa"), "last year" => "anno scorso", "years ago" => "anni fa", -"Caused by:" => "Causato da:", -"Could not find category \"%s\"" => "Impossibile trovare la categoria \"%s\"" +"Caused by:" => "Causato da:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/ja_JP.php b/lib/l10n/ja_JP.php index b9e6a0e6924..7023c829f8f 100644 --- a/lib/l10n/ja_JP.php +++ b/lib/l10n/ja_JP.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "管理者のパスワードを設定。", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "WebDAVインタフェースが動作していないと考えられるため、あなたのWEBサーバはまだファイルの同期を許可するように適切な設定がされていません。", "Please double check the <a href='%s'>installation guides</a>." => "<a href='%s'>インストールガイド</a>をよく確認してください。", +"Could not find category \"%s\"" => "カテゴリ \"%s\" が見つかりませんでした", "seconds ago" => "数秒前", "_%n minute ago_::_%n minutes ago_" => array("%n 分前"), "_%n hour ago_::_%n hours ago_" => array("%n 時間後"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("%n カ月後"), "last year" => "一年前", "years ago" => "年前", -"Caused by:" => "原因は以下:", -"Could not find category \"%s\"" => "カテゴリ \"%s\" が見つかりませんでした" +"Caused by:" => "原因は以下:" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/ka_GE.php b/lib/l10n/ka_GE.php index 8fbe34e6786..0cf6ab333e8 100644 --- a/lib/l10n/ka_GE.php +++ b/lib/l10n/ka_GE.php @@ -35,6 +35,7 @@ $TRANSLATIONS = array( "Set an admin password." => "დააყენეთ ადმინისტრატორის პაროლი.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "თქვენი web სერვერი არ არის კონფიგურირებული ფაილ სინქრონიზაციისთვის, რადგან WebDAV ინტერფეისი შეიძლება იყოს გატეხილი.", "Please double check the <a href='%s'>installation guides</a>." => "გთხოვთ გადაათვალიეროთ <a href='%s'>ინსტალაციის გზამკვლევი</a>.", +"Could not find category \"%s\"" => "\"%s\" კატეგორიის მოძებნა ვერ მოხერხდა", "seconds ago" => "წამის წინ", "_%n minute ago_::_%n minutes ago_" => array(""), "_%n hour ago_::_%n hours ago_" => array(""), @@ -44,7 +45,6 @@ $TRANSLATIONS = array( "last month" => "გასულ თვეში", "_%n month ago_::_%n months ago_" => array(""), "last year" => "ბოლო წელს", -"years ago" => "წლის წინ", -"Could not find category \"%s\"" => "\"%s\" კატეგორიის მოძებნა ვერ მოხერხდა" +"years ago" => "წლის წინ" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/ko.php b/lib/l10n/ko.php index eec5be65abd..3ef39fefa60 100644 --- a/lib/l10n/ko.php +++ b/lib/l10n/ko.php @@ -8,12 +8,16 @@ $TRANSLATIONS = array( "Users" => "사용자", "Admin" => "관리자", "Failed to upgrade \"%s\"." => "\"%s\" 업그레이드에 실패했습니다.", +"Custom profile pictures don't work with encryption yet" => "개개인의 프로필 사진은 아직은 암호화 되지 않습니다", +"Unknown filetype" => "알수없는 파일형식", +"Invalid image" => "잘못된 그림", "web services under your control" => "내가 관리하는 웹 서비스", "cannot open \"%s\"" => "\"%s\"을(를) 열 수 없습니다.", "ZIP download is turned off." => "ZIP 다운로드가 비활성화되었습니다.", "Files need to be downloaded one by one." => "파일을 개별적으로 다운로드해야 합니다.", "Back to Files" => "파일로 돌아가기", "Selected files too large to generate zip file." => "선택한 파일들은 ZIP 파일을 생성하기에 너무 큽니다.", +"Download the files in smaller chunks, seperately or kindly ask your administrator." => "작은 조각들 안에 들어있는 파일들을 받고자 하신다면, 나누어서 받으시거나 혹은 시스템 관리자에게 정중하게 물어보십시오", "No source specified when installing app" => "앱을 설치할 때 소스가 지정되지 않았습니다.", "No href specified when installing app from http" => "http에서 앱을 설치할 대 href가 지정되지 않았습니다.", "No path specified when installing app from local file" => "로컬 파일에서 앱을 설치할 때 경로가 지정되지 않았습니다.", @@ -52,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "관리자 비밀번호 설정", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "WebDAV 인터페이스가 제대로 작동하지 않습니다. 웹 서버에서 파일 동기화를 사용할 수 있도록 설정이 제대로 되지 않은 것 같습니다.", "Please double check the <a href='%s'>installation guides</a>." => "<a href='%s'>설치 가이드</a>를 다시 한 번 확인하십시오.", +"Could not find category \"%s\"" => "분류 \"%s\"을(를) 찾을 수 없습니다.", "seconds ago" => "초 전", "_%n minute ago_::_%n minutes ago_" => array("%n분 전 "), "_%n hour ago_::_%n hours ago_" => array("%n시간 전 "), @@ -62,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("%n달 전 "), "last year" => "작년", "years ago" => "년 전", -"Caused by:" => "원인: ", -"Could not find category \"%s\"" => "분류 \"%s\"을(를) 찾을 수 없습니다." +"Caused by:" => "원인: " ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/lt_LT.php b/lib/l10n/lt_LT.php index db8d96c1018..72e84bc4b00 100644 --- a/lib/l10n/lt_LT.php +++ b/lib/l10n/lt_LT.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Nustatyti administratoriaus slaptažodį.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Jūsų serveris nėra tvarkingai nustatytas leisti failų sinchronizaciją, nes WebDAV sąsaja panašu, kad yra sugadinta.", "Please double check the <a href='%s'>installation guides</a>." => "Prašome pažiūrėkite dar kartą <a href='%s'>diegimo instrukcijas</a>.", +"Could not find category \"%s\"" => "Nepavyko rasti kategorijos „%s“", "seconds ago" => "prieš sekundę", "_%n minute ago_::_%n minutes ago_" => array("prieš %n min.","Prieš % minutes","Prieš %n minučių"), "_%n hour ago_::_%n hours ago_" => array("Prieš %n valandą","Prieš %n valandas","Prieš %n valandų"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("Prieš %n mėnesį","Prieš %n mėnesius","Prieš %n mėnesių"), "last year" => "praeitais metais", "years ago" => "prieš metus", -"Caused by:" => "Iššaukė:", -"Could not find category \"%s\"" => "Nepavyko rasti kategorijos „%s“" +"Caused by:" => "Iššaukė:" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/lib/l10n/lv.php b/lib/l10n/lv.php index 4090a36edcc..cf96c4c4ab8 100644 --- a/lib/l10n/lv.php +++ b/lib/l10n/lv.php @@ -39,6 +39,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Iestatiet administratora paroli.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Jūsu serveris vēl nav pareizi iestatīts, lai ļautu sinhronizēt datnes, jo izskatās, ka WebDAV saskarne ir salauzta.", "Please double check the <a href='%s'>installation guides</a>." => "Lūdzu, vēlreiz pārbaudiet <a href='%s'>instalēšanas palīdzību</a>.", +"Could not find category \"%s\"" => "Nevarēja atrast kategoriju “%s”", "seconds ago" => "sekundes atpakaļ", "_%n minute ago_::_%n minutes ago_" => array("","","Pirms %n minūtēm"), "_%n hour ago_::_%n hours ago_" => array("","","Pirms %n stundām"), @@ -49,7 +50,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("","","Pirms %n mēnešiem"), "last year" => "gājušajā gadā", "years ago" => "gadus atpakaļ", -"Caused by:" => "Cēlonis:", -"Could not find category \"%s\"" => "Nevarēja atrast kategoriju “%s”" +"Caused by:" => "Cēlonis:" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);"; diff --git a/lib/l10n/mk.php b/lib/l10n/mk.php index 69d4a1cb694..19e36c868d0 100644 --- a/lib/l10n/mk.php +++ b/lib/l10n/mk.php @@ -5,6 +5,7 @@ $TRANSLATIONS = array( "Settings" => "Подесувања", "Users" => "Корисници", "Admin" => "Админ", +"Invalid image" => "Невалидна фотографија", "web services under your control" => "веб сервиси под Ваша контрола", "ZIP download is turned off." => "Преземање во ZIP е исклучено", "Files need to be downloaded one by one." => "Датотеките треба да се симнат една по една.", @@ -16,6 +17,7 @@ $TRANSLATIONS = array( "Files" => "Датотеки", "Text" => "Текст", "Images" => "Слики", +"Could not find category \"%s\"" => "Не можам да најдам категорија „%s“", "seconds ago" => "пред секунди", "_%n minute ago_::_%n minutes ago_" => array("",""), "_%n hour ago_::_%n hours ago_" => array("",""), @@ -25,7 +27,6 @@ $TRANSLATIONS = array( "last month" => "минатиот месец", "_%n month ago_::_%n months ago_" => array("",""), "last year" => "минатата година", -"years ago" => "пред години", -"Could not find category \"%s\"" => "Не можам да најдам категорија „%s“" +"years ago" => "пред години" ); $PLURAL_FORMS = "nplurals=2; plural=(n % 10 == 1 && n % 100 != 11) ? 0 : 1;"; diff --git a/lib/l10n/my_MM.php b/lib/l10n/my_MM.php index 5f4b6ddc820..7fdf0d0285d 100644 --- a/lib/l10n/my_MM.php +++ b/lib/l10n/my_MM.php @@ -12,6 +12,7 @@ $TRANSLATIONS = array( "Files" => "ဖိုင်များ", "Text" => "စာသား", "Images" => "ပုံရိပ်များ", +"Could not find category \"%s\"" => "\"%s\"ခေါင်းစဉ်ကို ရှာမတွေ့ပါ", "seconds ago" => "စက္ကန့်အနည်းငယ်က", "_%n minute ago_::_%n minutes ago_" => array(""), "_%n hour ago_::_%n hours ago_" => array(""), @@ -21,7 +22,6 @@ $TRANSLATIONS = array( "last month" => "ပြီးခဲ့သောလ", "_%n month ago_::_%n months ago_" => array(""), "last year" => "မနှစ်က", -"years ago" => "နှစ် အရင်က", -"Could not find category \"%s\"" => "\"%s\"ခေါင်းစဉ်ကို ရှာမတွေ့ပါ" +"years ago" => "နှစ် အရင်က" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/nb_NO.php b/lib/l10n/nb_NO.php index 8e7d095d369..eb5e8d766fd 100644 --- a/lib/l10n/nb_NO.php +++ b/lib/l10n/nb_NO.php @@ -18,6 +18,7 @@ $TRANSLATIONS = array( "Images" => "Bilder", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Din nettservev er ikke konfigurert korrekt for filsynkronisering. WebDAV ser ut til å ikke funkere.", "Please double check the <a href='%s'>installation guides</a>." => "Vennligst dobbelsjekk <a href='%s'>installasjonsguiden</a>.", +"Could not find category \"%s\"" => "Kunne ikke finne kategori \"%s\"", "seconds ago" => "sekunder siden", "_%n minute ago_::_%n minutes ago_" => array("",""), "_%n hour ago_::_%n hours ago_" => array("",""), @@ -27,7 +28,6 @@ $TRANSLATIONS = array( "last month" => "forrige måned", "_%n month ago_::_%n months ago_" => array("",""), "last year" => "forrige år", -"years ago" => "år siden", -"Could not find category \"%s\"" => "Kunne ikke finne kategori \"%s\"" +"years ago" => "år siden" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/nl.php b/lib/l10n/nl.php index 20374f1f0f8..d6dc9845d58 100644 --- a/lib/l10n/nl.php +++ b/lib/l10n/nl.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Stel een beheerderswachtwoord in.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Uw webserver is nog niet goed ingesteld voor bestandssynchronisatie omdat de WebDAV interface verbroken lijkt.", "Please double check the <a href='%s'>installation guides</a>." => "Controleer de <a href='%s'>installatiehandleiding</a> goed.", +"Could not find category \"%s\"" => "Kon categorie \"%s\" niet vinden", "seconds ago" => "seconden geleden", "_%n minute ago_::_%n minutes ago_" => array("%n minuut geleden","%n minuten geleden"), "_%n hour ago_::_%n hours ago_" => array("%n uur geleden","%n uur geleden"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("%n maand geleden","%n maanden geleden"), "last year" => "vorig jaar", "years ago" => "jaar geleden", -"Caused by:" => "Gekomen door:", -"Could not find category \"%s\"" => "Kon categorie \"%s\" niet vinden" +"Caused by:" => "Gekomen door:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/pl.php b/lib/l10n/pl.php index 4acd735d692..270559b4e50 100644 --- a/lib/l10n/pl.php +++ b/lib/l10n/pl.php @@ -8,6 +8,9 @@ $TRANSLATIONS = array( "Users" => "Użytkownicy", "Admin" => "Administrator", "Failed to upgrade \"%s\"." => "Błąd przy aktualizacji \"%s\".", +"Custom profile pictures don't work with encryption yet" => "Domyślny profil zdjęć nie działa z szyfrowaniem jeszcze", +"Unknown filetype" => "Nieznany typ pliku", +"Invalid image" => "Błędne zdjęcie", "web services under your control" => "Kontrolowane serwisy", "cannot open \"%s\"" => "Nie można otworzyć \"%s\"", "ZIP download is turned off." => "Pobieranie ZIP jest wyłączone.", @@ -53,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Ustaw hasło administratora.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Serwer internetowy nie jest jeszcze poprawnie skonfigurowany, aby umożliwić synchronizację plików, ponieważ interfejs WebDAV wydaje się być uszkodzony.", "Please double check the <a href='%s'>installation guides</a>." => "Sprawdź ponownie <a href='%s'>przewodniki instalacji</a>.", +"Could not find category \"%s\"" => "Nie można odnaleźć kategorii \"%s\"", "seconds ago" => "sekund temu", "_%n minute ago_::_%n minutes ago_" => array("%n minute temu","%n minut temu","%n minut temu"), "_%n hour ago_::_%n hours ago_" => array("%n godzinę temu","%n godzin temu","%n godzin temu"), @@ -63,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("%n miesiąc temu","%n miesięcy temu","%n miesięcy temu"), "last year" => "w zeszłym roku", "years ago" => "lat temu", -"Caused by:" => "Spowodowane przez:", -"Could not find category \"%s\"" => "Nie można odnaleźć kategorii \"%s\"" +"Caused by:" => "Spowodowane przez:" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/lib/l10n/pt_BR.php b/lib/l10n/pt_BR.php index 7a580799701..59bc7831619 100644 --- a/lib/l10n/pt_BR.php +++ b/lib/l10n/pt_BR.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Defina uma senha de administrador.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Seu servidor web não está configurado corretamente para permitir sincronização de arquivos porque a interface WebDAV parece estar quebrada.", "Please double check the <a href='%s'>installation guides</a>." => "Por favor, confira os <a href='%s'>guias de instalação</a>.", +"Could not find category \"%s\"" => "Impossível localizar categoria \"%s\"", "seconds ago" => "segundos atrás", "_%n minute ago_::_%n minutes ago_" => array("","ha %n minutos"), "_%n hour ago_::_%n hours ago_" => array("","ha %n horas"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("","ha %n meses"), "last year" => "último ano", "years ago" => "anos atrás", -"Caused by:" => "Causados por:", -"Could not find category \"%s\"" => "Impossível localizar categoria \"%s\"" +"Caused by:" => "Causados por:" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/lib/l10n/pt_PT.php b/lib/l10n/pt_PT.php index 6e2bcba7b10..bc298a3f33f 100644 --- a/lib/l10n/pt_PT.php +++ b/lib/l10n/pt_PT.php @@ -41,6 +41,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Definiar uma password de administrador", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "O seu servidor web não está configurado correctamente para autorizar sincronização de ficheiros, pois o interface WebDAV parece estar com problemas.", "Please double check the <a href='%s'>installation guides</a>." => "Por favor verifique <a href='%s'>installation guides</a>.", +"Could not find category \"%s\"" => "Não foi encontrado a categoria \"%s\"", "seconds ago" => "Minutos atrás", "_%n minute ago_::_%n minutes ago_" => array("","%n minutos atrás"), "_%n hour ago_::_%n hours ago_" => array("","%n horas atrás"), @@ -51,7 +52,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("","%n meses atrás"), "last year" => "ano passado", "years ago" => "anos atrás", -"Caused by:" => "Causado por:", -"Could not find category \"%s\"" => "Não foi encontrado a categoria \"%s\"" +"Caused by:" => "Causado por:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/ro.php b/lib/l10n/ro.php index 76dafcd03e0..94ff7a4326a 100644 --- a/lib/l10n/ro.php +++ b/lib/l10n/ro.php @@ -20,6 +20,7 @@ $TRANSLATIONS = array( "Images" => "Imagini", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Serverul de web nu este încă setat corespunzător pentru a permite sincronizarea fișierelor deoarece interfața WebDAV pare a fi întreruptă.", "Please double check the <a href='%s'>installation guides</a>." => "Vă rugăm să verificați <a href='%s'>ghiduri de instalare</a>.", +"Could not find category \"%s\"" => "Cloud nu a gasit categoria \"%s\"", "seconds ago" => "secunde în urmă", "_%n minute ago_::_%n minutes ago_" => array("","","acum %n minute"), "_%n hour ago_::_%n hours ago_" => array("","","acum %n ore"), @@ -29,7 +30,6 @@ $TRANSLATIONS = array( "last month" => "ultima lună", "_%n month ago_::_%n months ago_" => array("","",""), "last year" => "ultimul an", -"years ago" => "ani în urmă", -"Could not find category \"%s\"" => "Cloud nu a gasit categoria \"%s\"" +"years ago" => "ani în urmă" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));"; diff --git a/lib/l10n/ru.php b/lib/l10n/ru.php index 501065f8b5f..c52248273a6 100644 --- a/lib/l10n/ru.php +++ b/lib/l10n/ru.php @@ -56,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "становит пароль для admin.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ваш веб сервер до сих пор не настроен правильно для возможности синхронизации файлов, похоже что проблема в неисправности интерфейса WebDAV.", "Please double check the <a href='%s'>installation guides</a>." => "Пожалуйста, дважды просмотрите <a href='%s'>инструкции по установке</a>.", +"Could not find category \"%s\"" => "Категория \"%s\" не найдена", "seconds ago" => "несколько секунд назад", "_%n minute ago_::_%n minutes ago_" => array("%n минута назад","%n минуты назад","%n минут назад"), "_%n hour ago_::_%n hours ago_" => array("%n час назад","%n часа назад","%n часов назад"), @@ -66,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("%n месяц назад","%n месяца назад","%n месяцев назад"), "last year" => "в прошлом году", "years ago" => "несколько лет назад", -"Caused by:" => "Вызвано:", -"Could not find category \"%s\"" => "Категория \"%s\" не найдена" +"Caused by:" => "Вызвано:" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/lib/l10n/sk_SK.php b/lib/l10n/sk_SK.php index 13487b039d6..d2476c5a2bb 100644 --- a/lib/l10n/sk_SK.php +++ b/lib/l10n/sk_SK.php @@ -53,6 +53,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Zadajte heslo administrátora.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Váš webový server nie je správne nastavený na synchronizáciu, pretože rozhranie WebDAV je poškodené.", "Please double check the <a href='%s'>installation guides</a>." => "Prosím skontrolujte <a href='%s'>inštalačnú príručku</a>.", +"Could not find category \"%s\"" => "Nemožno nájsť danú kategóriu \"%s\"", "seconds ago" => "pred sekundami", "_%n minute ago_::_%n minutes ago_" => array("","","pred %n minútami"), "_%n hour ago_::_%n hours ago_" => array("","","pred %n hodinami"), @@ -63,7 +64,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("","","pred %n mesiacmi"), "last year" => "minulý rok", "years ago" => "pred rokmi", -"Caused by:" => "Príčina:", -"Could not find category \"%s\"" => "Nemožno nájsť danú kategóriu \"%s\"" +"Caused by:" => "Príčina:" ); $PLURAL_FORMS = "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"; diff --git a/lib/l10n/sl.php b/lib/l10n/sl.php index 5722191aedf..286ec733205 100644 --- a/lib/l10n/sl.php +++ b/lib/l10n/sl.php @@ -36,6 +36,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Nastavi geslo skrbnika.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Spletni stražnik še ni ustrezno nastavljen in ne omogoča usklajevanja, saj je nastavitev WebDAV okvarjena.", "Please double check the <a href='%s'>installation guides</a>." => "Preverite <a href='%s'>navodila namestitve</a>.", +"Could not find category \"%s\"" => "Kategorije \"%s\" ni mogoče najti.", "seconds ago" => "pred nekaj sekundami", "_%n minute ago_::_%n minutes ago_" => array("","","",""), "_%n hour ago_::_%n hours ago_" => array("","","",""), @@ -45,7 +46,6 @@ $TRANSLATIONS = array( "last month" => "zadnji mesec", "_%n month ago_::_%n months ago_" => array("","","",""), "last year" => "lansko leto", -"years ago" => "let nazaj", -"Could not find category \"%s\"" => "Kategorije \"%s\" ni mogoče najti." +"years ago" => "let nazaj" ); $PLURAL_FORMS = "nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);"; diff --git a/lib/l10n/sq.php b/lib/l10n/sq.php index edaa1df2b86..b36aa4ceefc 100644 --- a/lib/l10n/sq.php +++ b/lib/l10n/sq.php @@ -35,6 +35,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Cakto kodin e administratorit.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Serveri web i juaji nuk është konfiguruar akoma për të lejuar sinkronizimin e skedarëve sepse ndërfaqja WebDAV mund të jetë e dëmtuar.", "Please double check the <a href='%s'>installation guides</a>." => "Ju lutemi kontrolloni mirë <a href='%s'>shoqëruesin e instalimit</a>.", +"Could not find category \"%s\"" => "Kategoria \"%s\" nuk u gjet", "seconds ago" => "sekonda më parë", "_%n minute ago_::_%n minutes ago_" => array("","%n minuta më parë"), "_%n hour ago_::_%n hours ago_" => array("","%n orë më parë"), @@ -44,7 +45,6 @@ $TRANSLATIONS = array( "last month" => "muajin e shkuar", "_%n month ago_::_%n months ago_" => array("","%n muaj më parë"), "last year" => "vitin e shkuar", -"years ago" => "vite më parë", -"Could not find category \"%s\"" => "Kategoria \"%s\" nuk u gjet" +"years ago" => "vite më parë" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/sr.php b/lib/l10n/sr.php index 9441d0578fc..47a84803683 100644 --- a/lib/l10n/sr.php +++ b/lib/l10n/sr.php @@ -18,6 +18,7 @@ $TRANSLATIONS = array( "Images" => "Слике", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ваш веб сервер тренутно не подржава синхронизацију датотека јер се чини да је WebDAV сучеље неисправно.", "Please double check the <a href='%s'>installation guides</a>." => "Погледајте <a href='%s'>водиче за инсталацију</a>.", +"Could not find category \"%s\"" => "Не могу да пронађем категорију „%s“.", "seconds ago" => "пре неколико секунди", "_%n minute ago_::_%n minutes ago_" => array("","",""), "_%n hour ago_::_%n hours ago_" => array("","",""), @@ -27,7 +28,6 @@ $TRANSLATIONS = array( "last month" => "прошлог месеца", "_%n month ago_::_%n months ago_" => array("","",""), "last year" => "прошле године", -"years ago" => "година раније", -"Could not find category \"%s\"" => "Не могу да пронађем категорију „%s“." +"years ago" => "година раније" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/lib/l10n/sv.php b/lib/l10n/sv.php index e7c3420a85b..37f2e1d8c08 100644 --- a/lib/l10n/sv.php +++ b/lib/l10n/sv.php @@ -53,6 +53,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Ange ett administratörslösenord.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Din webbserver är inte korrekt konfigurerad för att tillåta filsynkronisering eftersom WebDAV inte verkar fungera.", "Please double check the <a href='%s'>installation guides</a>." => "Var god kontrollera <a href='%s'>installationsguiden</a>.", +"Could not find category \"%s\"" => "Kunde inte hitta kategorin \"%s\"", "seconds ago" => "sekunder sedan", "_%n minute ago_::_%n minutes ago_" => array("%n minut sedan","%n minuter sedan"), "_%n hour ago_::_%n hours ago_" => array("%n timme sedan","%n timmar sedan"), @@ -63,7 +64,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("%n månad sedan","%n månader sedan"), "last year" => "förra året", "years ago" => "år sedan", -"Caused by:" => "Orsakad av:", -"Could not find category \"%s\"" => "Kunde inte hitta kategorin \"%s\"" +"Caused by:" => "Orsakad av:" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/ta_LK.php b/lib/l10n/ta_LK.php index e70e65845be..f761ccab0e2 100644 --- a/lib/l10n/ta_LK.php +++ b/lib/l10n/ta_LK.php @@ -16,6 +16,7 @@ $TRANSLATIONS = array( "Files" => "கோப்புகள்", "Text" => "உரை", "Images" => "படங்கள்", +"Could not find category \"%s\"" => "பிரிவு \"%s\" ஐ கண்டுப்பிடிக்க முடியவில்லை", "seconds ago" => "செக்கன்களுக்கு முன்", "_%n minute ago_::_%n minutes ago_" => array("",""), "_%n hour ago_::_%n hours ago_" => array("",""), @@ -25,7 +26,6 @@ $TRANSLATIONS = array( "last month" => "கடந்த மாதம்", "_%n month ago_::_%n months ago_" => array("",""), "last year" => "கடந்த வருடம்", -"years ago" => "வருடங்களுக்கு முன்", -"Could not find category \"%s\"" => "பிரிவு \"%s\" ஐ கண்டுப்பிடிக்க முடியவில்லை" +"years ago" => "வருடங்களுக்கு முன்" ); $PLURAL_FORMS = "nplurals=2; plural=(n != 1);"; diff --git a/lib/l10n/th_TH.php b/lib/l10n/th_TH.php index 3344d0bb18e..173d0f2856b 100644 --- a/lib/l10n/th_TH.php +++ b/lib/l10n/th_TH.php @@ -16,6 +16,7 @@ $TRANSLATIONS = array( "Files" => "ไฟล์", "Text" => "ข้อความ", "Images" => "รูปภาพ", +"Could not find category \"%s\"" => "ไม่พบหมวดหมู่ \"%s\"", "seconds ago" => "วินาที ก่อนหน้านี้", "_%n minute ago_::_%n minutes ago_" => array(""), "_%n hour ago_::_%n hours ago_" => array(""), @@ -25,7 +26,6 @@ $TRANSLATIONS = array( "last month" => "เดือนที่แล้ว", "_%n month ago_::_%n months ago_" => array(""), "last year" => "ปีที่แล้ว", -"years ago" => "ปี ที่ผ่านมา", -"Could not find category \"%s\"" => "ไม่พบหมวดหมู่ \"%s\"" +"years ago" => "ปี ที่ผ่านมา" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/tr.php b/lib/l10n/tr.php index b63c37c7240..01f48517aec 100644 --- a/lib/l10n/tr.php +++ b/lib/l10n/tr.php @@ -53,6 +53,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Parola yonetici birlemek. ", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Web sunucunuz dosya transferi için düzgün bir şekilde yapılandırılmamış. WevDAV arabirimini sorunlu gözüküyor.", "Please double check the <a href='%s'>installation guides</a>." => "Lütfen <a href='%s'>kurulum kılavuzlarını</a> iki kez kontrol edin.", +"Could not find category \"%s\"" => "\"%s\" kategorisi bulunamadı", "seconds ago" => "saniye önce", "_%n minute ago_::_%n minutes ago_" => array("","%n dakika önce"), "_%n hour ago_::_%n hours ago_" => array("","%n saat önce"), @@ -63,7 +64,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("","%n ay önce"), "last year" => "geçen yıl", "years ago" => "yıl önce", -"Caused by:" => "Neden olan:", -"Could not find category \"%s\"" => "\"%s\" kategorisi bulunamadı" +"Caused by:" => "Neden olan:" ); $PLURAL_FORMS = "nplurals=2; plural=(n > 1);"; diff --git a/lib/l10n/uk.php b/lib/l10n/uk.php index c1513c5bb79..906c93b567a 100644 --- a/lib/l10n/uk.php +++ b/lib/l10n/uk.php @@ -35,6 +35,7 @@ $TRANSLATIONS = array( "Set an admin password." => "Встановіть пароль адміністратора.", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "Ваш Web-сервер ще не налаштований належним чином для того, щоб дозволити синхронізацію файлів, через те що інтерфейс WebDAV, здається, зламаний.", "Please double check the <a href='%s'>installation guides</a>." => "Будь ласка, перевірте <a href='%s'>інструкції по встановленню</a>.", +"Could not find category \"%s\"" => "Не вдалося знайти категорію \"%s\"", "seconds ago" => "секунди тому", "_%n minute ago_::_%n minutes ago_" => array("","",""), "_%n hour ago_::_%n hours ago_" => array("","",""), @@ -44,7 +45,6 @@ $TRANSLATIONS = array( "last month" => "минулого місяця", "_%n month ago_::_%n months ago_" => array("","",""), "last year" => "минулого року", -"years ago" => "роки тому", -"Could not find category \"%s\"" => "Не вдалося знайти категорію \"%s\"" +"years ago" => "роки тому" ); $PLURAL_FORMS = "nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);"; diff --git a/lib/l10n/vi.php b/lib/l10n/vi.php index dc0045c35ca..5840283110e 100644 --- a/lib/l10n/vi.php +++ b/lib/l10n/vi.php @@ -16,6 +16,7 @@ $TRANSLATIONS = array( "Files" => "Tập tin", "Text" => "Văn bản", "Images" => "Hình ảnh", +"Could not find category \"%s\"" => "không thể tìm thấy mục \"%s\"", "seconds ago" => "vài giây trước", "_%n minute ago_::_%n minutes ago_" => array(""), "_%n hour ago_::_%n hours ago_" => array(""), @@ -25,7 +26,6 @@ $TRANSLATIONS = array( "last month" => "tháng trước", "_%n month ago_::_%n months ago_" => array(""), "last year" => "năm trước", -"years ago" => "năm trước", -"Could not find category \"%s\"" => "không thể tìm thấy mục \"%s\"" +"years ago" => "năm trước" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/zh_CN.php b/lib/l10n/zh_CN.php index 2c34356ea10..e3f2c949175 100644 --- a/lib/l10n/zh_CN.php +++ b/lib/l10n/zh_CN.php @@ -37,6 +37,7 @@ $TRANSLATIONS = array( "Set an admin password." => "请设置一个管理员密码。", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "您的Web服务器尚未正确设置以允许文件同步, 因为WebDAV的接口似乎已损坏.", "Please double check the <a href='%s'>installation guides</a>." => "请认真检查<a href='%s'>安装指南</a>.", +"Could not find category \"%s\"" => "无法找到分类 \"%s\"", "seconds ago" => "秒前", "_%n minute ago_::_%n minutes ago_" => array("%n 分钟前"), "_%n hour ago_::_%n hours ago_" => array("%n 小时前"), @@ -46,7 +47,6 @@ $TRANSLATIONS = array( "last month" => "上月", "_%n month ago_::_%n months ago_" => array("%n 月前"), "last year" => "去年", -"years ago" => "年前", -"Could not find category \"%s\"" => "无法找到分类 \"%s\"" +"years ago" => "年前" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/l10n/zh_TW.php b/lib/l10n/zh_TW.php index 210c766aa59..e56a451f8a9 100644 --- a/lib/l10n/zh_TW.php +++ b/lib/l10n/zh_TW.php @@ -8,6 +8,9 @@ $TRANSLATIONS = array( "Users" => "使用者", "Admin" => "管理", "Failed to upgrade \"%s\"." => "升級失敗:%s", +"Custom profile pictures don't work with encryption yet" => "自訂大頭貼暫時不能和加密功能同時使用", +"Unknown filetype" => "未知的檔案類型", +"Invalid image" => "無效的圖片", "web services under your control" => "由您控制的網路服務", "cannot open \"%s\"" => "無法開啓 %s", "ZIP download is turned off." => "ZIP 下載已關閉。", @@ -53,6 +56,7 @@ $TRANSLATIONS = array( "Set an admin password." => "設定管理員密碼。", "Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken." => "您的網頁伺服器尚未被正確設定來進行檔案同步,因為您的 WebDAV 界面似乎無法使用。", "Please double check the <a href='%s'>installation guides</a>." => "請參考<a href='%s'>安裝指南</a>。", +"Could not find category \"%s\"" => "找不到分類:\"%s\"", "seconds ago" => "幾秒前", "_%n minute ago_::_%n minutes ago_" => array("%n 分鐘前"), "_%n hour ago_::_%n hours ago_" => array("%n 小時前"), @@ -63,7 +67,6 @@ $TRANSLATIONS = array( "_%n month ago_::_%n months ago_" => array("%n 個月前"), "last year" => "去年", "years ago" => "幾年前", -"Caused by:" => "原因:", -"Could not find category \"%s\"" => "找不到分類:\"%s\"" +"Caused by:" => "原因:" ); $PLURAL_FORMS = "nplurals=1; plural=0;"; diff --git a/lib/allconfig.php b/lib/private/allconfig.php index 72aabf60793..72aabf60793 100644 --- a/lib/allconfig.php +++ b/lib/private/allconfig.php diff --git a/lib/api.php b/lib/private/api.php index 31f3f968d9b..31f3f968d9b 100644 --- a/lib/api.php +++ b/lib/private/api.php diff --git a/lib/app.php b/lib/private/app.php index 0ab1ee57f63..b4a71992178 100644 --- a/lib/app.php +++ b/lib/private/app.php @@ -165,10 +165,14 @@ class OC_App{ /** * get all enabled apps */ + private static $enabledAppsCache = array(); public static function getEnabledApps() { if(!OC_Config::getValue('installed', false)) { return array(); } + if(!empty(self::$enabledAppsCache)) { + return self::$enabledAppsCache; + } $apps=array('files'); $sql = 'SELECT `appid` FROM `*PREFIX*appconfig`' .' WHERE `configkey` = \'enabled\' AND `configvalue`=\'yes\''; @@ -187,6 +191,7 @@ class OC_App{ $apps[]=$row['appid']; } } + self::$enabledAppsCache = $apps; return $apps; } @@ -198,11 +203,11 @@ class OC_App{ * This function checks whether or not an app is enabled. */ public static function isEnabled( $app ) { - if( 'files'==$app or ('yes' == OC_Appconfig::getValue( $app, 'enabled' ))) { + if('files' == $app) { return true; } - - return false; + $enabledApps = self::getEnabledApps(); + return in_array($app, $enabledApps); } /** @@ -214,6 +219,7 @@ class OC_App{ * This function set an app as enabled in appconfig. */ public static function enable( $app ) { + self::$enabledAppsCache = array(); // flush if(!OC_Installer::isInstalled($app)) { // check if app is a shipped app or not. OCS apps have an integer as id, shipped apps use a string if(!is_numeric($app)) { @@ -257,6 +263,7 @@ class OC_App{ * This function set an app as disabled in appconfig. */ public static function disable( $app ) { + self::$enabledAppsCache = array(); // flush // check if app is a shipped app or not. if not delete \OC_Hook::emit('OC_App', 'pre_disable', array('app' => $app)); OC_Appconfig::setValue( $app, 'enabled', 'no' ); diff --git a/lib/appconfig.php b/lib/private/appconfig.php index e615d838173..e615d838173 100644 --- a/lib/appconfig.php +++ b/lib/private/appconfig.php diff --git a/lib/appframework/app.php b/lib/private/appframework/app.php index 7ff55bb809d..7ff55bb809d 100644 --- a/lib/appframework/app.php +++ b/lib/private/appframework/app.php diff --git a/lib/appframework/controller/controller.php b/lib/private/appframework/controller/controller.php index 0ea0a38cc09..0ea0a38cc09 100644 --- a/lib/appframework/controller/controller.php +++ b/lib/private/appframework/controller/controller.php diff --git a/lib/appframework/core/api.php b/lib/private/appframework/core/api.php index 39522ee3dd5..39522ee3dd5 100644 --- a/lib/appframework/core/api.php +++ b/lib/private/appframework/core/api.php diff --git a/lib/appframework/dependencyinjection/dicontainer.php b/lib/private/appframework/dependencyinjection/dicontainer.php index 3755d45fa09..3755d45fa09 100644 --- a/lib/appframework/dependencyinjection/dicontainer.php +++ b/lib/private/appframework/dependencyinjection/dicontainer.php diff --git a/lib/appframework/http/dispatcher.php b/lib/private/appframework/http/dispatcher.php index ea57a6860cc..ea57a6860cc 100644 --- a/lib/appframework/http/dispatcher.php +++ b/lib/private/appframework/http/dispatcher.php diff --git a/lib/appframework/http/downloadresponse.php b/lib/private/appframework/http/downloadresponse.php index 67b9542dba6..67b9542dba6 100644 --- a/lib/appframework/http/downloadresponse.php +++ b/lib/private/appframework/http/downloadresponse.php diff --git a/lib/appframework/http/http.php b/lib/private/appframework/http/http.php index e00dc9cdc4a..e00dc9cdc4a 100644 --- a/lib/appframework/http/http.php +++ b/lib/private/appframework/http/http.php diff --git a/lib/appframework/http/redirectresponse.php b/lib/private/appframework/http/redirectresponse.php index 688447f1618..688447f1618 100644 --- a/lib/appframework/http/redirectresponse.php +++ b/lib/private/appframework/http/redirectresponse.php diff --git a/lib/appframework/http/request.php b/lib/private/appframework/http/request.php index 34605acdfea..3e1f4ff87ed 100644 --- a/lib/appframework/http/request.php +++ b/lib/private/appframework/http/request.php @@ -31,6 +31,8 @@ use OCP\IRequest; class Request implements \ArrayAccess, \Countable, IRequest { + protected $inputStream; + protected $content; protected $items = array(); protected $allowedKeys = array( 'get', @@ -40,35 +42,48 @@ class Request implements \ArrayAccess, \Countable, IRequest { 'env', 'cookies', 'urlParams', - 'params', 'parameters', - 'method' + 'method', + 'requesttoken', ); /** * @param array $vars An associative array with the following optional values: - * @param array 'params' the parsed json array * @param array 'urlParams' the parameters which were matched from the URL * @param array 'get' the $_GET array - * @param array 'post' the $_POST array + * @param array|string 'post' the $_POST array or JSON string * @param array 'files' the $_FILES array * @param array 'server' the $_SERVER array * @param array 'env' the $_ENV array - * @param array 'session' the $_SESSION array * @param array 'cookies' the $_COOKIE array * @param string 'method' the request method (GET, POST etc) + * @param string|false 'requesttoken' the requesttoken or false when not available * @see http://www.php.net/manual/en/reserved.variables.php */ public function __construct(array $vars=array()) { foreach($this->allowedKeys as $name) { - $this->items[$name] = isset($vars[$name]) + $this->items[$name] = isset($vars[$name]) ? $vars[$name] : array(); } + if (defined('PHPUNIT_RUN') && PHPUNIT_RUN + && in_array('fakeinput', stream_get_wrappers())) { + $this->inputStream = 'fakeinput://data'; + } else { + $this->inputStream = 'php://input'; + } + + // Only 'application/x-www-form-urlencoded' requests are automatically + // transformed by PHP, 'application/json' must be decoded manually. + if ($this->method === 'POST' + && strpos($this->getHeader('Content-Type'), 'application/json') !== false + ) { + $this->items['params'] = $this->items['post'] = json_decode(file_get_contents($this->inputStream), true); + } + $this->items['parameters'] = array_merge( - $this->items['params'], $this->items['get'], $this->items['post'], $this->items['urlParams'] @@ -141,17 +156,22 @@ class Request implements \ArrayAccess, \Countable, IRequest { * $request->myvar; or $request->{'myvar'}; or $request->{$myvar} * Looks in the combined GET, POST and urlParams array. * - * if($request->method !== 'POST') { - * throw new Exception('This function can only be invoked using POST'); - * } + * If you access e.g. ->post but the current HTTP request method + * is GET a \LogicException will be thrown. * * @param string $name The key to look for. + * @throws \LogicException * @return mixed|null */ public function __get($name) { switch($name) { + case 'put': + case 'patch': case 'get': case 'post': + if($this->method !== strtoupper($name)) { + throw new \LogicException(sprintf('%s cannot be accessed in a %s request.', $name, $this->method)); + } case 'files': case 'server': case 'env': @@ -159,9 +179,13 @@ class Request implements \ArrayAccess, \Countable, IRequest { case 'parameters': case 'params': case 'urlParams': - return isset($this->items[$name]) - ? $this->items[$name] - : null; + if(in_array($name, array('put', 'patch'))) { + return $this->getContent($name); + } else { + return isset($this->items[$name]) + ? $this->items[$name] + : null; + } break; case 'method': return $this->items['method']; @@ -280,28 +304,86 @@ class Request implements \ArrayAccess, \Countable, IRequest { /** * Returns the request body content. * - * @param Boolean $asResource If true, a resource will be returned + * If the HTTP request method is PUT and the body + * not application/x-www-form-urlencoded or application/json a stream + * resource is returned, otherwise an array. * - * @return string|resource The request body content or a resource to read the body stream. + * @return array|string|resource The request body content or a resource to read the body stream. * * @throws \LogicException */ - function getContent($asResource = false) { - return null; -// if (false === $this->content || (true === $asResource && null !== $this->content)) { -// throw new \LogicException('getContent() can only be called once when using the resource return type.'); -// } -// -// if (true === $asResource) { -// $this->content = false; -// -// return fopen('php://input', 'rb'); -// } -// -// if (null === $this->content) { -// $this->content = file_get_contents('php://input'); -// } -// -// return $this->content; + protected function getContent() { + if ($this->content === false && $this->method === 'PUT') { + throw new \LogicException( + '"put" can only be accessed once if not ' + . 'application/x-www-form-urlencoded or application/json.' + ); + } + + // If the content can't be parsed into an array then return a stream resource. + if ($this->method === 'PUT' + && strpos($this->getHeader('Content-Type'), 'application/x-www-form-urlencoded') === false + && strpos($this->getHeader('Content-Type'), 'application/json') === false + ) { + $this->content = false; + return fopen($this->inputStream, 'rb'); + } + + if (is_null($this->content)) { + $this->content = file_get_contents($this->inputStream); + + /* + * Normal jquery ajax requests are sent as application/x-www-form-urlencoded + * and in $_GET and $_POST PHP transformes the data into an array. + * The first condition mimics this. + * The second condition allows for sending raw application/json data while + * still getting the result as an array. + * + */ + if (strpos($this->getHeader('Content-Type'), 'application/x-www-form-urlencoded') !== false) { + parse_str($this->content, $content); + if(is_array($content)) { + $this->content = $content; + } + } elseif (strpos($this->getHeader('Content-Type'), 'application/json') !== false) { + $content = json_decode($this->content, true); + if(is_array($content)) { + $this->content = $content; + } + } + } + + return $this->content; } -} + + /** + * Checks if the CSRF check was correct + * @return bool true if CSRF check passed + * @see OC_Util::$callLifespan + * @see OC_Util::callRegister() + */ + public function passesCSRFCheck() { + if($this->items['requesttoken'] === false) { + return false; + } + + if (isset($this->items['get']['requesttoken'])) { + $token = $this->items['get']['requesttoken']; + } elseif (isset($this->items['post']['requesttoken'])) { + $token = $this->items['post']['requesttoken']; + } elseif (isset($this->items['server']['HTTP_REQUESTTOKEN'])) { + $token = $this->items['server']['HTTP_REQUESTTOKEN']; + } else { + //no token found. + return false; + } + + // Check if the token is valid + if($token !== $this->items['requesttoken']) { + // Not valid + return false; + } else { + // Valid token + return true; + } + }} diff --git a/lib/appframework/middleware/middlewaredispatcher.php b/lib/private/appframework/middleware/middlewaredispatcher.php index 70ab108e6b8..c2377b8844b 100644 --- a/lib/appframework/middleware/middlewaredispatcher.php +++ b/lib/private/appframework/middleware/middlewaredispatcher.php @@ -26,7 +26,7 @@ namespace OC\AppFramework\Middleware; use OC\AppFramework\Controller\Controller; use OCP\AppFramework\Http\Response; - +use OCP\AppFramework\MiddleWare; /** * This class is used to store and run all the middleware in correct order diff --git a/lib/appframework/middleware/security/securityexception.php b/lib/private/appframework/middleware/security/securityexception.php index b32a2769ff5..b32a2769ff5 100644 --- a/lib/appframework/middleware/security/securityexception.php +++ b/lib/private/appframework/middleware/security/securityexception.php diff --git a/lib/appframework/middleware/security/securitymiddleware.php b/lib/private/appframework/middleware/security/securitymiddleware.php index 4f1447e1afb..d6daf737bb4 100644 --- a/lib/appframework/middleware/security/securitymiddleware.php +++ b/lib/private/appframework/middleware/security/securitymiddleware.php @@ -29,8 +29,8 @@ use OC\AppFramework\Http\Http; use OC\AppFramework\Http\Request; use OC\AppFramework\Http\RedirectResponse; use OC\AppFramework\Utility\MethodAnnotationReader; -use OC\AppFramework\Middleware\Middleware; use OC\AppFramework\Core\API; +use OCP\AppFramework\Middleware; use OCP\AppFramework\Http\Response; use OCP\AppFramework\Http\JSONResponse; diff --git a/lib/appframework/routing/routeactionhandler.php b/lib/private/appframework/routing/routeactionhandler.php index 7fb56f14eab..7fb56f14eab 100644 --- a/lib/appframework/routing/routeactionhandler.php +++ b/lib/private/appframework/routing/routeactionhandler.php diff --git a/lib/appframework/routing/routeconfig.php b/lib/private/appframework/routing/routeconfig.php index 53ab11bf2f5..53ab11bf2f5 100644 --- a/lib/appframework/routing/routeconfig.php +++ b/lib/private/appframework/routing/routeconfig.php diff --git a/lib/appframework/utility/methodannotationreader.php b/lib/private/appframework/utility/methodannotationreader.php index 42060a08529..42060a08529 100644 --- a/lib/appframework/utility/methodannotationreader.php +++ b/lib/private/appframework/utility/methodannotationreader.php diff --git a/lib/appframework/utility/simplecontainer.php b/lib/private/appframework/utility/simplecontainer.php index a51ace83a37..7e4db63bde5 100644 --- a/lib/appframework/utility/simplecontainer.php +++ b/lib/private/appframework/utility/simplecontainer.php @@ -3,7 +3,7 @@ namespace OC\AppFramework\Utility; // register 3rdparty autoloaders -require_once __DIR__ . '/../../../3rdparty/Pimple/Pimple.php'; +require_once __DIR__ . '/../../../../3rdparty/Pimple/Pimple.php'; /** * Class SimpleContainer diff --git a/lib/appframework/utility/timefactory.php b/lib/private/appframework/utility/timefactory.php index 2c3dd6cf5e3..2c3dd6cf5e3 100644 --- a/lib/appframework/utility/timefactory.php +++ b/lib/private/appframework/utility/timefactory.php diff --git a/lib/archive.php b/lib/private/archive.php index 85bfae57295..85bfae57295 100644 --- a/lib/archive.php +++ b/lib/private/archive.php diff --git a/lib/archive/tar.php b/lib/private/archive/tar.php index a1c0535b1c3..a1c0535b1c3 100644 --- a/lib/archive/tar.php +++ b/lib/private/archive/tar.php diff --git a/lib/archive/zip.php b/lib/private/archive/zip.php index 8a866716a79..8a866716a79 100644 --- a/lib/archive/zip.php +++ b/lib/private/archive/zip.php diff --git a/lib/arrayparser.php b/lib/private/arrayparser.php index 3bb394a5163..3bb394a5163 100644 --- a/lib/arrayparser.php +++ b/lib/private/arrayparser.php diff --git a/lib/avatar.php b/lib/private/avatar.php index f20980c364b..f20980c364b 100644 --- a/lib/avatar.php +++ b/lib/private/avatar.php diff --git a/lib/backgroundjob.php b/lib/private/backgroundjob.php index 9619dcb732c..9619dcb732c 100644 --- a/lib/backgroundjob.php +++ b/lib/private/backgroundjob.php diff --git a/lib/backgroundjob/job.php b/lib/private/backgroundjob/job.php index 49fbffbd684..49fbffbd684 100644 --- a/lib/backgroundjob/job.php +++ b/lib/private/backgroundjob/job.php diff --git a/lib/backgroundjob/joblist.php b/lib/private/backgroundjob/joblist.php index cc803dd9b5f..cc803dd9b5f 100644 --- a/lib/backgroundjob/joblist.php +++ b/lib/private/backgroundjob/joblist.php diff --git a/lib/backgroundjob/legacy/queuedjob.php b/lib/private/backgroundjob/legacy/queuedjob.php index 2bc001103b8..2bc001103b8 100644 --- a/lib/backgroundjob/legacy/queuedjob.php +++ b/lib/private/backgroundjob/legacy/queuedjob.php diff --git a/lib/backgroundjob/legacy/regularjob.php b/lib/private/backgroundjob/legacy/regularjob.php index d4cfa348cea..d4cfa348cea 100644 --- a/lib/backgroundjob/legacy/regularjob.php +++ b/lib/private/backgroundjob/legacy/regularjob.php diff --git a/lib/backgroundjob/queuedjob.php b/lib/private/backgroundjob/queuedjob.php index 1714182820d..1714182820d 100644 --- a/lib/backgroundjob/queuedjob.php +++ b/lib/private/backgroundjob/queuedjob.php diff --git a/lib/backgroundjob/timedjob.php b/lib/private/backgroundjob/timedjob.php index ae9f33505ab..ae9f33505ab 100644 --- a/lib/backgroundjob/timedjob.php +++ b/lib/private/backgroundjob/timedjob.php diff --git a/lib/cache.php b/lib/private/cache.php index a311f10a00f..a311f10a00f 100644 --- a/lib/cache.php +++ b/lib/private/cache.php diff --git a/lib/cache/broker.php b/lib/private/cache/broker.php index 9b7e837e1bc..9b7e837e1bc 100644 --- a/lib/cache/broker.php +++ b/lib/private/cache/broker.php diff --git a/lib/cache/file.php b/lib/private/cache/file.php index 2ab914d17b8..2ab914d17b8 100644 --- a/lib/cache/file.php +++ b/lib/private/cache/file.php diff --git a/lib/cache/fileglobal.php b/lib/private/cache/fileglobal.php index bd049bba4d0..bd049bba4d0 100644 --- a/lib/cache/fileglobal.php +++ b/lib/private/cache/fileglobal.php diff --git a/lib/cache/fileglobalgc.php b/lib/private/cache/fileglobalgc.php index 399dd5e6f94..399dd5e6f94 100644 --- a/lib/cache/fileglobalgc.php +++ b/lib/private/cache/fileglobalgc.php diff --git a/lib/cache/usercache.php b/lib/private/cache/usercache.php index baa8820700b..baa8820700b 100644 --- a/lib/cache/usercache.php +++ b/lib/private/cache/usercache.php diff --git a/lib/config.php b/lib/private/config.php index e773e6e2eb0..72423137fa3 100644 --- a/lib/config.php +++ b/lib/private/config.php @@ -160,7 +160,6 @@ class Config { */ private function writeData() { // Create a php file ... - $defaults = new \OC_Defaults; $content = "<?php\n"; if ($this->debugMode) { $content .= "define('DEBUG',true);\n"; @@ -172,6 +171,7 @@ class Config { // Write the file $result = @file_put_contents($this->configFilename, $content); if (!$result) { + $defaults = new \OC_Defaults; $url = $defaults->getDocBaseUrl() . '/server/5.0/admin_manual/installation/installation_source.html#set-the-directory-permissions'; throw new HintException( "Can't write into config directory!", diff --git a/lib/connector/sabre/ServiceUnavailable.php b/lib/private/connector/sabre/ServiceUnavailable.php index c1cc815c989..c1cc815c989 100644 --- a/lib/connector/sabre/ServiceUnavailable.php +++ b/lib/private/connector/sabre/ServiceUnavailable.php diff --git a/lib/private/connector/sabre/aborteduploaddetectionplugin.php b/lib/private/connector/sabre/aborteduploaddetectionplugin.php new file mode 100644 index 00000000000..10cca647e8d --- /dev/null +++ b/lib/private/connector/sabre/aborteduploaddetectionplugin.php @@ -0,0 +1,107 @@ +<?php +/** + * Copyright (c) 2013 Thomas Müller <thomas.mueller@tmit.eu> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +/** + * Class OC_Connector_Sabre_AbortedUploadDetectionPlugin + * + * This plugin will verify if the uploaded data has been stored completely. + * This is done by comparing the content length of the request with the file size on storage. + */ +class OC_Connector_Sabre_AbortedUploadDetectionPlugin extends Sabre_DAV_ServerPlugin { + + /** + * Reference to main server object + * + * @var Sabre_DAV_Server + */ + private $server; + + /** + * is kept public to allow overwrite for unit testing + * + * @var \OC\Files\View + */ + public $fileView; + + /** + * This initializes the plugin. + * + * This function is called by Sabre_DAV_Server, after + * addPlugin is called. + * + * This method should set up the requires event subscriptions. + * + * @param Sabre_DAV_Server $server + */ + public function initialize(Sabre_DAV_Server $server) { + + $this->server = $server; + + $server->subscribeEvent('afterCreateFile', array($this, 'verifyContentLength'), 10); + $server->subscribeEvent('afterWriteContent', array($this, 'verifyContentLength'), 10); + } + + /** + * @param $filePath + * @param Sabre_DAV_INode $node + * @throws Sabre_DAV_Exception_BadRequest + */ + public function verifyContentLength($filePath, Sabre_DAV_INode $node = null) { + + // we should only react on PUT which is used for upload + // e.g. with LOCK this will not work, but LOCK uses createFile() as well + if ($this->server->httpRequest->getMethod() !== 'PUT' ) { + return; + } + + // ownCloud chunked upload will be handled in its own plugin + $chunkHeader = $this->server->httpRequest->getHeader('OC-Chunked'); + if ($chunkHeader) { + return; + } + + // compare expected and actual size + $expected = $this->getLength(); + if (!$expected) { + return; + } + $actual = $this->getFileView()->filesize($filePath); + if ($actual != $expected) { + $this->getFileView()->unlink($filePath); + throw new Sabre_DAV_Exception_BadRequest('expected filesize ' . $expected . ' got ' . $actual); + } + + } + + /** + * @return string + */ + public function getLength() + { + $req = $this->server->httpRequest; + $length = $req->getHeader('X-Expected-Entity-Length'); + if (!$length) { + $length = $req->getHeader('Content-Length'); + } + + return $length; + } + + /** + * @return \OC\Files\View + */ + public function getFileView() + { + if (is_null($this->fileView)) { + // initialize fileView + $this->fileView = \OC\Files\Filesystem::getView(); + } + + return $this->fileView; + } +} diff --git a/lib/connector/sabre/auth.php b/lib/private/connector/sabre/auth.php index bf3a49593cb..d2fd74c44f9 100644 --- a/lib/connector/sabre/auth.php +++ b/lib/private/connector/sabre/auth.php @@ -72,6 +72,11 @@ class OC_Connector_Sabre_Auth extends Sabre_DAV_Auth_Backend_AbstractBasic { * @return bool */ public function authenticate(Sabre_DAV_Server $server, $realm) { + + if (OC_User::handleApacheAuth()) { + return true; + } + if (OC_User::isLoggedIn()) { $user = OC_User::getUser(); OC_Util::setupFS($user); diff --git a/lib/connector/sabre/directory.php b/lib/private/connector/sabre/directory.php index 3181a4b310f..d0334780361 100644 --- a/lib/connector/sabre/directory.php +++ b/lib/private/connector/sabre/directory.php @@ -50,58 +50,28 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa */ public function createFile($name, $data = null) { - if (!\OC\Files\Filesystem::isCreatable($this->path)) { - throw new \Sabre_DAV_Exception_Forbidden(); - } - + // for chunked upload also updating a existing file is a "createFile" + // because we create all the chunks before reasamble them to the existing file. if (isset($_SERVER['HTTP_OC_CHUNKED'])) { - $info = OC_FileChunking::decodeName($name); - if (empty($info)) { - throw new Sabre_DAV_Exception_NotImplemented(); - } - $chunk_handler = new OC_FileChunking($info); - $chunk_handler->store($info['index'], $data); - if ($chunk_handler->isComplete()) { - $newPath = $this->path . '/' . $info['name']; - $chunk_handler->file_assemble($newPath); - return OC_Connector_Sabre_Node::getETagPropertyForPath($newPath); - } - } else { - $newPath = $this->path . '/' . $name; - - // mark file as partial while uploading (ignored by the scanner) - $partpath = $newPath . '.part'; - \OC\Files\Filesystem::file_put_contents($partpath, $data); - - //detect aborted upload - if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT' ) { - if (isset($_SERVER['CONTENT_LENGTH'])) { - $expected = $_SERVER['CONTENT_LENGTH']; - $actual = \OC\Files\Filesystem::filesize($partpath); - if ($actual != $expected) { - \OC\Files\Filesystem::unlink($partpath); - throw new Sabre_DAV_Exception_BadRequest( - 'expected filesize ' . $expected . ' got ' . $actual); - } - } + // exit if we can't create a new file and we don't updatable existing file + $info = OC_FileChunking::decodeName($name); + if (!\OC\Files\Filesystem::isCreatable($this->path) && + !\OC\Files\Filesystem::isUpdatable($this->path . '/' . $info['name'])) { + throw new \Sabre_DAV_Exception_Forbidden(); } - // rename to correct path - \OC\Files\Filesystem::rename($partpath, $newPath); - - // allow sync clients to send the mtime along in a header - $mtime = OC_Request::hasModificationTime(); - if ($mtime !== false) { - if(\OC\Files\Filesystem::touch($newPath, $mtime)) { - header('X-OC-MTime: accepted'); - } + } else { + // For non-chunked upload it is enough to check if we can create a new file + if (!\OC\Files\Filesystem::isCreatable($this->path)) { + throw new \Sabre_DAV_Exception_Forbidden(); } - - return OC_Connector_Sabre_Node::getETagPropertyForPath($newPath); } - return null; + $path = $this->path . '/' . $name; + $node = new OC_Connector_Sabre_File($path); + return $node->put($data); + } /** @@ -250,13 +220,12 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa * If the array is empty, all properties should be returned * * @param array $properties - * @return void + * @return array */ public function getProperties($properties) { $props = parent::getProperties($properties); if (in_array(self::GETETAG_PROPERTYNAME, $properties) && !isset($props[self::GETETAG_PROPERTYNAME])) { - $props[self::GETETAG_PROPERTYNAME] - = OC_Connector_Sabre_Node::getETagPropertyForPath($this->path); + $props[self::GETETAG_PROPERTYNAME] = $this->getETagPropertyForPath($this->path); } return $props; } diff --git a/lib/connector/sabre/file.php b/lib/private/connector/sabre/file.php index 61bdcd5e0ae..037dba7f37b 100644 --- a/lib/connector/sabre/file.php +++ b/lib/private/connector/sabre/file.php @@ -28,7 +28,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D * * The data argument is a readable stream resource. * - * After a succesful put operation, you may choose to return an ETag. The + * After a successful put operation, you may choose to return an ETag. The * etag must always be surrounded by double-quotes. These quotes must * appear in the actual string you're returning. * @@ -46,7 +46,10 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D */ public function put($data) { - if (!\OC\Files\Filesystem::isUpdatable($this->path)) { + $fs = $this->getFS(); + + if ($fs->file_exists($this->path) && + !$fs->isUpdatable($this->path)) { throw new \Sabre_DAV_Exception_Forbidden(); } @@ -54,37 +57,68 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D if (\OC_Util::encryptedFiles()) { throw new \Sabre_DAV_Exception_ServiceUnavailable(); } - + + // chunked handling + if (isset($_SERVER['HTTP_OC_CHUNKED'])) { + + list($path, $name) = \Sabre_DAV_URLUtil::splitPath($this->path); + + $info = OC_FileChunking::decodeName($name); + if (empty($info)) { + throw new Sabre_DAV_Exception_NotImplemented(); + } + + $chunk_handler = new OC_FileChunking($info); + $chunk_handler->store($info['index'], $data); + if ($chunk_handler->isComplete()) { + $newPath = $path . '/' . $info['name']; + $chunk_handler->file_assemble($newPath); + return $this->getETagPropertyForPath($newPath); + } + + return null; + } + // mark file as partial while uploading (ignored by the scanner) $partpath = $this->path . '.part'; - \OC\Files\Filesystem::file_put_contents($partpath, $data); - - //detect aborted upload - if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { - if (isset($_SERVER['CONTENT_LENGTH'])) { - $expected = $_SERVER['CONTENT_LENGTH']; - $actual = \OC\Files\Filesystem::filesize($partpath); - if ($actual != $expected) { - \OC\Files\Filesystem::unlink($partpath); - throw new Sabre_DAV_Exception_BadRequest( - 'expected filesize ' . $expected . ' got ' . $actual); - } + // if file is located in /Shared we write the part file to the users + // root folder because we can't create new files in /shared + // we extend the name with a random number to avoid overwriting a existing file + if (dirname($partpath) === 'Shared') { + $partpath = pathinfo($partpath, PATHINFO_FILENAME) . rand() . '.part'; + } + + try { + $putOkay = $fs->file_put_contents($partpath, $data); + if ($putOkay === false) { + \OC_Log::write('webdav', '\OC\Files\Filesystem::file_put_contents() failed', \OC_Log::ERROR); + $fs->unlink($partpath); + // because we have no clue about the cause we can only throw back a 500/Internal Server Error + throw new Sabre_DAV_Exception(); } + } catch (\OCP\Files\NotPermittedException $e) { + throw new Sabre_DAV_Exception_Forbidden(); } // rename to correct path - \OC\Files\Filesystem::rename($partpath, $this->path); + $renameOkay = $fs->rename($partpath, $this->path); + $fileExists = $fs->file_exists($this->path); + if ($renameOkay === false || $fileExists === false) { + \OC_Log::write('webdav', '\OC\Files\Filesystem::rename() failed', \OC_Log::ERROR); + $fs->unlink($partpath); + throw new Sabre_DAV_Exception(); + } - //allow sync clients to send the mtime along in a header + // allow sync clients to send the mtime along in a header $mtime = OC_Request::hasModificationTime(); if ($mtime !== false) { - if (\OC\Files\Filesystem::touch($this->path, $mtime)) { + if($fs->touch($this->path, $mtime)) { header('X-OC-MTime: accepted'); } } - return OC_Connector_Sabre_Node::getETagPropertyForPath($this->path); + return $this->getETagPropertyForPath($this->path); } /** @@ -94,7 +128,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D */ public function get() { - //throw execption if encryption is disabled but files are still encrypted + //throw exception if encryption is disabled but files are still encrypted if (\OC_Util::encryptedFiles()) { throw new \Sabre_DAV_Exception_ServiceUnavailable(); } else { @@ -137,7 +171,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D * * An ETag is a unique identifier representing the current version of the * file. If the file changes, the ETag MUST change. The ETag is an - * arbritrary string, but MUST be surrounded by double-quotes. + * arbitrary string, but MUST be surrounded by double-quotes. * * Return null if the ETag can not effectively be determined * diff --git a/lib/connector/sabre/locks.php b/lib/private/connector/sabre/locks.php index 69496c15ada..69496c15ada 100644 --- a/lib/connector/sabre/locks.php +++ b/lib/private/connector/sabre/locks.php diff --git a/lib/connector/sabre/maintenanceplugin.php b/lib/private/connector/sabre/maintenanceplugin.php index 2eda269afc2..2eda269afc2 100644 --- a/lib/connector/sabre/maintenanceplugin.php +++ b/lib/private/connector/sabre/maintenanceplugin.php diff --git a/lib/connector/sabre/node.php b/lib/private/connector/sabre/node.php index 0bffa58af78..fa27abb381a 100644 --- a/lib/connector/sabre/node.php +++ b/lib/private/connector/sabre/node.php @@ -33,6 +33,13 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr public static $ETagFunction = null; /** + * is kept public to allow overwrite for unit testing + * + * @var \OC\Files\View + */ + public $fileView; + + /** * The path to the current node * * @var string @@ -78,6 +85,11 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr */ public function setName($name) { + // rename is only allowed if the update privilege is granted + if (!\OC\Files\Filesystem::isUpdatable($this->path)) { + throw new \Sabre_DAV_Exception_Forbidden(); + } + list($parentPath, ) = Sabre_DAV_URLUtil::splitPath($this->path); list(, $newName) = Sabre_DAV_URLUtil::splitPath($name); @@ -135,6 +147,12 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr * Even if the modification time is set to a custom value the access time is set to now. */ public function touch($mtime) { + + // touch is only allowed if the update privilege is granted + if (!\OC\Files\Filesystem::isUpdatable($this->path)) { + throw new \Sabre_DAV_Exception_Forbidden(); + } + \OC\Files\Filesystem::touch($this->path, $mtime); } @@ -196,7 +214,14 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr while( $row = $result->fetchRow()) { $this->property_cache[$row['propertyname']] = $row['propertyvalue']; } - $this->property_cache[self::GETETAG_PROPERTYNAME] = $this->getETagPropertyForPath($this->path); + + // Don't call the static getETagPropertyForPath, its result is not cached + $this->getFileinfoCache(); + if ($this->fileinfo_cache['etag']) { + $this->property_cache[self::GETETAG_PROPERTYNAME] = '"'.$this->fileinfo_cache['etag'].'"'; + } else { + $this->property_cache[self::GETETAG_PROPERTYNAME] = null; + } } // if the array was empty, we need to return everything @@ -216,12 +241,18 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr * @param string $path Path of the file * @return string|null Returns null if the ETag can not effectively be determined */ - static public function getETagPropertyForPath($path) { - $data = \OC\Files\Filesystem::getFileInfo($path); + protected function getETagPropertyForPath($path) { + $data = $this->getFS()->getFileInfo($path); if (isset($data['etag'])) { return '"'.$data['etag'].'"'; } return null; } + protected function getFS() { + if (is_null($this->fileView)) { + $this->fileView = \OC\Files\Filesystem::getView(); + } + return $this->fileView; + } } diff --git a/lib/connector/sabre/objecttree.php b/lib/private/connector/sabre/objecttree.php index acff45ed5e2..df8902f66e2 100644 --- a/lib/connector/sabre/objecttree.php +++ b/lib/private/connector/sabre/objecttree.php @@ -11,6 +11,14 @@ namespace OC\Connector\Sabre; use OC\Files\Filesystem; class ObjectTree extends \Sabre_DAV_ObjectTree { + + /** + * keep this public to allow mock injection during unit test + * + * @var \OC\Files\View + */ + public $fileView; + /** * Returns the INode object for the requested path * @@ -21,14 +29,16 @@ class ObjectTree extends \Sabre_DAV_ObjectTree { public function getNodeForPath($path) { $path = trim($path, '/'); - if (isset($this->cache[$path])) return $this->cache[$path]; + if (isset($this->cache[$path])) { + return $this->cache[$path]; + } // Is it the root node? if (!strlen($path)) { return $this->rootNode; } - $info = Filesystem::getFileInfo($path); + $info = $this->getFileView()->getFileInfo($path); if (!$info) { throw new \Sabre_DAV_Exception_NotFound('File with name ' . $path . ' could not be located'); @@ -64,7 +74,28 @@ class ObjectTree extends \Sabre_DAV_ObjectTree { list($sourceDir,) = \Sabre_DAV_URLUtil::splitPath($sourcePath); list($destinationDir,) = \Sabre_DAV_URLUtil::splitPath($destinationPath); - Filesystem::rename($sourcePath, $destinationPath); + // check update privileges + $fs = $this->getFileView(); + if (!$fs->isUpdatable($sourcePath)) { + throw new \Sabre_DAV_Exception_Forbidden(); + } + if ($sourceDir !== $destinationDir) { + // for a full move we need update privileges on sourcePath and sourceDir as well as destinationDir + if (!$fs->isUpdatable($sourceDir)) { + throw new \Sabre_DAV_Exception_Forbidden(); + } + if (!$fs->isUpdatable($destinationDir)) { + throw new \Sabre_DAV_Exception_Forbidden(); + } + if (!$fs->isDeletable($sourcePath)) { + throw new \Sabre_DAV_Exception_Forbidden(); + } + } + + $renameOkay = $fs->rename($sourcePath, $destinationPath); + if (!$renameOkay) { + throw new \Sabre_DAV_Exception_Forbidden(''); + } $this->markDirty($sourceDir); $this->markDirty($destinationDir); @@ -101,4 +132,14 @@ class ObjectTree extends \Sabre_DAV_ObjectTree { list($destinationDir,) = \Sabre_DAV_URLUtil::splitPath($destination); $this->markDirty($destinationDir); } + + /** + * @return \OC\Files\View + */ + public function getFileView() { + if (is_null($this->fileView)) { + $this->fileView = \OC\Files\Filesystem::getView(); + } + return $this->fileView; + } } diff --git a/lib/connector/sabre/principal.php b/lib/private/connector/sabre/principal.php index 59a96797c16..59a96797c16 100644 --- a/lib/connector/sabre/principal.php +++ b/lib/private/connector/sabre/principal.php diff --git a/lib/connector/sabre/quotaplugin.php b/lib/private/connector/sabre/quotaplugin.php index ea2cb81d1f7..ea2cb81d1f7 100644 --- a/lib/connector/sabre/quotaplugin.php +++ b/lib/private/connector/sabre/quotaplugin.php diff --git a/lib/connector/sabre/request.php b/lib/private/connector/sabre/request.php index d70c25c4e70..d70c25c4e70 100644 --- a/lib/connector/sabre/request.php +++ b/lib/private/connector/sabre/request.php diff --git a/lib/contactsmanager.php b/lib/private/contactsmanager.php index fc6745b4505..fc6745b4505 100644 --- a/lib/contactsmanager.php +++ b/lib/private/contactsmanager.php diff --git a/lib/db.php b/lib/private/db.php index 1e5d12649df..1e5d12649df 100644 --- a/lib/db.php +++ b/lib/private/db.php diff --git a/lib/db/adapter.php b/lib/private/db/adapter.php index 6b31f37dd98..6b31f37dd98 100644 --- a/lib/db/adapter.php +++ b/lib/private/db/adapter.php diff --git a/lib/db/adapteroci8.php b/lib/private/db/adapteroci8.php index bc226e979ec..bc226e979ec 100644 --- a/lib/db/adapteroci8.php +++ b/lib/private/db/adapteroci8.php diff --git a/lib/db/adapterpgsql.php b/lib/private/db/adapterpgsql.php index 990d71c9f29..990d71c9f29 100644 --- a/lib/db/adapterpgsql.php +++ b/lib/private/db/adapterpgsql.php diff --git a/lib/db/adaptersqlite.php b/lib/private/db/adaptersqlite.php index fa6d308ae32..fa6d308ae32 100644 --- a/lib/db/adaptersqlite.php +++ b/lib/private/db/adaptersqlite.php diff --git a/lib/db/adaptersqlsrv.php b/lib/private/db/adaptersqlsrv.php index d0a67af28a7..d0a67af28a7 100644 --- a/lib/db/adaptersqlsrv.php +++ b/lib/private/db/adaptersqlsrv.php diff --git a/lib/db/connection.php b/lib/private/db/connection.php index 2d3193a148a..2d3193a148a 100644 --- a/lib/db/connection.php +++ b/lib/private/db/connection.php diff --git a/lib/db/mdb2schemamanager.php b/lib/private/db/mdb2schemamanager.php index 8e76f46c78f..8e76f46c78f 100644 --- a/lib/db/mdb2schemamanager.php +++ b/lib/private/db/mdb2schemamanager.php diff --git a/lib/db/mdb2schemareader.php b/lib/private/db/mdb2schemareader.php index b7128a2f176..b7128a2f176 100644 --- a/lib/db/mdb2schemareader.php +++ b/lib/private/db/mdb2schemareader.php diff --git a/lib/db/mdb2schemawriter.php b/lib/private/db/mdb2schemawriter.php index 21b43cbfe80..21b43cbfe80 100644 --- a/lib/db/mdb2schemawriter.php +++ b/lib/private/db/mdb2schemawriter.php diff --git a/lib/db/oracleconnection.php b/lib/private/db/oracleconnection.php index e2fc4644f47..e2fc4644f47 100644 --- a/lib/db/oracleconnection.php +++ b/lib/private/db/oracleconnection.php diff --git a/lib/db/statementwrapper.php b/lib/private/db/statementwrapper.php index b8da1afc0e5..b8da1afc0e5 100644 --- a/lib/db/statementwrapper.php +++ b/lib/private/db/statementwrapper.php diff --git a/lib/defaults.php b/lib/private/defaults.php index 10813a3e8d8..4951c6f50ae 100644 --- a/lib/defaults.php +++ b/lib/private/defaults.php @@ -13,6 +13,7 @@ if (file_exists(OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults. class OC_Defaults { private $theme; + private $l; private $defaultEntity; private $defaultName; @@ -24,7 +25,7 @@ class OC_Defaults { private $defaultLogoClaim; function __construct() { - $l = OC_L10N::get('core'); + $this->l = OC_L10N::get('core'); $this->defaultEntity = "ownCloud"; /* e.g. company name, used for footers and copyright notices */ $this->defaultName = "ownCloud"; /* short name, used when referring to the software */ @@ -32,7 +33,7 @@ class OC_Defaults { $this->defaultBaseUrl = "http://owncloud.org"; $this->defaultSyncClientUrl = " http://owncloud.org/sync-clients/"; $this->defaultDocBaseUrl = "http://doc.owncloud.org"; - $this->defaultSlogan = $l->t("web services under your control"); + $this->defaultSlogan = $this->l->t("web services under your control"); $this->defaultLogoClaim = ""; if (class_exists("OC_Theme")) { diff --git a/lib/eventsource.php b/lib/private/eventsource.php index a83084d9251..a83084d9251 100644 --- a/lib/eventsource.php +++ b/lib/private/eventsource.php diff --git a/lib/filechunking.php b/lib/private/filechunking.php index 313a6ee87d2..313a6ee87d2 100644 --- a/lib/filechunking.php +++ b/lib/private/filechunking.php diff --git a/lib/fileproxy.php b/lib/private/fileproxy.php index 52ec79b4bdb..52ec79b4bdb 100644 --- a/lib/fileproxy.php +++ b/lib/private/fileproxy.php diff --git a/lib/fileproxy/fileoperations.php b/lib/private/fileproxy/fileoperations.php index b2ff2e7e5e9..b2ff2e7e5e9 100644 --- a/lib/fileproxy/fileoperations.php +++ b/lib/private/fileproxy/fileoperations.php diff --git a/lib/files.php b/lib/private/files.php index c705d2adb1a..c705d2adb1a 100644 --- a/lib/files.php +++ b/lib/private/files.php diff --git a/lib/files/cache/backgroundwatcher.php b/lib/private/files/cache/backgroundwatcher.php index 923804f48d0..923804f48d0 100644 --- a/lib/files/cache/backgroundwatcher.php +++ b/lib/private/files/cache/backgroundwatcher.php diff --git a/lib/files/cache/cache.php b/lib/private/files/cache/cache.php index e69733727af..364a50d377c 100644 --- a/lib/files/cache/cache.php +++ b/lib/private/files/cache/cache.php @@ -34,8 +34,8 @@ class Cache { */ private $storageCache; - private $mimetypeIds = array(); - private $mimetypes = array(); + private static $mimetypeIds = array(); + private static $mimetypes = array(); /** * @param \OC\Files\Storage\Storage|string $storage @@ -64,30 +64,35 @@ class Cache { * @return int */ public function getMimetypeId($mime) { - if (!isset($this->mimetypeIds[$mime])) { - $result = \OC_DB::executeAudited('SELECT `id` FROM `*PREFIX*mimetypes` WHERE `mimetype` = ?', array($mime)); - if ($row = $result->fetchRow()) { - $this->mimetypeIds[$mime] = $row['id']; - } else { - $result = \OC_DB::executeAudited('INSERT INTO `*PREFIX*mimetypes`(`mimetype`) VALUES(?)', array($mime)); - $this->mimetypeIds[$mime] = \OC_DB::insertid('*PREFIX*mimetypes'); - } - $this->mimetypes[$this->mimetypeIds[$mime]] = $mime; + if (empty(self::$mimetypeIds)) { + $this->loadMimetypes(); } - return $this->mimetypeIds[$mime]; + + if (!isset(self::$mimetypeIds[$mime])) { + $result = \OC_DB::executeAudited('INSERT INTO `*PREFIX*mimetypes`(`mimetype`) VALUES(?)', array($mime)); + self::$mimetypeIds[$mime] = \OC_DB::insertid('*PREFIX*mimetypes'); + self::$mimetypes[self::$mimetypeIds[$mime]] = $mime; + } + + return self::$mimetypeIds[$mime]; } public function getMimetype($id) { - if (!isset($this->mimetypes[$id])) { - $sql = 'SELECT `mimetype` FROM `*PREFIX*mimetypes` WHERE `id` = ?'; - $result = \OC_DB::executeAudited($sql, array($id)); - if ($row = $result->fetchRow()) { - $this->mimetypes[$id] = $row['mimetype']; - } else { - return null; - } + if (empty(self::$mimetypes)) { + $this->loadMimetypes(); } - return $this->mimetypes[$id]; + + return isset(self::$mimetypes[$id]) ? self::$mimetypes[$id] : null; + } + + protected function loadMimetypes(){ + $result = \OC_DB::executeAudited('SELECT `id`, `mimetype` FROM `*PREFIX*mimetypes`', array()); + if ($result) { + while ($row = $result->fetchRow()) { + self::$mimetypeIds[$row['mimetype']] = $row['id']; + self::$mimetypes[$row['id']] = $row['mimetype']; + } + } } /** diff --git a/lib/files/cache/legacy.php b/lib/private/files/cache/legacy.php index 8eed1f67a5d..8eed1f67a5d 100644 --- a/lib/files/cache/legacy.php +++ b/lib/private/files/cache/legacy.php diff --git a/lib/files/cache/permissions.php b/lib/private/files/cache/permissions.php index 2e2bdb20b78..2e2bdb20b78 100644 --- a/lib/files/cache/permissions.php +++ b/lib/private/files/cache/permissions.php diff --git a/lib/files/cache/scanner.php b/lib/private/files/cache/scanner.php index 96f84609cf2..96f84609cf2 100644 --- a/lib/files/cache/scanner.php +++ b/lib/private/files/cache/scanner.php diff --git a/lib/files/cache/storage.php b/lib/private/files/cache/storage.php index 8a9e47ca36d..8a9e47ca36d 100644 --- a/lib/files/cache/storage.php +++ b/lib/private/files/cache/storage.php diff --git a/lib/files/cache/updater.php b/lib/private/files/cache/updater.php index 1f30173a8f8..1f30173a8f8 100644 --- a/lib/files/cache/updater.php +++ b/lib/private/files/cache/updater.php diff --git a/lib/files/cache/upgrade.php b/lib/private/files/cache/upgrade.php index cfb9a117311..e3a46896cbf 100644 --- a/lib/files/cache/upgrade.php +++ b/lib/private/files/cache/upgrade.php @@ -192,7 +192,15 @@ class Upgrade { */ static function needUpgrade($user) { $cacheVersion = (int)\OCP\Config::getUserValue($user, 'files', 'cache_version', 4); - return $cacheVersion < 5; + if ($cacheVersion < 5) { + $legacy = new \OC\Files\Cache\Legacy($user); + if ($legacy->hasItems()) { + return true; + } + self::upgradeDone($user); + } + + return false; } /** diff --git a/lib/files/cache/watcher.php b/lib/private/files/cache/watcher.php index 8bfd4602f3a..8bfd4602f3a 100644 --- a/lib/files/cache/watcher.php +++ b/lib/private/files/cache/watcher.php diff --git a/lib/files/filesystem.php b/lib/private/files/filesystem.php index 10ec5c41d11..10ec5c41d11 100644 --- a/lib/files/filesystem.php +++ b/lib/private/files/filesystem.php diff --git a/lib/files/mapper.php b/lib/private/files/mapper.php index 47abd4e52fe..47abd4e52fe 100644 --- a/lib/files/mapper.php +++ b/lib/private/files/mapper.php diff --git a/lib/files/mount/manager.php b/lib/private/files/mount/manager.php index 4c432dcf724..4c432dcf724 100644 --- a/lib/files/mount/manager.php +++ b/lib/private/files/mount/manager.php diff --git a/lib/files/mount/mount.php b/lib/private/files/mount/mount.php index 0ce2f5975c7..0ce2f5975c7 100644 --- a/lib/files/mount/mount.php +++ b/lib/private/files/mount/mount.php diff --git a/lib/files/node/file.php b/lib/private/files/node/file.php index 75d5e0166b6..75d5e0166b6 100644 --- a/lib/files/node/file.php +++ b/lib/private/files/node/file.php diff --git a/lib/files/node/folder.php b/lib/private/files/node/folder.php index 923f53821b2..923f53821b2 100644 --- a/lib/files/node/folder.php +++ b/lib/private/files/node/folder.php diff --git a/lib/files/node/node.php b/lib/private/files/node/node.php index 063e2424a64..063e2424a64 100644 --- a/lib/files/node/node.php +++ b/lib/private/files/node/node.php diff --git a/lib/files/node/nonexistingfile.php b/lib/private/files/node/nonexistingfile.php index d45076f7fee..d45076f7fee 100644 --- a/lib/files/node/nonexistingfile.php +++ b/lib/private/files/node/nonexistingfile.php diff --git a/lib/files/node/nonexistingfolder.php b/lib/private/files/node/nonexistingfolder.php index 0346cbf1e21..0346cbf1e21 100644 --- a/lib/files/node/nonexistingfolder.php +++ b/lib/private/files/node/nonexistingfolder.php diff --git a/lib/files/node/root.php b/lib/private/files/node/root.php index e3d58476e9c..e3d58476e9c 100644 --- a/lib/files/node/root.php +++ b/lib/private/files/node/root.php diff --git a/lib/files/storage/common.php b/lib/private/files/storage/common.php index a5b79f0e967..a5b79f0e967 100644 --- a/lib/files/storage/common.php +++ b/lib/private/files/storage/common.php diff --git a/lib/files/storage/commontest.php b/lib/private/files/storage/commontest.php index c3f1eb31955..c3f1eb31955 100644 --- a/lib/files/storage/commontest.php +++ b/lib/private/files/storage/commontest.php diff --git a/lib/files/storage/loader.php b/lib/private/files/storage/loader.php index 2572ef443bc..2572ef443bc 100644 --- a/lib/files/storage/loader.php +++ b/lib/private/files/storage/loader.php diff --git a/lib/files/storage/local.php b/lib/private/files/storage/local.php index 5209fabc30a..5209fabc30a 100644 --- a/lib/files/storage/local.php +++ b/lib/private/files/storage/local.php diff --git a/lib/files/storage/mappedlocal.php b/lib/private/files/storage/mappedlocal.php index ba5ac4191c5..ba5ac4191c5 100644 --- a/lib/files/storage/mappedlocal.php +++ b/lib/private/files/storage/mappedlocal.php diff --git a/lib/files/storage/storage.php b/lib/private/files/storage/storage.php index b673bb9a32d..b673bb9a32d 100644 --- a/lib/files/storage/storage.php +++ b/lib/private/files/storage/storage.php diff --git a/lib/files/storage/temporary.php b/lib/private/files/storage/temporary.php index d84dbda2e39..d84dbda2e39 100644 --- a/lib/files/storage/temporary.php +++ b/lib/private/files/storage/temporary.php diff --git a/lib/files/storage/wrapper/quota.php b/lib/private/files/storage/wrapper/quota.php index e2da8cf2e05..e2da8cf2e05 100644 --- a/lib/files/storage/wrapper/quota.php +++ b/lib/private/files/storage/wrapper/quota.php diff --git a/lib/files/storage/wrapper/wrapper.php b/lib/private/files/storage/wrapper/wrapper.php index 0336c27efa1..0336c27efa1 100644 --- a/lib/files/storage/wrapper/wrapper.php +++ b/lib/private/files/storage/wrapper/wrapper.php diff --git a/lib/files/stream/close.php b/lib/private/files/stream/close.php index 80de3497c36..80de3497c36 100644 --- a/lib/files/stream/close.php +++ b/lib/private/files/stream/close.php diff --git a/lib/files/stream/dir.php b/lib/private/files/stream/dir.php index 6ca884fc994..6ca884fc994 100644 --- a/lib/files/stream/dir.php +++ b/lib/private/files/stream/dir.php diff --git a/lib/files/stream/oc.php b/lib/private/files/stream/oc.php index 88e7e062df9..88e7e062df9 100644 --- a/lib/files/stream/oc.php +++ b/lib/private/files/stream/oc.php diff --git a/lib/files/stream/quota.php b/lib/private/files/stream/quota.php index 53d8a03d30f..53d8a03d30f 100644 --- a/lib/files/stream/quota.php +++ b/lib/private/files/stream/quota.php diff --git a/lib/files/stream/staticstream.php b/lib/private/files/stream/staticstream.php index 45b1a7a81f8..45b1a7a81f8 100644 --- a/lib/files/stream/staticstream.php +++ b/lib/private/files/stream/staticstream.php diff --git a/lib/files/type/detection.php b/lib/private/files/type/detection.php index 242a81cb5a4..242a81cb5a4 100644 --- a/lib/files/type/detection.php +++ b/lib/private/files/type/detection.php diff --git a/lib/files/type/templatemanager.php b/lib/private/files/type/templatemanager.php index cd1536d2732..cd1536d2732 100644 --- a/lib/files/type/templatemanager.php +++ b/lib/private/files/type/templatemanager.php diff --git a/lib/files/utils/scanner.php b/lib/private/files/utils/scanner.php index 2cad7dd77bd..2cad7dd77bd 100644 --- a/lib/files/utils/scanner.php +++ b/lib/private/files/utils/scanner.php diff --git a/lib/files/view.php b/lib/private/files/view.php index aa08a5f7cc9..aa08a5f7cc9 100644 --- a/lib/files/view.php +++ b/lib/private/files/view.php diff --git a/lib/geo.php b/lib/private/geo.php index ed01ad0b616..ed01ad0b616 100644 --- a/lib/geo.php +++ b/lib/private/geo.php diff --git a/lib/group.php b/lib/private/group.php index ba93dc129a1..ba93dc129a1 100644 --- a/lib/group.php +++ b/lib/private/group.php diff --git a/lib/group/backend.php b/lib/private/group/backend.php index 2e17b5d0b7f..2e17b5d0b7f 100644 --- a/lib/group/backend.php +++ b/lib/private/group/backend.php diff --git a/lib/group/database.php b/lib/private/group/database.php index d0974685ff6..d0974685ff6 100644 --- a/lib/group/database.php +++ b/lib/private/group/database.php diff --git a/lib/group/dummy.php b/lib/private/group/dummy.php index 9516fd52ff8..9516fd52ff8 100644 --- a/lib/group/dummy.php +++ b/lib/private/group/dummy.php diff --git a/lib/group/example.php b/lib/private/group/example.php index 3519b9ed92f..3519b9ed92f 100644 --- a/lib/group/example.php +++ b/lib/private/group/example.php diff --git a/lib/group/group.php b/lib/private/group/group.php index bcd2419b309..bcd2419b309 100644 --- a/lib/group/group.php +++ b/lib/private/group/group.php diff --git a/lib/group/interface.php b/lib/private/group/interface.php index 4ef3663837f..4ef3663837f 100644 --- a/lib/group/interface.php +++ b/lib/private/group/interface.php diff --git a/lib/group/manager.php b/lib/private/group/manager.php index bf469d51d12..bf469d51d12 100644 --- a/lib/group/manager.php +++ b/lib/private/group/manager.php diff --git a/lib/helper.php b/lib/private/helper.php index 66e7acb407a..a34640d8e36 100644 --- a/lib/helper.php +++ b/lib/private/helper.php @@ -41,8 +41,7 @@ class OC_Helper { * Returns a url to the given app and file. */ public static function linkToRoute($route, $parameters = array()) { - $urlLinkTo = OC::getRouter()->generate($route, $parameters); - return $urlLinkTo; + return OC::$server->getURLGenerator()->linkToRoute($route, $parameters); } /** @@ -56,32 +55,7 @@ class OC_Helper { * Returns a url to the given app and file. */ public static function linkTo( $app, $file, $args = array() ) { - if( $app != '' ) { - $app_path = OC_App::getAppPath($app); - // Check if the app is in the app folder - if ($app_path && file_exists($app_path . '/' . $file)) { - if (substr($file, -3) == 'php' || substr($file, -3) == 'css') { - $urlLinkTo = OC::$WEBROOT . '/index.php/apps/' . $app; - $urlLinkTo .= ($file != 'index.php') ? '/' . $file : ''; - } else { - $urlLinkTo = OC_App::getAppWebPath($app) . '/' . $file; - } - } else { - $urlLinkTo = OC::$WEBROOT . '/' . $app . '/' . $file; - } - } else { - if (file_exists(OC::$SERVERROOT . '/core/' . $file)) { - $urlLinkTo = OC::$WEBROOT . '/core/' . $file; - } else { - $urlLinkTo = OC::$WEBROOT . '/' . $file; - } - } - - if ($args && $query = http_build_query($args, '', '&')) { - $urlLinkTo .= '?' . $query; - } - - return $urlLinkTo; + return OC::$server->getURLGenerator()->linkTo($app, $file, $args); } /** @@ -107,7 +81,7 @@ class OC_Helper { * Returns a absolute url to the given app and file. */ public static function makeURLAbsolute($url) { - return OC_Request::serverProtocol() . '://' . OC_Request::serverHost() . $url; + return OC::$server->getURLGenerator()->makeURLAbsolute($url); } /** @@ -156,25 +130,7 @@ class OC_Helper { * Returns the path to the image. */ public static function imagePath($app, $image) { - // Read the selected theme from the config file - $theme = OC_Util::getTheme(); - - // Check if the app is in the app folder - if (file_exists(OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) { - return OC::$WEBROOT . "/themes/$theme/apps/$app/img/$image"; - } elseif (file_exists(OC_App::getAppPath($app) . "/img/$image")) { - return OC_App::getAppWebPath($app) . "/img/$image"; - } elseif (!empty($app) and file_exists(OC::$SERVERROOT . "/themes/$theme/$app/img/$image")) { - return OC::$WEBROOT . "/themes/$theme/$app/img/$image"; - } elseif (!empty($app) and file_exists(OC::$SERVERROOT . "/$app/img/$image")) { - return OC::$WEBROOT . "/$app/img/$image"; - } elseif (file_exists(OC::$SERVERROOT . "/themes/$theme/core/img/$image")) { - return OC::$WEBROOT . "/themes/$theme/core/img/$image"; - } elseif (file_exists(OC::$SERVERROOT . "/core/img/$image")) { - return OC::$WEBROOT . "/core/img/$image"; - } else { - throw new RuntimeException('image not found: image:' . $image . ' webroot:' . OC::$WEBROOT . ' serverroot:' . OC::$SERVERROOT); - } + return OC::$server->getURLGenerator()->imagePath($app, $image); } /** diff --git a/lib/hintexception.php b/lib/private/hintexception.php index 3934ae2a4c2..3934ae2a4c2 100644 --- a/lib/hintexception.php +++ b/lib/private/hintexception.php diff --git a/lib/hook.php b/lib/private/hook.php index 8516cf0dcff..8516cf0dcff 100644 --- a/lib/hook.php +++ b/lib/private/hook.php diff --git a/lib/hooks/basicemitter.php b/lib/private/hooks/basicemitter.php index 9ffe1af2314..9ffe1af2314 100644 --- a/lib/hooks/basicemitter.php +++ b/lib/private/hooks/basicemitter.php diff --git a/lib/hooks/emitter.php b/lib/private/hooks/emitter.php index 8e9074bad67..8e9074bad67 100644 --- a/lib/hooks/emitter.php +++ b/lib/private/hooks/emitter.php diff --git a/lib/hooks/forwardingemitter.php b/lib/private/hooks/forwardingemitter.php index 1aacc4012e0..1aacc4012e0 100644 --- a/lib/hooks/forwardingemitter.php +++ b/lib/private/hooks/forwardingemitter.php diff --git a/lib/hooks/legacyemitter.php b/lib/private/hooks/legacyemitter.php index a2d16ace9a7..a2d16ace9a7 100644 --- a/lib/hooks/legacyemitter.php +++ b/lib/private/hooks/legacyemitter.php diff --git a/lib/hooks/publicemitter.php b/lib/private/hooks/publicemitter.php index e2371713ac3..e2371713ac3 100644 --- a/lib/hooks/publicemitter.php +++ b/lib/private/hooks/publicemitter.php diff --git a/lib/image.php b/lib/private/image.php index 7761a3c7737..7761a3c7737 100644 --- a/lib/image.php +++ b/lib/private/image.php diff --git a/lib/installer.php b/lib/private/installer.php index e082c7eeee9..e082c7eeee9 100644 --- a/lib/installer.php +++ b/lib/private/installer.php diff --git a/lib/json.php b/lib/private/json.php index 6ba0b13806b..6ba0b13806b 100644 --- a/lib/json.php +++ b/lib/private/json.php diff --git a/lib/l10n.php b/lib/private/l10n.php index f93443b886a..3e84c306dc2 100644 --- a/lib/l10n.php +++ b/lib/private/l10n.php @@ -25,12 +25,7 @@ /** * This class is for i18n and l10n */ -class OC_L10N { - /** - * cached instances - */ - protected static $instances=array(); - +class OC_L10N implements \OCP\IL10N { /** * cache */ @@ -83,13 +78,10 @@ class OC_L10N { * @return OC_L10N */ public static function get($app, $lang=null) { - if(is_null($lang)) { - if(!isset(self::$instances[$app])) { - self::$instances[$app]=new OC_L10N($app); - } - return self::$instances[$app]; - }else{ - return new OC_L10N($app, $lang); + if (is_null($lang)) { + return OC::$server->getL10N($app); + } else { + return new \OC_L10N($app, $lang); } } diff --git a/lib/private/l10n/factory.php b/lib/private/l10n/factory.php new file mode 100644 index 00000000000..ba168872acd --- /dev/null +++ b/lib/private/l10n/factory.php @@ -0,0 +1,34 @@ +<?php +/** + * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + * + */ + +namespace OC\L10N; + +/** + * TODO: Description + */ +class Factory { + /** + * cached instances + */ + protected $instances = array(); + + /** + * get an L10N instance + * @param $app string + * @param $lang string|null + * @return OC_L10N + */ + public function get($app) { + if (!isset($this->instances[$app])) { + $this->instances[$app] = new \OC_L10N($app); + } + return $this->instances[$app]; + } + +} diff --git a/lib/l10n/string.php b/lib/private/l10n/string.php index 88c85b32e70..88c85b32e70 100644 --- a/lib/l10n/string.php +++ b/lib/private/l10n/string.php diff --git a/lib/legacy/cache.php b/lib/private/legacy/cache.php index f915eb516b1..f915eb516b1 100644 --- a/lib/legacy/cache.php +++ b/lib/private/legacy/cache.php diff --git a/lib/private/legacy/cache/fileglobalgc.php b/lib/private/legacy/cache/fileglobalgc.php new file mode 100644 index 00000000000..385f6406673 --- /dev/null +++ b/lib/private/legacy/cache/fileglobalgc.php @@ -0,0 +1,4 @@ +<?php + +class OC_Cache_FileGlobalGC extends OC\Cache\FileGlobalGC{ +} diff --git a/lib/legacy/config.php b/lib/private/legacy/config.php index 7e498013737..c457979113e 100644 --- a/lib/legacy/config.php +++ b/lib/private/legacy/config.php @@ -83,11 +83,7 @@ class OC_Config { * */ public static function setValue($key, $value) { - try { - self::$object->setValue($key, $value); - } catch (\OC\HintException $e) { - \OC_Template::printErrorPage($e->getMessage(), $e->getHint()); - } + self::$object->setValue($key, $value); } /** @@ -98,10 +94,6 @@ class OC_Config { * */ public static function deleteKey($key) { - try { - self::$object->deleteKey($key); - } catch (\OC\HintException $e) { - \OC_Template::printErrorPage($e->getMessage(), $e->getHint()); - } + self::$object->deleteKey($key); } } diff --git a/lib/legacy/filesystem.php b/lib/private/legacy/filesystem.php index 34f92b357ca..34f92b357ca 100644 --- a/lib/legacy/filesystem.php +++ b/lib/private/legacy/filesystem.php diff --git a/lib/legacy/filesystemview.php b/lib/private/legacy/filesystemview.php index d6bca62e06a..d6bca62e06a 100644 --- a/lib/legacy/filesystemview.php +++ b/lib/private/legacy/filesystemview.php diff --git a/lib/legacy/log.php b/lib/private/legacy/log.php index 027cb89e97c..027cb89e97c 100644 --- a/lib/legacy/log.php +++ b/lib/private/legacy/log.php diff --git a/lib/legacy/preferences.php b/lib/private/legacy/preferences.php index a663db7598b..a663db7598b 100644 --- a/lib/legacy/preferences.php +++ b/lib/private/legacy/preferences.php diff --git a/lib/legacy/updater.php b/lib/private/legacy/updater.php index eea7bb129cf..eea7bb129cf 100644 --- a/lib/legacy/updater.php +++ b/lib/private/legacy/updater.php diff --git a/lib/log.php b/lib/private/log.php index e0b9fe3c696..e0b9fe3c696 100644 --- a/lib/log.php +++ b/lib/private/log.php diff --git a/lib/log/errorhandler.php b/lib/private/log/errorhandler.php index 69cb960de91..69cb960de91 100644 --- a/lib/log/errorhandler.php +++ b/lib/private/log/errorhandler.php diff --git a/lib/log/owncloud.php b/lib/private/log/owncloud.php index d16b9537a16..f3b43584409 100644 --- a/lib/log/owncloud.php +++ b/lib/private/log/owncloud.php @@ -51,8 +51,14 @@ class OC_Log_Owncloud { if($level>=$minLevel) { // default to ISO8601 $format = OC_Config::getValue('logdateformat', 'c'); - $time = date($format, time()); - $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time); + $logtimezone=OC_Config::getValue( "logtimezone", 'UTC' ); + try { + $timezone = new DateTimeZone($logtimezone); + } catch (Exception $e) { + $timezone = new DateTimeZone('UTC'); + } + $time = new DateTime(null, $timezone); + $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time->format($format)); $handle = @fopen(self::$logFile, 'a'); if ($handle) { fwrite($handle, json_encode($entry)."\n"); diff --git a/lib/log/rotate.php b/lib/private/log/rotate.php index bf23ad588b3..bf23ad588b3 100644 --- a/lib/log/rotate.php +++ b/lib/private/log/rotate.php diff --git a/lib/log/syslog.php b/lib/private/log/syslog.php index c98deab7109..c98deab7109 100644 --- a/lib/log/syslog.php +++ b/lib/private/log/syslog.php diff --git a/lib/mail.php b/lib/private/mail.php index b339b33e962..b339b33e962 100644 --- a/lib/mail.php +++ b/lib/private/mail.php diff --git a/lib/memcache/apc.php b/lib/private/memcache/apc.php index 575ee4427db..575ee4427db 100644 --- a/lib/memcache/apc.php +++ b/lib/private/memcache/apc.php diff --git a/lib/memcache/apcu.php b/lib/private/memcache/apcu.php index ccc1aa6e562..ccc1aa6e562 100644 --- a/lib/memcache/apcu.php +++ b/lib/private/memcache/apcu.php diff --git a/lib/memcache/cache.php b/lib/private/memcache/cache.php index 0ad1cc7ec03..0ad1cc7ec03 100644 --- a/lib/memcache/cache.php +++ b/lib/private/memcache/cache.php diff --git a/lib/memcache/factory.php b/lib/private/memcache/factory.php index fde7d947567..fde7d947567 100644 --- a/lib/memcache/factory.php +++ b/lib/private/memcache/factory.php diff --git a/lib/memcache/memcached.php b/lib/private/memcache/memcached.php index 978e6c2eff1..978e6c2eff1 100644 --- a/lib/memcache/memcached.php +++ b/lib/private/memcache/memcached.php diff --git a/lib/memcache/xcache.php b/lib/private/memcache/xcache.php index 33de30562f9..33de30562f9 100644 --- a/lib/memcache/xcache.php +++ b/lib/private/memcache/xcache.php diff --git a/lib/migrate.php b/lib/private/migrate.php index 0b319177400..0b319177400 100644 --- a/lib/migrate.php +++ b/lib/private/migrate.php diff --git a/lib/migration/content.php b/lib/private/migration/content.php index 4413d722731..4413d722731 100644 --- a/lib/migration/content.php +++ b/lib/private/migration/content.php diff --git a/lib/migration/provider.php b/lib/private/migration/provider.php index 234ab3351f3..234ab3351f3 100644 --- a/lib/migration/provider.php +++ b/lib/private/migration/provider.php diff --git a/lib/mimetypes.list.php b/lib/private/mimetypes.list.php index 8ab8ac81bd8..8ab8ac81bd8 100644 --- a/lib/mimetypes.list.php +++ b/lib/private/mimetypes.list.php diff --git a/lib/minimizer.php b/lib/private/minimizer.php index db522de74dc..db522de74dc 100644 --- a/lib/minimizer.php +++ b/lib/private/minimizer.php diff --git a/lib/minimizer/css.php b/lib/private/minimizer/css.php index 8d130572e2b..8d130572e2b 100644 --- a/lib/minimizer/css.php +++ b/lib/private/minimizer/css.php diff --git a/lib/minimizer/js.php b/lib/private/minimizer/js.php index bd2d836deb0..bd2d836deb0 100644 --- a/lib/minimizer/js.php +++ b/lib/private/minimizer/js.php diff --git a/lib/navigationmanager.php b/lib/private/navigationmanager.php index 1f657b9ad80..1f657b9ad80 100644 --- a/lib/navigationmanager.php +++ b/lib/private/navigationmanager.php diff --git a/lib/notsquareexception.php b/lib/private/notsquareexception.php index 03dba8fb25f..03dba8fb25f 100644 --- a/lib/notsquareexception.php +++ b/lib/private/notsquareexception.php diff --git a/lib/ocs.php b/lib/private/ocs.php index 93e8931ce2e..93e8931ce2e 100644 --- a/lib/ocs.php +++ b/lib/private/ocs.php diff --git a/lib/ocs/cloud.php b/lib/private/ocs/cloud.php index 2dd99319057..2dd99319057 100644 --- a/lib/ocs/cloud.php +++ b/lib/private/ocs/cloud.php diff --git a/lib/ocs/config.php b/lib/private/ocs/config.php index f19121f4b2b..f19121f4b2b 100644 --- a/lib/ocs/config.php +++ b/lib/private/ocs/config.php diff --git a/lib/ocs/person.php b/lib/private/ocs/person.php index 1c8210d0825..1c8210d0825 100644 --- a/lib/ocs/person.php +++ b/lib/private/ocs/person.php diff --git a/lib/ocs/privatedata.php b/lib/private/ocs/privatedata.php index 4dfd0a6e66e..4dfd0a6e66e 100644 --- a/lib/ocs/privatedata.php +++ b/lib/private/ocs/privatedata.php diff --git a/lib/ocs/result.php b/lib/private/ocs/result.php index 84f06fa01c7..84f06fa01c7 100644 --- a/lib/ocs/result.php +++ b/lib/private/ocs/result.php diff --git a/lib/ocsclient.php b/lib/private/ocsclient.php index 58636f806be..e35556d92b8 100644 --- a/lib/ocsclient.php +++ b/lib/private/ocsclient.php @@ -36,7 +36,12 @@ class OC_OCSClient{ * to set it in the config file or it will fallback to the default */ private static function getAppStoreURL() { - $url = OC_Config::getValue('appstoreurl', 'http://api.apps.owncloud.com/v1'); + if(OC_Util::getEditionString()===''){ + $default='http://api.apps.owncloud.com/v1'; + }else{ + $default=''; + } + $url = OC_Config::getValue('appstoreurl', $default); return($url); } diff --git a/lib/preferences.php b/lib/private/preferences.php index 359d9a83589..359d9a83589 100644 --- a/lib/preferences.php +++ b/lib/private/preferences.php diff --git a/lib/preview.php b/lib/private/preview.php index 266f7795f12..266f7795f12 100755 --- a/lib/preview.php +++ b/lib/private/preview.php diff --git a/lib/preview/image.php b/lib/private/preview/image.php index 9aec967282d..9aec967282d 100644 --- a/lib/preview/image.php +++ b/lib/private/preview/image.php diff --git a/lib/preview/movies.php b/lib/private/preview/movies.php index c318137ff0e..c318137ff0e 100644 --- a/lib/preview/movies.php +++ b/lib/private/preview/movies.php diff --git a/lib/preview/mp3.php b/lib/private/preview/mp3.php index 1eed566315c..1eed566315c 100644 --- a/lib/preview/mp3.php +++ b/lib/private/preview/mp3.php diff --git a/lib/preview/office-cl.php b/lib/private/preview/office-cl.php index 112909d6523..112909d6523 100644 --- a/lib/preview/office-cl.php +++ b/lib/private/preview/office-cl.php diff --git a/lib/preview/office-fallback.php b/lib/private/preview/office-fallback.php index e69ab0ab8cb..e69ab0ab8cb 100644 --- a/lib/preview/office-fallback.php +++ b/lib/private/preview/office-fallback.php diff --git a/lib/preview/office.php b/lib/private/preview/office.php index 5287bbd6ac1..5287bbd6ac1 100644 --- a/lib/preview/office.php +++ b/lib/private/preview/office.php diff --git a/lib/preview/pdf.php b/lib/private/preview/pdf.php index cc974b68818..cc974b68818 100644 --- a/lib/preview/pdf.php +++ b/lib/private/preview/pdf.php diff --git a/lib/preview/provider.php b/lib/private/preview/provider.php index e4a730bafc8..e4a730bafc8 100644 --- a/lib/preview/provider.php +++ b/lib/private/preview/provider.php diff --git a/lib/preview/svg.php b/lib/private/preview/svg.php index b49e51720fa..b49e51720fa 100644 --- a/lib/preview/svg.php +++ b/lib/private/preview/svg.php diff --git a/lib/preview/txt.php b/lib/private/preview/txt.php index a487330691e..77e728eb364 100644 --- a/lib/preview/txt.php +++ b/lib/private/preview/txt.php @@ -9,11 +9,21 @@ namespace OC\Preview; class TXT extends Provider { + private static $blacklist = array( + 'text/calendar', + 'text/vcard', + ); + public function getMimeType() { return '/text\/.*/'; } public function getThumbnail($path, $maxX, $maxY, $scalingup, $fileview) { + $mimetype = $fileview->getMimeType($path); + if(in_array($mimetype, self::$blacklist)) { + return false; + } + $content = $fileview->fopen($path, 'r'); $content = stream_get_contents($content); diff --git a/lib/preview/unknown.php b/lib/private/preview/unknown.php index 9e6cd68d401..9e6cd68d401 100644 --- a/lib/preview/unknown.php +++ b/lib/private/preview/unknown.php diff --git a/lib/previewmanager.php b/lib/private/previewmanager.php index ac9a866a75b..ac9a866a75b 100755 --- a/lib/previewmanager.php +++ b/lib/private/previewmanager.php diff --git a/lib/request.php b/lib/private/request.php index df33217f95d..df33217f95d 100755 --- a/lib/request.php +++ b/lib/private/request.php diff --git a/lib/response.php b/lib/private/response.php index 674176d078b..674176d078b 100644 --- a/lib/response.php +++ b/lib/private/response.php diff --git a/lib/route.php b/lib/private/route.php index 5901717c094..fb7da456b62 100644 --- a/lib/route.php +++ b/lib/private/route.php @@ -52,6 +52,14 @@ class OC_Route extends Route { } /** + * Specify PATCH as the method to use with this route + */ + public function patch() { + $this->method('PATCH'); + return $this; + } + + /** * Defaults to use for this route * * @param array $defaults The defaults diff --git a/lib/router.php b/lib/private/router.php index dbaca9e0d5d..dbaca9e0d5d 100644 --- a/lib/router.php +++ b/lib/private/router.php diff --git a/lib/search.php b/lib/private/search.php index b9c75dfc333..b9c75dfc333 100644 --- a/lib/search.php +++ b/lib/private/search.php diff --git a/lib/search/provider.php b/lib/private/search/provider.php index b617b9c5d94..b617b9c5d94 100644 --- a/lib/search/provider.php +++ b/lib/private/search/provider.php diff --git a/lib/search/provider/file.php b/lib/private/search/provider/file.php index 9bd50931517..9bd50931517 100644 --- a/lib/search/provider/file.php +++ b/lib/private/search/provider/file.php diff --git a/lib/search/result.php b/lib/private/search/result.php index 42275c2df11..42275c2df11 100644 --- a/lib/search/result.php +++ b/lib/private/search/result.php diff --git a/lib/server.php b/lib/private/server.php index b14b2e17d03..7f86919f845 100644 --- a/lib/server.php +++ b/lib/private/server.php @@ -22,14 +22,19 @@ class Server extends SimpleContainer implements IServerContainer { return new ContactsManager(); }); $this->registerService('Request', function($c) { - $params = array(); + if (isset($c['urlParams'])) { + $urlParams = $c['urlParams']; + } else { + $urlParams = array(); + } - // we json decode the body only in case of content type json - if (isset($_SERVER['CONTENT_TYPE']) && stripos($_SERVER['CONTENT_TYPE'],'json') !== false ) { - $params = json_decode(file_get_contents('php://input'), true); - $params = is_array($params) ? $params: array(); + if (\OC::$session->exists('requesttoken')) { + $requesttoken = \OC::$session->get('requesttoken'); + } else { + $requesttoken = false; } + return new Request( array( 'get' => $_GET, @@ -42,7 +47,8 @@ class Server extends SimpleContainer implements IServerContainer { ? $_SERVER['REQUEST_METHOD'] : null, 'params' => $params, - 'urlParams' => $c['urlParams'] + 'urlParams' => $urlParams, + 'requesttoken' => $requesttoken, ) ); }); @@ -111,6 +117,15 @@ class Server extends SimpleContainer implements IServerContainer { $this->registerService('AllConfig', function($c) { return new \OC\AllConfig(); }); + $this->registerService('L10NFactory', function($c) { + return new \OC\L10N\Factory(); + }); + $this->registerService('URLGenerator', function($c) { + return new \OC\URLGenerator(); + }); + $this->registerService('AppHelper', function($c) { + return new \OC\AppHelper(); + }); $this->registerService('UserCache', function($c) { return new UserCache(); }); @@ -230,6 +245,29 @@ class Server extends SimpleContainer implements IServerContainer { } /** + * get an L10N instance + * @param $app string appid + * @return \OC_L10N + */ + function getL10N($app) { + return $this->query('L10NFactory')->get($app); + } + + /** + * @return \OC\URLGenerator + */ + function getURLGenerator() { + return $this->query('URLGenerator'); + } + + /** + * @return \OC\Helper + */ + function getHelper() { + return $this->query('AppHelper'); + } + + /** * Returns an ICache instance * * @return \OCP\ICache diff --git a/lib/session/internal.php b/lib/private/session/internal.php index 60aecccc8aa..60aecccc8aa 100644 --- a/lib/session/internal.php +++ b/lib/private/session/internal.php diff --git a/lib/session/memory.php b/lib/private/session/memory.php index c148ff4b9b9..c148ff4b9b9 100644 --- a/lib/session/memory.php +++ b/lib/private/session/memory.php diff --git a/lib/session/session.php b/lib/private/session/session.php index c55001eccac..c55001eccac 100644 --- a/lib/session/session.php +++ b/lib/private/session/session.php diff --git a/lib/setup.php b/lib/private/setup.php index 6bf3c88370f..6bf3c88370f 100644 --- a/lib/setup.php +++ b/lib/private/setup.php diff --git a/lib/setup/abstractdatabase.php b/lib/private/setup/abstractdatabase.php index 0beada7bd29..0beada7bd29 100644 --- a/lib/setup/abstractdatabase.php +++ b/lib/private/setup/abstractdatabase.php diff --git a/lib/setup/mssql.php b/lib/private/setup/mssql.php index b8329f99079..b8329f99079 100644 --- a/lib/setup/mssql.php +++ b/lib/private/setup/mssql.php diff --git a/lib/setup/mysql.php b/lib/private/setup/mysql.php index d97b6d2602f..d97b6d2602f 100644 --- a/lib/setup/mysql.php +++ b/lib/private/setup/mysql.php diff --git a/lib/setup/oci.php b/lib/private/setup/oci.php index 326d7a00531..326d7a00531 100644 --- a/lib/setup/oci.php +++ b/lib/private/setup/oci.php diff --git a/lib/setup/postgresql.php b/lib/private/setup/postgresql.php index 89d328ada19..89d328ada19 100644 --- a/lib/setup/postgresql.php +++ b/lib/private/setup/postgresql.php diff --git a/lib/setup/sqlite.php b/lib/private/setup/sqlite.php index fd4df792d62..fd4df792d62 100644 --- a/lib/setup/sqlite.php +++ b/lib/private/setup/sqlite.php diff --git a/lib/subadmin.php b/lib/private/subadmin.php index 8cda7240ac9..8cda7240ac9 100644 --- a/lib/subadmin.php +++ b/lib/private/subadmin.php diff --git a/lib/tagmanager.php b/lib/private/tagmanager.php index 9a371a11253..9a371a11253 100644 --- a/lib/tagmanager.php +++ b/lib/private/tagmanager.php diff --git a/lib/tags.php b/lib/private/tags.php index 9fdb35a7d6e..9fdb35a7d6e 100644 --- a/lib/tags.php +++ b/lib/private/tags.php diff --git a/lib/template.php b/lib/private/template.php index 9b2c1211e61..9b2c1211e61 100644 --- a/lib/template.php +++ b/lib/private/template.php diff --git a/lib/template/base.php b/lib/private/template/base.php index 88941bc7132..88941bc7132 100644 --- a/lib/template/base.php +++ b/lib/private/template/base.php diff --git a/lib/template/cssresourcelocator.php b/lib/private/template/cssresourcelocator.php index 8e7831ca549..8e7831ca549 100644 --- a/lib/template/cssresourcelocator.php +++ b/lib/private/template/cssresourcelocator.php diff --git a/lib/template/functions.php b/lib/private/template/functions.php index 501f8081bff..0aa2b27b96b 100644 --- a/lib/template/functions.php +++ b/lib/private/template/functions.php @@ -85,22 +85,51 @@ function human_file_size( $bytes ) { return OC_Helper::humanFileSize( $bytes ); } -function relative_modified_date($timestamp) { +/** + * @brief Strips the timestamp of its time value + * @param int $timestamp UNIX timestamp to strip + * @return $timestamp without time value + */ +function strip_time($timestamp){ + $date = new \DateTime("@{$timestamp}"); + $date->setTime(0, 0, 0); + return intval($date->format('U')); +} + +/** + * @brief Formats timestamp relatively to the current time using + * a human-friendly format like "x minutes ago" or "yesterday" + * @param int $timestamp timestamp to format + * @param int $fromTime timestamp to compare from, defaults to current time + * @param bool $dateOnly whether to strip time information + * @return formatted timestamp + */ +function relative_modified_date($timestamp, $fromTime = null, $dateOnly = false) { $l=OC_L10N::get('lib'); - $timediff = time() - $timestamp; + if (!isset($fromTime) || $fromTime === null){ + $fromTime = time(); + } + if ($dateOnly){ + $fromTime = strip_time($fromTime); + $timestamp = strip_time($timestamp); + } + $timediff = $fromTime - $timestamp; $diffminutes = round($timediff/60); $diffhours = round($diffminutes/60); $diffdays = round($diffhours/24); $diffmonths = round($diffdays/31); - if($timediff < 60) { return $l->t('seconds ago'); } - else if($timediff < 3600) { return $l->n('%n minute ago', '%n minutes ago', $diffminutes); } - else if($timediff < 86400) { return $l->n('%n hour ago', '%n hours ago', $diffhours); } - else if((date('G')-$diffhours) > 0) { return $l->t('today'); } - else if((date('G')-$diffhours) > -24) { return $l->t('yesterday'); } + if(!$dateOnly && $timediff < 60) { return $l->t('seconds ago'); } + else if(!$dateOnly && $timediff < 3600) { return $l->n('%n minute ago', '%n minutes ago', $diffminutes); } + else if(!$dateOnly && $timediff < 86400) { return $l->n('%n hour ago', '%n hours ago', $diffhours); } + else if((date('G', $fromTime)-$diffhours) >= 0) { return $l->t('today'); } + else if((date('G', $fromTime)-$diffhours) >= -24) { return $l->t('yesterday'); } + // 86400 * 31 days = 2678400 else if($timediff < 2678400) { return $l->n('%n day go', '%n days ago', $diffdays); } + // 86400 * 60 days = 518400 else if($timediff < 5184000) { return $l->t('last month'); } - else if((date('n')-$diffmonths) > 0) { return $l->n('%n month ago', '%n months ago', $diffmonths); } + else if((date('n', $fromTime)-$diffmonths) > 0) { return $l->n('%n month ago', '%n months ago', $diffmonths); } + // 86400 * 365.25 days * 2 = 63113852 else if($timediff < 63113852) { return $l->t('last year'); } else { return $l->t('years ago'); } } diff --git a/lib/template/jsresourcelocator.php b/lib/private/template/jsresourcelocator.php index f8fe3817ce6..f8fe3817ce6 100644 --- a/lib/template/jsresourcelocator.php +++ b/lib/private/template/jsresourcelocator.php diff --git a/lib/template/resourcelocator.php b/lib/private/template/resourcelocator.php index 9f83673664d..9f83673664d 100644 --- a/lib/template/resourcelocator.php +++ b/lib/private/template/resourcelocator.php diff --git a/lib/template/templatefilelocator.php b/lib/private/template/templatefilelocator.php index d5a484b1a14..d5a484b1a14 100644 --- a/lib/template/templatefilelocator.php +++ b/lib/private/template/templatefilelocator.php diff --git a/lib/templatelayout.php b/lib/private/templatelayout.php index 625f3424a04..625f3424a04 100644 --- a/lib/templatelayout.php +++ b/lib/private/templatelayout.php diff --git a/lib/updater.php b/lib/private/updater.php index df7332a96a9..9827d8a8c12 100644 --- a/lib/updater.php +++ b/lib/private/updater.php @@ -56,7 +56,7 @@ class Updater extends BasicEmitter { $version = \OC_Util::getVersion(); $version['installed'] = \OC_Appconfig::getValue('core', 'installedat'); $version['updated'] = \OC_Appconfig::getValue('core', 'lastupdatedat'); - $version['updatechannel'] = 'stable'; + $version['updatechannel'] = \OC_Util::getChannel(); $version['edition'] = \OC_Util::getEditionString(); $versionString = implode('x', $version); diff --git a/lib/user.php b/lib/private/user.php index 15e807088b4..b68786c773c 100644 --- a/lib/user.php +++ b/lib/private/user.php @@ -198,6 +198,10 @@ class OC_User { // Delete user files in /data/ OC_Helper::rmdirr(OC_Config::getValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $uid . '/'); + + return true; + } else { + return false; } } @@ -214,6 +218,55 @@ class OC_User { } /** + * @brief Try to login a user, assuming authentication + * has already happened (e.g. via Single Sign On). + * + * Log in a user and regenerate a new session. + * + * @param \OCP\Authentication\IApacheBackend $backend + * @return bool + */ + public static function loginWithApache(\OCP\Authentication\IApacheBackend $backend) { + + $uid = $backend->getCurrentUserId(); + $run = true; + OC_Hook::emit( "OC_User", "pre_login", array( "run" => &$run, "uid" => $uid )); + + if($uid) { + session_regenerate_id(true); + self::setUserId($uid); + self::setDisplayName($uid); + OC_Hook::emit( "OC_User", "post_login", array( "uid" => $uid, 'password'=>'' )); + return true; + } + return false; + } + + /** + * @brief Verify with Apache whether user is authenticated. + * + * @return boolean|null + * true: authenticated + * false: not authenticated + * null: not handled / no backend available + */ + public static function handleApacheAuth() { + $backend = self::findFirstActiveUsedBackend(); + if ($backend) { + OC_App::loadApps(); + + //setup extra user backends + self::setupBackends(); + self::unsetMagicInCookie(); + + return self::loginWithApache($backend); + } + + return null; + } + + + /** * @brief Sets user id for session and triggers emit */ public static function setUserId($uid) { @@ -260,6 +313,22 @@ class OC_User { } /** + * Supplies an attribute to the logout hyperlink. The default behaviour + * is to return an href with '?logout=true' appended. However, it can + * supply any attribute(s) which are valid for <a>. + * + * @return string with one or more HTML attributes. + */ + public static function getLogoutAttribute() { + $backend = self::findFirstActiveUsedBackend(); + if ($backend) { + return $backend->getLogoutAttribute(); + } + + return "href=" . link_to('', 'index.php') . "?logout=true"; + } + + /** * @brief Check if the user is an admin user * @param string $uid uid of the admin * @return bool @@ -497,4 +566,20 @@ class OC_User { public static function unsetMagicInCookie() { self::getUserSession()->unsetMagicInCookie(); } + + /** + * @brief Returns the first active backend from self::$_usedBackends. + * @return null if no backend active, otherwise OCP\Authentication\IApacheBackend + */ + private static function findFirstActiveUsedBackend() { + foreach (self::$_usedBackends as $backend) { + if ($backend instanceof OCP\Authentication\IApacheBackend) { + if ($backend->isSessionActive()) { + return $backend; + } + } + } + + return null; + } } diff --git a/lib/user/backend.php b/lib/private/user/backend.php index e9be08e429c..e9be08e429c 100644 --- a/lib/user/backend.php +++ b/lib/private/user/backend.php diff --git a/lib/user/database.php b/lib/private/user/database.php index 9f00a022d9f..9f00a022d9f 100644 --- a/lib/user/database.php +++ b/lib/private/user/database.php diff --git a/lib/user/dummy.php b/lib/private/user/dummy.php index b5b7a6c3c7a..52be7edfa75 100644 --- a/lib/user/dummy.php +++ b/lib/private/user/dummy.php @@ -88,8 +88,8 @@ class OC_User_Dummy extends OC_User_Backend { * returns the user id or false */ public function checkPassword($uid, $password) { - if (isset($this->users[$uid])) { - return ($this->users[$uid] == $password); + if (isset($this->users[$uid]) && $this->users[$uid] === $password) { + return $uid; } else { return false; } diff --git a/lib/user/example.php b/lib/private/user/example.php index b2d0dc25410..b2d0dc25410 100644 --- a/lib/user/example.php +++ b/lib/private/user/example.php diff --git a/lib/user/http.php b/lib/private/user/http.php index e99afe59ba7..e99afe59ba7 100644 --- a/lib/user/http.php +++ b/lib/private/user/http.php diff --git a/lib/user/interface.php b/lib/private/user/interface.php index c72bdfaf3fd..c72bdfaf3fd 100644 --- a/lib/user/interface.php +++ b/lib/private/user/interface.php diff --git a/lib/user/manager.php b/lib/private/user/manager.php index 13286bc28a4..13286bc28a4 100644 --- a/lib/user/manager.php +++ b/lib/private/user/manager.php diff --git a/lib/user/session.php b/lib/private/user/session.php index 525c65ab8a1..525c65ab8a1 100644 --- a/lib/user/session.php +++ b/lib/private/user/session.php diff --git a/lib/user/user.php b/lib/private/user/user.php index e5f842944f1..e5f842944f1 100644 --- a/lib/user/user.php +++ b/lib/private/user/user.php diff --git a/lib/util.php b/lib/private/util.php index 41f5f1d16be..6c0a8d7bab5 100755 --- a/lib/util.php +++ b/lib/private/util.php @@ -68,6 +68,7 @@ class OC_Util { $userDirectory = $userRoot . '/files'; if( !is_dir( $userDirectory )) { mkdir( $userDirectory, 0755, true ); + OC_Util::copySkeleton($userDirectory); } //jail the user into his "home" directory \OC\Files\Filesystem::init($user, $userDir); @@ -93,6 +94,35 @@ class OC_Util { } /** + * @brief copies the user skeleton files into the fresh user home files + * @param string $userDirectory + */ + public static function copySkeleton($userDirectory) { + OC_Util::copyr(\OC::$SERVERROOT.'/core/skeleton' , $userDirectory); + } + + /** + * @brief copies a directory recursively + * @param string $source + * @param string $target + * @return void + */ + public static function copyr($source,$target) { + $dir = opendir($source); + @mkdir($target); + while(false !== ( $file = readdir($dir)) ) { + if ( !\OC\Files\Filesystem::isIgnoredDir($file) ) { + if ( is_dir($source . '/' . $file) ) { + OC_Util::copyr($source . '/' . $file , $target . '/' . $file); + } else { + copy($source . '/' . $file,$target . '/' . $file); + } + } + } + closedir($dir); + } + + /** * @return void */ public static function tearDownFS() { @@ -106,9 +136,8 @@ class OC_Util { * @return array */ public static function getVersion() { - // hint: We only can count up. Reset minor/patchlevel when - // updating major/minor version number. - return array(5, 80, 07); + OC_Util::loadVersion(); + return \OC::$server->getSession()->get('OC_Version'); } /** @@ -116,7 +145,8 @@ class OC_Util { * @return string */ public static function getVersionString() { - return '6.0 pre alpha'; + OC_Util::loadVersion(); + return \OC::$server->getSession()->get('OC_VersionString'); } /** @@ -126,7 +156,49 @@ class OC_Util { * @return string */ public static function getEditionString() { - return ''; + OC_Util::loadVersion(); + return \OC::$server->getSession()->get('OC_Edition'); + } + + /** + * @description get the update channel of the current installed of ownCloud. + * @return string + */ + public static function getChannel() { + OC_Util::loadVersion(); + return \OC::$server->getSession()->get('OC_Channel'); + } + + /** + * @description get the build number of the current installed of ownCloud. + * @return string + */ + public static function getBuild() { + OC_Util::loadVersion(); + return \OC::$server->getSession()->get('OC_Build'); + } + + /** + * @description load the version.php into the session as cache + */ + private static function loadVersion() { + $timestamp = filemtime(OC::$SERVERROOT.'/version.php'); + if(!\OC::$server->getSession()->exists('OC_Version') or OC::$server->getSession()->get('OC_Version_Timestamp') != $timestamp) { + require 'version.php'; + $session = \OC::$server->getSession(); + /** @var $timestamp int */ + $session->set('OC_Version_Timestamp', $timestamp); + /** @var $OC_Version string */ + $session->set('OC_Version', $OC_Version); + /** @var $OC_VersionString string */ + $session->set('OC_VersionString', $OC_VersionString); + /** @var $OC_Edition string */ + $session->set('OC_Edition', $OC_Edition); + /** @var $OC_Channel string */ + $session->set('OC_Channel', $OC_Channel); + /** @var $OC_Build string */ + $session->set('OC_Build', $OC_Build); + } } /** @@ -410,14 +482,18 @@ class OC_Util { $encryptedFiles = false; if (OC_App::isEnabled('files_encryption') === false) { $view = new OC\Files\View('/' . OCP\User::getUser()); - if ($view->file_exists('/files_encryption/keyfiles')) { - $encryptedFiles = true; + $keyfilePath = '/files_encryption/keyfiles'; + if ($view->is_dir($keyfilePath)) { + $dircontent = $view->getDirectoryContent($keyfilePath); + if (!empty($dircontent)) { + $encryptedFiles = true; + } } } - + return $encryptedFiles; } - + /** * @brief Check for correct file permissions of data directory * @paran string $dataDirectory @@ -467,6 +543,7 @@ class OC_Util { } $parameters['alt_login'] = OC_App::getAlternativeLogIns(); + $parameters['rememberLoginAllowed'] = self::rememberLoginAllowed(); OC_Template::printGuestPage("", "login", $parameters); } @@ -509,6 +586,27 @@ class OC_Util { } /** + * Check if it is allowed to remember login. + * + * @note Every app can set 'rememberlogin' to 'false' to disable the remember login feature + * + * @return bool + */ + public static function rememberLoginAllowed() { + + $apps = OC_App::getEnabledApps(); + + foreach ($apps as $app) { + $appInfo = OC_App::getAppInfo($app); + if (isset($appInfo['rememberlogin']) && $appInfo['rememberlogin'] === 'false') { + return false; + } + + } + return true; + } + + /** * @brief Check if the user is a subadmin, redirects to home if not * @return array $groups where the current user is subadmin */ @@ -552,7 +650,7 @@ class OC_Util { if(is_null($id)) { // We need to guarantee at least one letter in instanceid so it can be used as the session_name $id = 'oc' . self::generateRandomBytes(10); - OC_Config::setValue('instanceid', $id); + OC_Config::$object->setValue('instanceid', $id); } return $id; } @@ -600,29 +698,7 @@ class OC_Util { * @see OC_Util::callRegister() */ public static function isCallRegistered() { - if(!\OC::$session->exists('requesttoken')) { - return false; - } - - if(isset($_GET['requesttoken'])) { - $token = $_GET['requesttoken']; - } elseif(isset($_POST['requesttoken'])) { - $token = $_POST['requesttoken']; - } elseif(isset($_SERVER['HTTP_REQUESTTOKEN'])) { - $token = $_SERVER['HTTP_REQUESTTOKEN']; - } else { - //no token found. - return false; - } - - // Check if the token is valid - if($token !== \OC::$session->get('requesttoken')) { - // Not valid - return false; - } else { - // Valid token - return true; - } + return \OC::$server->getRequest()->passesCSRFCheck(); } /** @@ -654,16 +730,16 @@ class OC_Util { } return $value; } - + /** * @brief Public function to encode url parameters * * This function is used to encode path to file before output. * Encoding is done according to RFC 3986 with one exception: - * Character '/' is preserved as is. + * Character '/' is preserved as is. * * @param string $component part of URI to encode - * @return string + * @return string */ public static function encodePath($component) { $encoded = rawurlencode($component); @@ -730,12 +806,6 @@ class OC_Util { 'baseUri' => OC_Helper::linkToRemote('webdav'), ); - // save the old timeout so that we can restore it later - $oldTimeout = ini_get("default_socket_timeout"); - - // use a 5 sec timeout for the check. Should be enough for local requests. - ini_set("default_socket_timeout", 5); - $client = new \Sabre_DAV_Client($settings); // for this self test we don't care if the ssl certificate is self signed and the peer cannot be verified. @@ -752,9 +822,6 @@ class OC_Util { $return = false; } - // restore the original timeout - ini_set("default_socket_timeout", $oldTimeout); - return $return; } @@ -810,7 +877,7 @@ class OC_Util { } } } - + /** * @brief Check if the connection to the internet is disabled on purpose * @return bool @@ -896,9 +963,9 @@ class OC_Util { * @param string $url Url to get content * @return string of the response or false on error * This function get the content of a page via curl, if curl is enabled. - * If not, file_get_element is used. + * If not, file_get_contents is used. */ - public static function getUrlContent($url){ + public static function getUrlContent($url) { if (function_exists('curl_init')) { $curl = curl_init(); diff --git a/lib/vobject.php b/lib/private/vobject.php index 267176ebc07..267176ebc07 100644 --- a/lib/vobject.php +++ b/lib/private/vobject.php diff --git a/lib/vobject/compoundproperty.php b/lib/private/vobject/compoundproperty.php index 7fe42574bed..7fe42574bed 100644 --- a/lib/vobject/compoundproperty.php +++ b/lib/private/vobject/compoundproperty.php diff --git a/lib/vobject/stringproperty.php b/lib/private/vobject/stringproperty.php index a9d63a0a789..a9d63a0a789 100644 --- a/lib/vobject/stringproperty.php +++ b/lib/private/vobject/stringproperty.php diff --git a/lib/public/appframework/imiddleware.php b/lib/public/appframework/imiddleware.php deleted file mode 100644 index 1e76d3bbe49..00000000000 --- a/lib/public/appframework/imiddleware.php +++ /dev/null @@ -1,88 +0,0 @@ -<?php - -/** - * ownCloud - App Framework - * - * @author Bernhard Posselt - * @copyright 2012 Bernhard Posselt nukeawhale@gmail.com - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE - * License as published by the Free Software Foundation; either - * version 3 of the License, or any later version. - * - * This library 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 along with this library. If not, see <http://www.gnu.org/licenses/>. - * - */ - - -namespace OCP\AppFramework; -use OCP\AppFramework\Http\Response; - - -/** - * Middleware is used to provide hooks before or after controller methods and - * deal with possible exceptions raised in the controller methods. - * They're modeled after Django's middleware system: - * https://docs.djangoproject.com/en/dev/topics/http/middleware/ - */ -interface IMiddleWare { - - - /** - * This is being run in normal order before the controller is being - * called which allows several modifications and checks - * - * @param Controller $controller the controller that is being called - * @param string $methodName the name of the method that will be called on - * the controller - */ - function beforeController($controller, $methodName); - - - /** - * This is being run when either the beforeController method or the - * controller method itself is throwing an exception. The middleware is - * asked in reverse order to handle the exception and to return a response. - * If the response is null, it is assumed that the exception could not be - * handled and the error will be thrown again - * - * @param Controller $controller the controller that is being called - * @param string $methodName the name of the method that will be called on - * the controller - * @param \Exception $exception the thrown exception - * @throws \Exception the passed in exception if it cant handle it - * @return Response a Response object in case that the exception was handled - */ - function afterException($controller, $methodName, \Exception $exception); - - /** - * This is being run after a successful controller method call and allows - * the manipulation of a Response object. The middleware is run in reverse order - * - * @param Controller $controller the controller that is being called - * @param string $methodName the name of the method that will be called on - * the controller - * @param Response $response the generated response from the controller - * @return Response a Response object - */ - function afterController($controller, $methodName, Response $response); - - /** - * This is being run after the response object has been rendered and - * allows the manipulation of the output. The middleware is run in reverse order - * - * @param Controller $controller the controller that is being called - * @param string $methodName the name of the method that will be called on - * the controller - * @param string $output the generated output from a response - * @return string the output that should be printed - */ - function beforeOutput($controller, $methodName, $output); -} diff --git a/lib/appframework/middleware/middleware.php b/lib/public/appframework/middleware.php index b12c03c3eb8..12776c119c0 100644 --- a/lib/appframework/middleware/middleware.php +++ b/lib/public/appframework/middleware.php @@ -22,7 +22,7 @@ */ -namespace OC\AppFramework\Middleware; +namespace OCP\AppFramework; use OCP\AppFramework\Http\Response; diff --git a/lib/public/authentication/iapachebackend.php b/lib/public/authentication/iapachebackend.php new file mode 100644 index 00000000000..5376baf525c --- /dev/null +++ b/lib/public/authentication/iapachebackend.php @@ -0,0 +1,49 @@ +<?php + +/** + * ownCloud - Apache backend + * + * @author Karl Beecher + * @copyright 2013 Karl Beecher - karl@endocode.com + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library 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 along with this library. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OCP\Authentication; + +interface IApacheBackend { + + /** + * In case the user has been authenticated by Apache true is returned. + * + * @return boolean whether Apache reports a user as currently logged in. + */ + public function isSessionActive(); + + /** + * Creates an attribute which is added to the logout hyperlink. It can + * supply any attribute(s) which are valid for <a>. + * + * @return string with one or more HTML attributes. + */ + public function getLogoutAttribute(); + + /** + * Return the id of the current user + * @return string + */ + public function getCurrentUserId(); + +} diff --git a/lib/public/ihelper.php b/lib/public/ihelper.php new file mode 100644 index 00000000000..fad02f7556a --- /dev/null +++ b/lib/public/ihelper.php @@ -0,0 +1,23 @@ +<?php +/** + * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + * + */ + +namespace OCP; + +/** + * Functions that don't have any specific interface to place + */ +interface IHelper { + /** + * Gets the content of an URL by using CURL or a fallback if it is not + * installed + * @param string $url the url that should be fetched + * @return string the content of the webpage + */ + public function getUrlContent($url); +} diff --git a/lib/public/il10n.php b/lib/public/il10n.php new file mode 100644 index 00000000000..9cf9093d391 --- /dev/null +++ b/lib/public/il10n.php @@ -0,0 +1,67 @@ +<?php +/** + * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + * + */ + +namespace OCP; + +/** + * TODO: Description + */ +interface IL10N { + /** + * @brief Translating + * @param $text String The text we need a translation for + * @param array $parameters default:array() Parameters for sprintf + * @return \OC_L10N_String|string Translation or the same text + * + * Returns the translation. If no translation is found, $text will be + * returned. + */ + public function t($text, $parameters = array()); + + /** + * @brief Translating + * @param $text_singular String the string to translate for exactly one object + * @param $text_plural String the string to translate for n objects + * @param $count Integer Number of objects + * @param array $parameters default:array() Parameters for sprintf + * @return \OC_L10N_String|string Translation or the same text + * + * Returns the translation. If no translation is found, $text will be + * returned. %n will be replaced with the number of objects. + * + * The correct plural is determined by the plural_forms-function + * provided by the po file. + * + */ + public function n($text_singular, $text_plural, $count, $parameters = array()); + + /** + * @brief Localization + * @param $type Type of localization + * @param $params parameters for this localization + * @returns String or false + * + * Returns the localized data. + * + * Implemented types: + * - date + * - Creates a date + * - l10n-field: date + * - params: timestamp (int/string) + * - datetime + * - Creates date and time + * - l10n-field: datetime + * - params: timestamp (int/string) + * - time + * - Creates a time + * - l10n-field: time + * - params: timestamp (int/string) + */ + public function l($type, $data); +} diff --git a/lib/public/irequest.php b/lib/public/irequest.php index 9f335b06f2a..45b27868d70 100644 --- a/lib/public/irequest.php +++ b/lib/public/irequest.php @@ -22,6 +22,28 @@ namespace OCP; +/** + * This interface provides an immutable object with with accessors to + * request variables and headers. + * + * Access request variables by method and name. + * + * Examples: + * + * $request->post['myvar']; // Only look for POST variables + * $request->myvar; or $request->{'myvar'}; or $request->{$myvar} + * Looks in the combined GET, POST and urlParams array. + * + * If you access e.g. ->post but the current HTTP request method + * is GET a \LogicException will be thrown. + * + * NOTE: + * - When accessing ->put a stream resource is returned and the accessor + * will return false on subsequent access to ->put or ->patch. + * - When accessing ->patch and the Content-Type is either application/json + * or application/x-www-form-urlencoded (most cases) it will act like ->get + * and ->post and return an array. Otherwise the raw data will be returned. + */ interface IRequest { @@ -86,11 +108,8 @@ interface IRequest { /** - * Returns the request body content. - * - * @param Boolean $asResource If true, a resource will be returned - * @return string|resource The request body content or a resource to read the body stream. - * @throws \LogicException + * Checks if the CSRF check was correct + * @return bool true if CSRF check passed */ - function getContent($asResource = false); + public function passesCSRFCheck(); } diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php index 287b8e9d902..cc9436a75c8 100644 --- a/lib/public/iservercontainer.php +++ b/lib/public/iservercontainer.php @@ -102,6 +102,23 @@ interface IServerContainer { function getConfig(); /** + * get an L10N instance + * @param $app string appid + * @return \OCP\IL10N + */ + function getL10N($app); + + /** + * @return \OCP\IURLGenerator + */ + function getURLGenerator(); + + /** + * @return \OCP\IHelper + */ + function getHelper(); + + /** * Returns an ICache instance * * @return \OCP\ICache diff --git a/lib/public/iurlgenerator.php b/lib/public/iurlgenerator.php new file mode 100644 index 00000000000..4eb4c0f8312 --- /dev/null +++ b/lib/public/iurlgenerator.php @@ -0,0 +1,47 @@ +<?php +/** + * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + * + */ + +namespace OCP; + +/** + * Class to generate URLs + */ +interface IURLGenerator { + /** + * Returns the URL for a route + * @param string $routeName the name of the route + * @param array $arguments an array with arguments which will be filled into the url + * @return string the url + */ + public function linkToRoute($routeName, $arguments = array()); + + /** + * Returns an URL for an image or file + * @param string $appName the name of the app + * @param string $file the name of the file + * @return string the url + */ + public function linkTo($appName, $file); + + /** + * Returns the link to an image, like linkTo but only with prepending img/ + * @param string $appName the name of the app + * @param string $file the name of the file + * @return string the url + */ + public function imagePath($appName, $file); + + + /** + * Makes an URL absolute + * @param string $url the url in the owncloud host + * @return string the absolute version of the url + */ + public function getAbsoluteURL($url); +} diff --git a/lib/public/share.php b/lib/public/share.php index ff11aad1a12..59bda042485 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -246,9 +246,9 @@ class Share { /** * @brief Get the item of item type shared with the current user - * @param string Item type - * @param string Item target - * @param int Format (optional) Format type must be defined by the backend + * @param string $itemType + * @param string $ItemTarget + * @param int $format (optional) Format type must be defined by the backend * @return Return depends on format */ public static function getItemSharedWith($itemType, $itemTarget, $format = self::FORMAT_NONE, @@ -258,6 +258,55 @@ class Share { } /** + * @brief Get the item of item type shared with a given user by source + * @param string $ItemType + * @param string $ItemSource + * @param string $user User user to whom the item was shared + * @return array Return list of items with file_target, permissions and expiration + */ + public static function getItemSharedWithUser($itemType, $itemSource, $user) { + + $shares = array(); + + // first check if there is a db entry for the specific user + $query = \OC_DB::prepare( + 'SELECT `file_target`, `permissions`, `expiration` + FROM + `*PREFIX*share` + WHERE + `item_source` = ? AND `item_type` = ? AND `share_with` = ?' + ); + + $result = \OC_DB::executeAudited($query, array($itemSource, $itemType, $user)); + + while ($row = $result->fetchRow()) { + $shares[] = $row; + } + + //if didn't found a result than let's look for a group share. + if(empty($shares)) { + $groups = \OC_Group::getUserGroups($user); + + $query = \OC_DB::prepare( + 'SELECT `file_target`, `permissions`, `expiration` + FROM + `*PREFIX*share` + WHERE + `item_source` = ? AND `item_type` = ? AND `share_with` in (?)' + ); + + $result = \OC_DB::executeAudited($query, array($itemSource, $itemType, implode(',', $groups))); + + while ($row = $result->fetchRow()) { + $shares[] = $row; + } + } + + return $shares; + + } + + /** * @brief Get the item of item type shared with the current user by source * @param string Item type * @param string Item source @@ -653,6 +702,29 @@ class Share { } return false; } + /** + * @brief sent status if users got informed by mail about share + * @param string $itemType + * @param string $itemSource + * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK + * @param bool $status + */ + public static function setSendMailStatus($itemType, $itemSource, $shareType, $status) { + $status = $status ? 1 : 0; + + $query = \OC_DB::prepare( + 'UPDATE `*PREFIX*share` + SET `mail_send` = ? + WHERE `item_type` = ? AND `item_source` = ? AND `share_type` = ?'); + + $result = $query->execute(array($status, $itemType, $itemSource, $shareType)); + + if($result === false) { + \OC_Log::write('OCP\Share', 'Couldn\'t set send mail status', \OC_Log::ERROR); + } + + + } /** * @brief Set the permissions of an item for a specific user or group @@ -983,19 +1055,19 @@ class Share { if ($format == self::FORMAT_STATUSES) { if ($itemType == 'file' || $itemType == 'folder') { $select = '`*PREFIX*share`.`id`, `item_type`, `*PREFIX*share`.`parent`,' - .' `share_type`, `file_source`, `path`, `expiration`, `storage`'; + .' `share_type`, `file_source`, `path`, `expiration`, `storage`, `mail_send`'; } else { - $select = '`id`, `item_type`, `item_source`, `parent`, `share_type`, `expiration`'; + $select = '`id`, `item_type`, `item_source`, `parent`, `share_type`, `expiration`, `mail_send`'; } } else { if (isset($uidOwner)) { if ($itemType == 'file' || $itemType == 'folder') { $select = '`*PREFIX*share`.`id`, `item_type`, `*PREFIX*share`.`parent`,' .' `share_type`, `share_with`, `file_source`, `path`, `permissions`, `stime`,' - .' `expiration`, `token`, `storage`'; + .' `expiration`, `token`, `storage`, `mail_send`'; } else { $select = '`id`, `item_type`, `item_source`, `parent`, `share_type`, `share_with`, `permissions`,' - .' `stime`, `file_source`, `expiration`, `token`'; + .' `stime`, `file_source`, `expiration`, `token`, `mail_send`'; } } else { if ($fileDependent) { @@ -1006,11 +1078,11 @@ class Share { $select = '`*PREFIX*share`.`id`, `item_type`, `*PREFIX*share`.`parent`, `uid_owner`, ' .'`share_type`, `share_with`, `file_source`, `path`, `file_target`, ' .'`permissions`, `expiration`, `storage`, `*PREFIX*filecache`.`parent` as `file_parent`, ' - .'`name`, `mtime`, `mimetype`, `mimepart`, `size`, `encrypted`, `etag`'; + .'`name`, `mtime`, `mimetype`, `mimepart`, `size`, `encrypted`, `etag`, `mail_send`'; } else { $select = '`*PREFIX*share`.`id`, `item_type`, `item_source`, `item_target`, `*PREFIX*share`.`parent`, `share_type`, `share_with`, `uid_owner`, - `file_source`, `path`, `file_target`, `permissions`, `stime`, `expiration`, `token`, `storage`'; + `file_source`, `path`, `file_target`, `permissions`, `stime`, `expiration`, `token`, `storage`, `mail_send`'; } } else { $select = '*'; diff --git a/lib/public/template.php b/lib/public/template.php index 3b1a4ed4906..a5c500b0e25 100644 --- a/lib/public/template.php +++ b/lib/public/template.php @@ -90,8 +90,8 @@ function human_file_size( $bytes ) { * @param $timestamp unix timestamp * @returns human readable interpretation of the timestamp */ -function relative_modified_date($timestamp) { - return(\relative_modified_date($timestamp)); +function relative_modified_date($timestamp, $dateOnly = false) { + return(\relative_modified_date($timestamp, null, $dateOnly)); } diff --git a/lib/urlgenerator.php b/lib/urlgenerator.php new file mode 100644 index 00000000000..1db4c36cc58 --- /dev/null +++ b/lib/urlgenerator.php @@ -0,0 +1,111 @@ +<?php +/** + * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + * + */ + +namespace OC; + +/** + * Class to generate URLs + */ +class URLGenerator { + /** + * @brief Creates an url using a defined route + * @param $route + * @param array $parameters + * @return + * @internal param array $args with param=>value, will be appended to the returned url + * @returns the url + * + * Returns a url to the given app and file. + */ + public function linkToRoute($route, $parameters = array()) { + $urlLinkTo = \OC::getRouter()->generate($route, $parameters); + return $urlLinkTo; + } + + /** + * @brief Creates an url + * @param string $app app + * @param string $file file + * @param array $args array with param=>value, will be appended to the returned url + * The value of $args will be urlencoded + * @return string the url + * + * Returns a url to the given app and file. + */ + public function linkTo( $app, $file, $args = array() ) { + if( $app != '' ) { + $app_path = \OC_App::getAppPath($app); + // Check if the app is in the app folder + if ($app_path && file_exists($app_path . '/' . $file)) { + if (substr($file, -3) == 'php' || substr($file, -3) == 'css') { + $urlLinkTo = \OC::$WEBROOT . '/index.php/apps/' . $app; + $urlLinkTo .= ($file != 'index.php') ? '/' . $file : ''; + } else { + $urlLinkTo = \OC_App::getAppWebPath($app) . '/' . $file; + } + } else { + $urlLinkTo = \OC::$WEBROOT . '/' . $app . '/' . $file; + } + } else { + if (file_exists(\OC::$SERVERROOT . '/core/' . $file)) { + $urlLinkTo = \OC::$WEBROOT . '/core/' . $file; + } else { + $urlLinkTo = \OC::$WEBROOT . '/' . $file; + } + } + + if ($args && $query = http_build_query($args, '', '&')) { + $urlLinkTo .= '?' . $query; + } + + return $urlLinkTo; + } + + /** + * @brief Creates path to an image + * @param string $app app + * @param string $image image name + * @return string the url + * + * Returns the path to the image. + */ + public function imagePath($app, $image) { + // Read the selected theme from the config file + $theme = \OC_Util::getTheme(); + + // Check if the app is in the app folder + if (file_exists(\OC::$SERVERROOT . "/themes/$theme/apps/$app/img/$image")) { + return \OC::$WEBROOT . "/themes/$theme/apps/$app/img/$image"; + } elseif (file_exists(\OC_App::getAppPath($app) . "/img/$image")) { + return \OC_App::getAppWebPath($app) . "/img/$image"; + } elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/themes/$theme/$app/img/$image")) { + return \OC::$WEBROOT . "/themes/$theme/$app/img/$image"; + } elseif (!empty($app) and file_exists(\OC::$SERVERROOT . "/$app/img/$image")) { + return \OC::$WEBROOT . "/$app/img/$image"; + } elseif (file_exists(\OC::$SERVERROOT . "/themes/$theme/core/img/$image")) { + return \OC::$WEBROOT . "/themes/$theme/core/img/$image"; + } elseif (file_exists(\OC::$SERVERROOT . "/core/img/$image")) { + return \OC::$WEBROOT . "/core/img/$image"; + } else { + throw new RuntimeException('image not found: image:' . $image . ' webroot:' . \OC::$WEBROOT . ' serverroot:' . \OC::$SERVERROOT); + } + } + + /** + * @brief Makes an $url absolute + * @param string $url the url + * @return string the absolute url + * + * Returns a absolute url to the given app and file. + */ + public function makeURLAbsolute($url) { + return \OC_Request::serverProtocol() . '://' . \OC_Request::serverHost() . $url; + } + +} |