summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/autoload_classmap.php10
-rw-r--r--lib/composer/composer/autoload_static.php10
-rw-r--r--lib/l10n/zh_CN.js63
-rw-r--r--lib/l10n/zh_CN.json63
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php4
-rw-r--r--lib/private/Authentication/LoginCredentials/Credentials.php72
-rw-r--r--lib/private/Authentication/LoginCredentials/Store.php120
-rw-r--r--lib/private/Files/Notify/Change.php65
-rw-r--r--lib/private/Files/Notify/RenameChange.php52
-rw-r--r--lib/private/Files/Storage/Local.php13
-rw-r--r--lib/private/Server.php16
-rw-r--r--lib/private/legacy/util.php21
-rw-r--r--lib/public/Authentication/Exceptions/CredentialsUnavailableException.php34
-rw-r--r--lib/public/Authentication/LoginCredentials/ICredentials.php58
-rw-r--r--lib/public/Authentication/LoginCredentials/IStore.php44
-rw-r--r--lib/public/Files/Notify/IChange.php56
-rw-r--r--lib/public/Files/Notify/INotifyHandler.php64
-rw-r--r--lib/public/Files/Notify/IRenameChange.php40
-rw-r--r--lib/public/Files/Storage/INotifyStorage.php13
19 files changed, 742 insertions, 76 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index 5e00b31ae41..4a345ed7a6d 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -54,7 +54,10 @@ return array(
'OCP\\App\\AppPathNotFoundException' => $baseDir . '/lib/public/App/AppPathNotFoundException.php',
'OCP\\App\\IAppManager' => $baseDir . '/lib/public/App/IAppManager.php',
'OCP\\App\\ManagerEvent' => $baseDir . '/lib/public/App/ManagerEvent.php',
+ 'OCP\\Authentication\\Exceptions\\CredentialsUnavailableException' => $baseDir . '/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php',
'OCP\\Authentication\\IApacheBackend' => $baseDir . '/lib/public/Authentication/IApacheBackend.php',
+ 'OCP\\Authentication\\LoginCredentials\\ICredentials' => $baseDir . '/lib/public/Authentication/LoginCredentials/ICredentials.php',
+ 'OCP\\Authentication\\LoginCredentials\\IStore' => $baseDir . '/lib/public/Authentication/LoginCredentials/IStore.php',
'OCP\\Authentication\\TwoFactorAuth\\IProvider' => $baseDir . '/lib/public/Authentication/TwoFactorAuth/IProvider.php',
'OCP\\Authentication\\TwoFactorAuth\\TwoFactorException' => $baseDir . '/lib/public/Authentication/TwoFactorAuth/TwoFactorException.php',
'OCP\\AutoloadNotAllowedException' => $baseDir . '/lib/public/AutoloadNotAllowedException.php',
@@ -131,6 +134,9 @@ return array(
'OCP\\Files\\NotEnoughSpaceException' => $baseDir . '/lib/public/Files/NotEnoughSpaceException.php',
'OCP\\Files\\NotFoundException' => $baseDir . '/lib/public/Files/NotFoundException.php',
'OCP\\Files\\NotPermittedException' => $baseDir . '/lib/public/Files/NotPermittedException.php',
+ 'OCP\\Files\\Notify\\IChange' => $baseDir . '/lib/public/Files/Notify/IChange.php',
+ 'OCP\\Files\\Notify\\INotifyHandler' => $baseDir . '/lib/public/Files/Notify/INotifyHandler.php',
+ 'OCP\\Files\\Notify\\IRenameChange' => $baseDir . '/lib/public/Files/Notify/IRenameChange.php',
'OCP\\Files\\ObjectStore\\IObjectStore' => $baseDir . '/lib/public/Files/ObjectStore/IObjectStore.php',
'OCP\\Files\\ReservedWordException' => $baseDir . '/lib/public/Files/ReservedWordException.php',
'OCP\\Files\\SimpleFS\\ISimpleFile' => $baseDir . '/lib/public/Files/SimpleFS/ISimpleFile.php',
@@ -321,6 +327,8 @@ return array(
'OC\\Authentication\\Exceptions\\PasswordlessTokenException' => $baseDir . '/lib/private/Authentication/Exceptions/PasswordlessTokenException.php',
'OC\\Authentication\\Exceptions\\TwoFactorAuthRequiredException' => $baseDir . '/lib/private/Authentication/Exceptions/TwoFactorAuthRequiredException.php',
'OC\\Authentication\\Exceptions\\UserAlreadyLoggedInException' => $baseDir . '/lib/private/Authentication/Exceptions/UserAlreadyLoggedInException.php',
+ 'OC\\Authentication\\LoginCredentials\\Credentials' => $baseDir . '/lib/private/Authentication/LoginCredentials/Credentials.php',
+ 'OC\\Authentication\\LoginCredentials\\Store' => $baseDir . '/lib/private/Authentication/LoginCredentials/Store.php',
'OC\\Authentication\\Token\\DefaultToken' => $baseDir . '/lib/private/Authentication/Token/DefaultToken.php',
'OC\\Authentication\\Token\\DefaultTokenCleanupJob' => $baseDir . '/lib/private/Authentication/Token/DefaultTokenCleanupJob.php',
'OC\\Authentication\\Token\\DefaultTokenMapper' => $baseDir . '/lib/private/Authentication/Token/DefaultTokenMapper.php',
@@ -527,6 +535,8 @@ return array(
'OC\\Files\\Node\\NonExistingFile' => $baseDir . '/lib/private/Files/Node/NonExistingFile.php',
'OC\\Files\\Node\\NonExistingFolder' => $baseDir . '/lib/private/Files/Node/NonExistingFolder.php',
'OC\\Files\\Node\\Root' => $baseDir . '/lib/private/Files/Node/Root.php',
+ 'OC\\Files\\Notify\\Change' => $baseDir . '/lib/private/Files/Notify/Change.php',
+ 'OC\\Files\\Notify\\RenameChange' => $baseDir . '/lib/private/Files/Notify/RenameChange.php',
'OC\\Files\\ObjectStore\\HomeObjectStoreStorage' => $baseDir . '/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php',
'OC\\Files\\ObjectStore\\Mapper' => $baseDir . '/lib/private/Files/ObjectStore/Mapper.php',
'OC\\Files\\ObjectStore\\NoopScanner' => $baseDir . '/lib/private/Files/ObjectStore/NoopScanner.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index 040a1e0d2d3..f8d360fec4b 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -84,7 +84,10 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OCP\\App\\AppPathNotFoundException' => __DIR__ . '/../../..' . '/lib/public/App/AppPathNotFoundException.php',
'OCP\\App\\IAppManager' => __DIR__ . '/../../..' . '/lib/public/App/IAppManager.php',
'OCP\\App\\ManagerEvent' => __DIR__ . '/../../..' . '/lib/public/App/ManagerEvent.php',
+ 'OCP\\Authentication\\Exceptions\\CredentialsUnavailableException' => __DIR__ . '/../../..' . '/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php',
'OCP\\Authentication\\IApacheBackend' => __DIR__ . '/../../..' . '/lib/public/Authentication/IApacheBackend.php',
+ 'OCP\\Authentication\\LoginCredentials\\ICredentials' => __DIR__ . '/../../..' . '/lib/public/Authentication/LoginCredentials/ICredentials.php',
+ 'OCP\\Authentication\\LoginCredentials\\IStore' => __DIR__ . '/../../..' . '/lib/public/Authentication/LoginCredentials/IStore.php',
'OCP\\Authentication\\TwoFactorAuth\\IProvider' => __DIR__ . '/../../..' . '/lib/public/Authentication/TwoFactorAuth/IProvider.php',
'OCP\\Authentication\\TwoFactorAuth\\TwoFactorException' => __DIR__ . '/../../..' . '/lib/public/Authentication/TwoFactorAuth/TwoFactorException.php',
'OCP\\AutoloadNotAllowedException' => __DIR__ . '/../../..' . '/lib/public/AutoloadNotAllowedException.php',
@@ -161,6 +164,9 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OCP\\Files\\NotEnoughSpaceException' => __DIR__ . '/../../..' . '/lib/public/Files/NotEnoughSpaceException.php',
'OCP\\Files\\NotFoundException' => __DIR__ . '/../../..' . '/lib/public/Files/NotFoundException.php',
'OCP\\Files\\NotPermittedException' => __DIR__ . '/../../..' . '/lib/public/Files/NotPermittedException.php',
+ 'OCP\\Files\\Notify\\IChange' => __DIR__ . '/../../..' . '/lib/public/Files/Notify/IChange.php',
+ 'OCP\\Files\\Notify\\INotifyHandler' => __DIR__ . '/../../..' . '/lib/public/Files/Notify/INotifyHandler.php',
+ 'OCP\\Files\\Notify\\IRenameChange' => __DIR__ . '/../../..' . '/lib/public/Files/Notify/IRenameChange.php',
'OCP\\Files\\ObjectStore\\IObjectStore' => __DIR__ . '/../../..' . '/lib/public/Files/ObjectStore/IObjectStore.php',
'OCP\\Files\\ReservedWordException' => __DIR__ . '/../../..' . '/lib/public/Files/ReservedWordException.php',
'OCP\\Files\\SimpleFS\\ISimpleFile' => __DIR__ . '/../../..' . '/lib/public/Files/SimpleFS/ISimpleFile.php',
@@ -351,6 +357,8 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\Authentication\\Exceptions\\PasswordlessTokenException' => __DIR__ . '/../../..' . '/lib/private/Authentication/Exceptions/PasswordlessTokenException.php',
'OC\\Authentication\\Exceptions\\TwoFactorAuthRequiredException' => __DIR__ . '/../../..' . '/lib/private/Authentication/Exceptions/TwoFactorAuthRequiredException.php',
'OC\\Authentication\\Exceptions\\UserAlreadyLoggedInException' => __DIR__ . '/../../..' . '/lib/private/Authentication/Exceptions/UserAlreadyLoggedInException.php',
+ 'OC\\Authentication\\LoginCredentials\\Credentials' => __DIR__ . '/../../..' . '/lib/private/Authentication/LoginCredentials/Credentials.php',
+ 'OC\\Authentication\\LoginCredentials\\Store' => __DIR__ . '/../../..' . '/lib/private/Authentication/LoginCredentials/Store.php',
'OC\\Authentication\\Token\\DefaultToken' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/DefaultToken.php',
'OC\\Authentication\\Token\\DefaultTokenCleanupJob' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/DefaultTokenCleanupJob.php',
'OC\\Authentication\\Token\\DefaultTokenMapper' => __DIR__ . '/../../..' . '/lib/private/Authentication/Token/DefaultTokenMapper.php',
@@ -557,6 +565,8 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\Files\\Node\\NonExistingFile' => __DIR__ . '/../../..' . '/lib/private/Files/Node/NonExistingFile.php',
'OC\\Files\\Node\\NonExistingFolder' => __DIR__ . '/../../..' . '/lib/private/Files/Node/NonExistingFolder.php',
'OC\\Files\\Node\\Root' => __DIR__ . '/../../..' . '/lib/private/Files/Node/Root.php',
+ 'OC\\Files\\Notify\\Change' => __DIR__ . '/../../..' . '/lib/private/Files/Notify/Change.php',
+ 'OC\\Files\\Notify\\RenameChange' => __DIR__ . '/../../..' . '/lib/private/Files/Notify/RenameChange.php',
'OC\\Files\\ObjectStore\\HomeObjectStoreStorage' => __DIR__ . '/../../..' . '/lib/private/Files/ObjectStore/HomeObjectStoreStorage.php',
'OC\\Files\\ObjectStore\\Mapper' => __DIR__ . '/../../..' . '/lib/private/Files/ObjectStore/Mapper.php',
'OC\\Files\\ObjectStore\\NoopScanner' => __DIR__ . '/../../..' . '/lib/private/Files/ObjectStore/NoopScanner.php',
diff --git a/lib/l10n/zh_CN.js b/lib/l10n/zh_CN.js
index 05aa8cab94e..e2c683b68bb 100644
--- a/lib/l10n/zh_CN.js
+++ b/lib/l10n/zh_CN.js
@@ -2,19 +2,24 @@ OC.L10N.register(
"lib",
{
"Cannot write into \"config\" directory!" : "无法写入 \"config\" 目录!",
- "This can usually be fixed by giving the webserver write access to the config directory" : "对 Web 服务器设置 config 目录的写权限可以修复这个问题.",
+ "This can usually be fixed by giving the webserver write access to the config directory" : "您可以设置 Web 服务器对 config 目录的写权限修复这个问题",
"See %s" : "查看 %s",
- "This can usually be fixed by %sgiving the webserver write access to the config directory%s." : "对 Web 服务器%s设置 config 目录%s的写权限可以修复这个问题.",
+ "This can usually be fixed by %sgiving the webserver write access to the config directory%s." : "您可以由 %s 设置 Web 服务器对 config 目录 %s 的写权限修复这个问题",
+ "The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server." : "应用 %$1s 的文件替换不正确. 请确认版本与当前服务器兼容.",
"Sample configuration detected" : "示例配置检测",
+ "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "您似乎直接把 config.php 的样例文件直接复制使用. 这可能会破坏您的安装. 在对 config.php 进行修改之前请先阅读相关文档.",
"%1$s and %2$s" : "%1$s 和 %2$s",
"%1$s, %2$s and %3$s" : "%1$s, %2$s 和 %3$s",
"%1$s, %2$s, %3$s and %4$s" : "%1$s, %2$s, %3$s 和 %4$s",
"%1$s, %2$s, %3$s, %4$s and %5$s" : "%1$s, %2$s, %3$s, %4$s 和 %5$s",
"PHP %s or higher is required." : "要求 PHP 版本 %s 或者更高。",
"PHP with a version lower than %s is required." : "需要版本低于 %s 的PHP.",
+ "%sbit or higher PHP required." : "需要 %s 或更高版本的 PHP",
"Following databases are supported: %s" : "支持以下数据库: %s",
"The command line tool %s could not be found" : "命令行工具 %s 未找到",
"The library %s is not available." : "库文件 %s 不可用",
+ "Library %s with a version higher than %s is required - available version %s." : "%s 需要 %s 或更高的版本 - 可用版本 %s.",
+ "Library %s with a version lower than %s is required - available version %s." : "%s 需要 %s 或更低的版本 - 可用版本 %s.",
"Following platforms are supported: %s" : "支持以下平台:%s",
"Server version %s or higher is required." : "需要服务器版本 %s 或更高版本。",
"Server version %s or lower is required." : "需要服务器版本 %s 或更低版本。",
@@ -31,6 +36,7 @@ OC.L10N.register(
"_%n hour ago_::_%n hours ago_" : ["%n 小时前"],
"_%n minute ago_::_%n minutes ago_" : ["%n 分钟前"],
"seconds ago" : "秒前",
+ "Module with id: %s does not exist. Please enable it in your apps settings or contact your administrator." : "ID 为 %s 的模块不存在. 请在应用设置中启用或联系您的管理员.",
"File name is a reserved word" : "文件名包含敏感字符",
"File name contains at least one invalid character" : "文件名中存在至少一个非法字符",
"File name is too long" : "文件名过长",
@@ -64,27 +70,37 @@ OC.L10N.register(
"Invalid Federated Cloud ID" : "无效的联合云ID",
"%s shared »%s« with you" : "%s 向您分享了 »%s«",
"%s via %s" : "%s 通过 %s",
- "Sharing %s failed, because the file does not exist" : "共享 %s 失败,因为文件不存在。",
+ "Sharing %s failed, because the backend does not allow shares from type %i" : "分享 %s 失败, 因为后端不允许分享 %i 类型",
+ "Sharing %s failed, because the file does not exist" : "分享 %s 失败, 因为文件不存在.",
"You are not allowed to share %s" : "您无权分享 %s",
- "Sharing %s failed, because the user %s does not exist" : "共享 %s 失败,因为用户 %s 不存在",
- "Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" : "共享 %s 失败,因为用户 %s 不是 %s 所属的任何组的用户",
- "Sharing %s failed, because this item is already shared with %s" : "共享 %s 失败,因为它已经共享给 %s",
- "Sharing %s failed, because the group %s does not exist" : "共享 %s 失败,因为 %s 组不存在",
- "Sharing %s failed, because %s is not a member of the group %s" : "共享 %s 失败,因为 %s 不是 %s 组的成员",
- "Sharing %s failed, because sharing with links is not allowed" : "共享 %s 失败,因为不允许用链接共享",
+ "Sharing %s failed, because you can not share with yourself" : "分享 %s 失败, 因为您不能分享给自己",
+ "Sharing %s failed, because the user %s does not exist" : "分享 %s 失败, 因为用户 %s 不存在",
+ "Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" : "分享 %s 失败, 因为用户 %s 不是 %s 所属的任何组的用户",
+ "Sharing %s failed, because this item is already shared with %s" : "分享 %s 失败, 因为该项已经分享给用户 %s",
+ "Sharing %s failed, because this item is already shared with user %s" : "分享 %s 失败, 因为该项已经分享给用户 %s",
+ "Sharing %s failed, because the group %s does not exist" : "分享 %s 失败, 因为 %s 分组不存在",
+ "Sharing %s failed, because %s is not a member of the group %s" : "分享 %s 失败, 因为 %s 不是 %s 分组的成员",
+ "You need to provide a password to create a public link, only protected links are allowed" : "链接分享需要密码, 您需要提供一个密码以创建公开连接",
+ "Sharing %s failed, because sharing with links is not allowed" : "分享 %s 失败, 因为不允许使用链接分享",
"Not allowed to create a federated share with the same user" : "不能给你自己分享文件",
- "Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "文件:%s 分享失败,联合云无法找到 %s,请检查设置或联系管理员。",
+ "Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "分享 %s 失败, 无法找到 %s, 该服务当前无法连接.",
"Share type %s is not valid for %s" : "%s 不是 %s 的合法共享类型",
"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "设置 %s 权限失败,因为权限超出了 %s 已有权限。",
"Setting permissions for %s failed, because the item was not found" : "设置 %s 的权限失败,因为未找到到对应项",
- "Sharing backend %s must implement the interface OCP\\Share_Backend" : "共享后端 %s 必须实现 OCP\\Share_Backend 接口",
- "Sharing backend %s not found" : "未找到共享后端 %s",
- "Sharing backend for %s not found" : "%s 的共享后端未找到",
- "Sharing %s failed, because the permissions exceed permissions granted to %s" : "共享 %s 失败,因为权限超过了 %s 已有权限",
- "Sharing %s failed, because resharing is not allowed" : "共享 %s 失败,因为不允许二次共享",
- "Sharing %s failed, because the sharing backend for %s could not find its source" : "共享 %s 失败,因为 %s 使用的共享后端未找到它的来源",
- "Sharing %s failed, because the file could not be found in the file cache" : "共享 %s 失败,因为未在文件缓存中找到文件。",
+ "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "无法设置过期时间. 过期时间不能晚于其分享时间 %s",
+ "Cannot set expiration date. Expiration date is in the past" : "无法设置过期时间. 过期时间不能为过去",
+ "Cannot clear expiration date. Shares are required to have an expiration date." : "无法清除过期时间. 每个分享必须有一个过期时间",
+ "Sharing backend %s must implement the interface OCP\\Share_Backend" : "分享后端 %s 必须实现 OCP\\Share_Backend 接口",
+ "Sharing backend %s not found" : "%s 的分享后端未找到",
+ "Sharing backend for %s not found" : "%s 的分享后端未找到",
+ "Sharing failed, because the user %s is the original sharer" : "分享失败, 因为用户 %s 是原始的分享者.",
+ "Sharing %s failed, because the permissions exceed permissions granted to %s" : "分享 %s 失败, 因为权限超过了 %s 的已有权限",
+ "Sharing %s failed, because resharing is not allowed" : "分享 %s 失败, 因为不允许二次共享",
+ "Sharing %s failed, because the sharing backend for %s could not find its source" : "分享 %s 失败, 因为无法找到 %s 分享后端的来源",
+ "Sharing %s failed, because the file could not be found in the file cache" : "分享 %s 失败, 因为文件缓存中找不到该文件",
"Cannot increase permissions of %s" : "无法提升 %s 的权限",
+ "Files can't be shared with delete permissions" : "无法分享有删除权限的文件",
+ "Files can't be shared with create permissions" : "无法分享有创建权限的文件",
"Expiration date is in the past" : "到期日期已过.",
"Cannot set expiration date more than %s days in the future" : "无法将过期日期设置为超过 %s 天.",
"Could not find category \"%s\"" : "无法找到分类 \"%s\"",
@@ -102,13 +118,13 @@ OC.L10N.register(
"Thu." : "周四",
"Fri." : "周五",
"Sat." : "周六",
- "Su" : "日",
- "Mo" : "一",
+ "Su" : "日",
+ "Mo" : "一",
"Tu" : "二",
- "We" : "三",
+ "We" : "三",
"Th" : "四",
"Fr" : "五",
- "Sa" : "六",
+ "Sa" : "六",
"January" : "一月",
"February" : "二月",
"March" : "三月",
@@ -150,6 +166,7 @@ OC.L10N.register(
"No app name specified" : "没有指定的 App 名称",
"App '%s' could not be installed!" : "应用程序 '%s' 无法被安装!",
"App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "应用程序 \"%s\" 无法被安装,因为为满足下列依赖关系: %s",
+ "a safe home for all your data" : "给您所有的数据一个安全的家",
"File is currently busy, please try again later" : "文件当前正忙,请稍后再试",
"Can't read file" : "无法读取文件",
"Application is not enabled" : "应用程序未启用",
@@ -159,7 +176,10 @@ OC.L10N.register(
"No database drivers (sqlite, mysql, or postgresql) installed." : "没有安装数据库驱动 (SQLite、MySQL 或 PostgreSQL)。",
"Cannot write into \"config\" directory" : "无法写入“config”目录",
"Cannot write into \"apps\" directory" : "无法写入“apps”目录",
+ "This can usually be fixed by %sgiving the webserver write access to the apps directory%s or disabling the appstore in the config file." : "您可以由 %s 设置 Web 服务器对应用目录 %s 的写权限或在配置文件中禁用应用商店可以修复这个问题.",
"Cannot create \"data\" directory (%s)" : "无法创建“apps”目录 (%s)",
+ "This can usually be fixed by <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">giving the webserver write access to the root directory</a>." : "点击 <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">设置 Web 服务器对根目录的写入权限</a> 可修复这个问题.",
+ "Permissions can usually be fixed by %sgiving the webserver write access to the root directory%s." : "您可以由 %s 设置 Web 服务器对根目录 %s 的写权限可以修复这个问题.",
"Setting locale to %s failed" : "设置语言为 %s 失败",
"Please install one of these locales on your system and restart your webserver." : "请在您的系统中安装下述一种语言并重启 Web 服务器.",
"Please ask your server administrator to install the module." : "请联系服务器管理员安装模块.",
@@ -170,6 +190,7 @@ OC.L10N.register(
"To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini" : "请在 php.ini 中设置 <code>mbstring.func_overload</code> 为 <code>0</code> 以解决该问题",
"libxml2 2.7.0 is at least required. Currently %s is installed." : "至少需要 libxml2 2.7.0. 当前安装 %s.",
"To fix this issue update your libxml2 version and restart your web server." : "升级您的 libxml2 版本然后重启 Web 服务器以解决该问题.",
+ "PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible." : "PHP 被设置为移除内联块, 这将导致多个核心应用无法访问.",
"This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "这可能由缓存/加速器导致的, 例如 Zend OPcache 或 eAccelerator.",
"PHP modules have been installed, but they are still listed as missing?" : "PHP 模块已经安装, 但仍然显示未安装?",
"Please ask your server administrator to restart the web server." : "请联系服务器管理员重启 Web 服务器.",
diff --git a/lib/l10n/zh_CN.json b/lib/l10n/zh_CN.json
index 0bcf8862f1a..f5b88f87ad9 100644
--- a/lib/l10n/zh_CN.json
+++ b/lib/l10n/zh_CN.json
@@ -1,18 +1,23 @@
{ "translations": {
"Cannot write into \"config\" directory!" : "无法写入 \"config\" 目录!",
- "This can usually be fixed by giving the webserver write access to the config directory" : "对 Web 服务器设置 config 目录的写权限可以修复这个问题.",
+ "This can usually be fixed by giving the webserver write access to the config directory" : "您可以设置 Web 服务器对 config 目录的写权限修复这个问题",
"See %s" : "查看 %s",
- "This can usually be fixed by %sgiving the webserver write access to the config directory%s." : "对 Web 服务器%s设置 config 目录%s的写权限可以修复这个问题.",
+ "This can usually be fixed by %sgiving the webserver write access to the config directory%s." : "您可以由 %s 设置 Web 服务器对 config 目录 %s 的写权限修复这个问题",
+ "The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server." : "应用 %$1s 的文件替换不正确. 请确认版本与当前服务器兼容.",
"Sample configuration detected" : "示例配置检测",
+ "It has been detected that the sample configuration has been copied. This can break your installation and is unsupported. Please read the documentation before performing changes on config.php" : "您似乎直接把 config.php 的样例文件直接复制使用. 这可能会破坏您的安装. 在对 config.php 进行修改之前请先阅读相关文档.",
"%1$s and %2$s" : "%1$s 和 %2$s",
"%1$s, %2$s and %3$s" : "%1$s, %2$s 和 %3$s",
"%1$s, %2$s, %3$s and %4$s" : "%1$s, %2$s, %3$s 和 %4$s",
"%1$s, %2$s, %3$s, %4$s and %5$s" : "%1$s, %2$s, %3$s, %4$s 和 %5$s",
"PHP %s or higher is required." : "要求 PHP 版本 %s 或者更高。",
"PHP with a version lower than %s is required." : "需要版本低于 %s 的PHP.",
+ "%sbit or higher PHP required." : "需要 %s 或更高版本的 PHP",
"Following databases are supported: %s" : "支持以下数据库: %s",
"The command line tool %s could not be found" : "命令行工具 %s 未找到",
"The library %s is not available." : "库文件 %s 不可用",
+ "Library %s with a version higher than %s is required - available version %s." : "%s 需要 %s 或更高的版本 - 可用版本 %s.",
+ "Library %s with a version lower than %s is required - available version %s." : "%s 需要 %s 或更低的版本 - 可用版本 %s.",
"Following platforms are supported: %s" : "支持以下平台:%s",
"Server version %s or higher is required." : "需要服务器版本 %s 或更高版本。",
"Server version %s or lower is required." : "需要服务器版本 %s 或更低版本。",
@@ -29,6 +34,7 @@
"_%n hour ago_::_%n hours ago_" : ["%n 小时前"],
"_%n minute ago_::_%n minutes ago_" : ["%n 分钟前"],
"seconds ago" : "秒前",
+ "Module with id: %s does not exist. Please enable it in your apps settings or contact your administrator." : "ID 为 %s 的模块不存在. 请在应用设置中启用或联系您的管理员.",
"File name is a reserved word" : "文件名包含敏感字符",
"File name contains at least one invalid character" : "文件名中存在至少一个非法字符",
"File name is too long" : "文件名过长",
@@ -62,27 +68,37 @@
"Invalid Federated Cloud ID" : "无效的联合云ID",
"%s shared »%s« with you" : "%s 向您分享了 »%s«",
"%s via %s" : "%s 通过 %s",
- "Sharing %s failed, because the file does not exist" : "共享 %s 失败,因为文件不存在。",
+ "Sharing %s failed, because the backend does not allow shares from type %i" : "分享 %s 失败, 因为后端不允许分享 %i 类型",
+ "Sharing %s failed, because the file does not exist" : "分享 %s 失败, 因为文件不存在.",
"You are not allowed to share %s" : "您无权分享 %s",
- "Sharing %s failed, because the user %s does not exist" : "共享 %s 失败,因为用户 %s 不存在",
- "Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" : "共享 %s 失败,因为用户 %s 不是 %s 所属的任何组的用户",
- "Sharing %s failed, because this item is already shared with %s" : "共享 %s 失败,因为它已经共享给 %s",
- "Sharing %s failed, because the group %s does not exist" : "共享 %s 失败,因为 %s 组不存在",
- "Sharing %s failed, because %s is not a member of the group %s" : "共享 %s 失败,因为 %s 不是 %s 组的成员",
- "Sharing %s failed, because sharing with links is not allowed" : "共享 %s 失败,因为不允许用链接共享",
+ "Sharing %s failed, because you can not share with yourself" : "分享 %s 失败, 因为您不能分享给自己",
+ "Sharing %s failed, because the user %s does not exist" : "分享 %s 失败, 因为用户 %s 不存在",
+ "Sharing %s failed, because the user %s is not a member of any groups that %s is a member of" : "分享 %s 失败, 因为用户 %s 不是 %s 所属的任何组的用户",
+ "Sharing %s failed, because this item is already shared with %s" : "分享 %s 失败, 因为该项已经分享给用户 %s",
+ "Sharing %s failed, because this item is already shared with user %s" : "分享 %s 失败, 因为该项已经分享给用户 %s",
+ "Sharing %s failed, because the group %s does not exist" : "分享 %s 失败, 因为 %s 分组不存在",
+ "Sharing %s failed, because %s is not a member of the group %s" : "分享 %s 失败, 因为 %s 不是 %s 分组的成员",
+ "You need to provide a password to create a public link, only protected links are allowed" : "链接分享需要密码, 您需要提供一个密码以创建公开连接",
+ "Sharing %s failed, because sharing with links is not allowed" : "分享 %s 失败, 因为不允许使用链接分享",
"Not allowed to create a federated share with the same user" : "不能给你自己分享文件",
- "Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "文件:%s 分享失败,联合云无法找到 %s,请检查设置或联系管理员。",
+ "Sharing %s failed, could not find %s, maybe the server is currently unreachable." : "分享 %s 失败, 无法找到 %s, 该服务当前无法连接.",
"Share type %s is not valid for %s" : "%s 不是 %s 的合法共享类型",
"Setting permissions for %s failed, because the permissions exceed permissions granted to %s" : "设置 %s 权限失败,因为权限超出了 %s 已有权限。",
"Setting permissions for %s failed, because the item was not found" : "设置 %s 的权限失败,因为未找到到对应项",
- "Sharing backend %s must implement the interface OCP\\Share_Backend" : "共享后端 %s 必须实现 OCP\\Share_Backend 接口",
- "Sharing backend %s not found" : "未找到共享后端 %s",
- "Sharing backend for %s not found" : "%s 的共享后端未找到",
- "Sharing %s failed, because the permissions exceed permissions granted to %s" : "共享 %s 失败,因为权限超过了 %s 已有权限",
- "Sharing %s failed, because resharing is not allowed" : "共享 %s 失败,因为不允许二次共享",
- "Sharing %s failed, because the sharing backend for %s could not find its source" : "共享 %s 失败,因为 %s 使用的共享后端未找到它的来源",
- "Sharing %s failed, because the file could not be found in the file cache" : "共享 %s 失败,因为未在文件缓存中找到文件。",
+ "Cannot set expiration date. Shares cannot expire later than %s after they have been shared" : "无法设置过期时间. 过期时间不能晚于其分享时间 %s",
+ "Cannot set expiration date. Expiration date is in the past" : "无法设置过期时间. 过期时间不能为过去",
+ "Cannot clear expiration date. Shares are required to have an expiration date." : "无法清除过期时间. 每个分享必须有一个过期时间",
+ "Sharing backend %s must implement the interface OCP\\Share_Backend" : "分享后端 %s 必须实现 OCP\\Share_Backend 接口",
+ "Sharing backend %s not found" : "%s 的分享后端未找到",
+ "Sharing backend for %s not found" : "%s 的分享后端未找到",
+ "Sharing failed, because the user %s is the original sharer" : "分享失败, 因为用户 %s 是原始的分享者.",
+ "Sharing %s failed, because the permissions exceed permissions granted to %s" : "分享 %s 失败, 因为权限超过了 %s 的已有权限",
+ "Sharing %s failed, because resharing is not allowed" : "分享 %s 失败, 因为不允许二次共享",
+ "Sharing %s failed, because the sharing backend for %s could not find its source" : "分享 %s 失败, 因为无法找到 %s 分享后端的来源",
+ "Sharing %s failed, because the file could not be found in the file cache" : "分享 %s 失败, 因为文件缓存中找不到该文件",
"Cannot increase permissions of %s" : "无法提升 %s 的权限",
+ "Files can't be shared with delete permissions" : "无法分享有删除权限的文件",
+ "Files can't be shared with create permissions" : "无法分享有创建权限的文件",
"Expiration date is in the past" : "到期日期已过.",
"Cannot set expiration date more than %s days in the future" : "无法将过期日期设置为超过 %s 天.",
"Could not find category \"%s\"" : "无法找到分类 \"%s\"",
@@ -100,13 +116,13 @@
"Thu." : "周四",
"Fri." : "周五",
"Sat." : "周六",
- "Su" : "日",
- "Mo" : "一",
+ "Su" : "日",
+ "Mo" : "一",
"Tu" : "二",
- "We" : "三",
+ "We" : "三",
"Th" : "四",
"Fr" : "五",
- "Sa" : "六",
+ "Sa" : "六",
"January" : "一月",
"February" : "二月",
"March" : "三月",
@@ -148,6 +164,7 @@
"No app name specified" : "没有指定的 App 名称",
"App '%s' could not be installed!" : "应用程序 '%s' 无法被安装!",
"App \"%s\" cannot be installed because the following dependencies are not fulfilled: %s" : "应用程序 \"%s\" 无法被安装,因为为满足下列依赖关系: %s",
+ "a safe home for all your data" : "给您所有的数据一个安全的家",
"File is currently busy, please try again later" : "文件当前正忙,请稍后再试",
"Can't read file" : "无法读取文件",
"Application is not enabled" : "应用程序未启用",
@@ -157,7 +174,10 @@
"No database drivers (sqlite, mysql, or postgresql) installed." : "没有安装数据库驱动 (SQLite、MySQL 或 PostgreSQL)。",
"Cannot write into \"config\" directory" : "无法写入“config”目录",
"Cannot write into \"apps\" directory" : "无法写入“apps”目录",
+ "This can usually be fixed by %sgiving the webserver write access to the apps directory%s or disabling the appstore in the config file." : "您可以由 %s 设置 Web 服务器对应用目录 %s 的写权限或在配置文件中禁用应用商店可以修复这个问题.",
"Cannot create \"data\" directory (%s)" : "无法创建“apps”目录 (%s)",
+ "This can usually be fixed by <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">giving the webserver write access to the root directory</a>." : "点击 <a href=\"%s\" target=\"_blank\" rel=\"noreferrer\">设置 Web 服务器对根目录的写入权限</a> 可修复这个问题.",
+ "Permissions can usually be fixed by %sgiving the webserver write access to the root directory%s." : "您可以由 %s 设置 Web 服务器对根目录 %s 的写权限可以修复这个问题.",
"Setting locale to %s failed" : "设置语言为 %s 失败",
"Please install one of these locales on your system and restart your webserver." : "请在您的系统中安装下述一种语言并重启 Web 服务器.",
"Please ask your server administrator to install the module." : "请联系服务器管理员安装模块.",
@@ -168,6 +188,7 @@
"To fix this issue set <code>mbstring.func_overload</code> to <code>0</code> in your php.ini" : "请在 php.ini 中设置 <code>mbstring.func_overload</code> 为 <code>0</code> 以解决该问题",
"libxml2 2.7.0 is at least required. Currently %s is installed." : "至少需要 libxml2 2.7.0. 当前安装 %s.",
"To fix this issue update your libxml2 version and restart your web server." : "升级您的 libxml2 版本然后重启 Web 服务器以解决该问题.",
+ "PHP is apparently set up to strip inline doc blocks. This will make several core apps inaccessible." : "PHP 被设置为移除内联块, 这将导致多个核心应用无法访问.",
"This is probably caused by a cache/accelerator such as Zend OPcache or eAccelerator." : "这可能由缓存/加速器导致的, 例如 Zend OPcache 或 eAccelerator.",
"PHP modules have been installed, but they are still listed as missing?" : "PHP 模块已经安装, 但仍然显示未安装?",
"Please ask your server administrator to restart the web server." : "请联系服务器管理员重启 Web 服务器.",
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index 57499f3ffe8..0879b3e9330 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -93,6 +93,10 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return new Output($this->getServer()->getWebRoot());
});
+ $this->registerService(\OCP\Authentication\LoginCredentials\IStore::class, function() {
+ return $this->getServer()->query(\OCP\Authentication\LoginCredentials\IStore::class);
+ });
+
$this->registerService('OCP\\IAvatarManager', function($c) {
return $this->getServer()->getAvatarManager();
});
diff --git a/lib/private/Authentication/LoginCredentials/Credentials.php b/lib/private/Authentication/LoginCredentials/Credentials.php
new file mode 100644
index 00000000000..9314b7489db
--- /dev/null
+++ b/lib/private/Authentication/LoginCredentials/Credentials.php
@@ -0,0 +1,72 @@
+<?php
+
+/**
+ * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @author 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OC\Authentication\LoginCredentials;
+
+use OCP\Authentication\LoginCredentials\ICredentials;
+
+class Credentials implements ICredentials {
+
+ /** @var string */
+ private $uid;
+
+ /** @var string */
+ private $loginName;
+
+ /** @var string */
+ private $password;
+
+ /**
+ * @param string $uid
+ * @param string $loginName
+ * @param string $password
+ */
+ public function __construct($uid, $loginName, $password) {
+ $this->uid = $uid;
+ $this->loginName = $loginName;
+ $this->password = $password;
+ }
+
+ /**
+ * @return string
+ */
+ public function getUID() {
+ return $this->uid;
+ }
+
+ /**
+ * @return string
+ */
+ public function getLoginName() {
+ return $this->loginName;
+ }
+
+ /**
+ * @return string
+ */
+ public function getPassword() {
+ return $this->password;
+ }
+
+}
diff --git a/lib/private/Authentication/LoginCredentials/Store.php b/lib/private/Authentication/LoginCredentials/Store.php
new file mode 100644
index 00000000000..e44c88c7aea
--- /dev/null
+++ b/lib/private/Authentication/LoginCredentials/Store.php
@@ -0,0 +1,120 @@
+<?php
+
+/**
+ * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @author 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OC\Authentication\LoginCredentials;
+
+use OC\Authentication\Exceptions\InvalidTokenException;
+use OC\Authentication\Exceptions\PasswordlessTokenException;
+use OC\Authentication\Token\IProvider;
+use OCP\Authentication\Exceptions\CredentialsUnavailableException;
+use OCP\Authentication\LoginCredentials\ICredentials;
+use OCP\Authentication\LoginCredentials\IStore;
+use OCP\ILogger;
+use OCP\ISession;
+use OCP\Session\Exceptions\SessionNotAvailableException;
+use OCP\Util;
+
+class Store implements IStore {
+
+ /** @var ISession */
+ private $session;
+
+ /** @var ILogger */
+ private $logger;
+
+ /** @var IProvider|null */
+ private $tokenProvider;
+
+ /**
+ * @param ISession $session
+ * @param ILogger $logger
+ * @param IProvider $tokenProvider
+ */
+ public function __construct(ISession $session, ILogger $logger, IProvider $tokenProvider = null) {
+ $this->session = $session;
+ $this->logger = $logger;
+ $this->tokenProvider = $tokenProvider;
+
+ Util::connectHook('OC_User', 'post_login', $this, 'authenticate');
+ }
+
+ /**
+ * Hook listener on post login
+ *
+ * @param array $params
+ */
+ public function authenticate(array $params) {
+ $this->session->set('login_credentials', json_encode($params));
+ }
+
+ /**
+ * Replace the session implementation
+ *
+ * @param ISession $session
+ */
+ public function setSession(ISession $session) {
+ $this->session = $session;
+ }
+
+ /**
+ * @since 12
+ *
+ * @return ICredentials the login credentials of the current user
+ * @throws CredentialsUnavailableException
+ */
+ public function getLoginCredentials() {
+ if (is_null($this->tokenProvider)) {
+ throw new CredentialsUnavailableException();
+ }
+
+ $trySession = false;
+ try {
+ $sessionId = $this->session->getId();
+ $token = $this->tokenProvider->getToken($sessionId);
+
+ $uid = $token->getUID();
+ $user = $token->getLoginName();
+ $password = $this->tokenProvider->getPassword($token, $sessionId);
+
+ return new Credentials($uid, $user, $password);
+ } catch (SessionNotAvailableException $ex) {
+ $this->logger->debug('could not get login credentials because session is unavailable', ['app' => 'core']);
+ } catch (InvalidTokenException $ex) {
+ $this->logger->debug('could not get login credentials because the token is invalid', ['app' => 'core']);
+ $trySession = true;
+ } catch (PasswordlessTokenException $ex) {
+ $this->logger->debug('could not get login credentials because the token has no password', ['app' => 'core']);
+ $trySession = true;
+ }
+
+ if ($trySession && $this->session->exists('login_credentials')) {
+ $creds = json_decode($this->session->get('login_credentials'));
+ return new Credentials($creds->uid, $creds->uid, $creds->password);
+ }
+
+ // If we reach this line, an exception was thrown.
+ throw new CredentialsUnavailableException();
+ }
+
+}
diff --git a/lib/private/Files/Notify/Change.php b/lib/private/Files/Notify/Change.php
new file mode 100644
index 00000000000..78cc007b27d
--- /dev/null
+++ b/lib/private/Files/Notify/Change.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @author Robin Appelman <robin@icewind.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OC\Files\Notify;
+
+use OCP\Files\Notify\IChange;
+
+class Change implements IChange {
+ /** @var int */
+ private $type;
+
+ /** @var string */
+ private $path;
+
+ /**
+ * Change constructor.
+ *
+ * @param int $type
+ * @param string $path
+ */
+ public function __construct($type, $path) {
+ $this->type = $type;
+ $this->path = $path;
+ }
+
+ /**
+ * Get the type of the change
+ *
+ * @return int IChange::ADDED, IChange::REMOVED, IChange::MODIFIED or IChange::RENAMED
+ */
+ public function getType() {
+ return $this->type;
+ }
+
+ /**
+ * Get the path of the file that was changed relative to the root of the storage
+ *
+ * Note, for rename changes this path is the old path for the file
+ *
+ * @return mixed
+ */
+ public function getPath() {
+ return $this->path;
+ }
+}
diff --git a/lib/private/Files/Notify/RenameChange.php b/lib/private/Files/Notify/RenameChange.php
new file mode 100644
index 00000000000..b83dffa0cb2
--- /dev/null
+++ b/lib/private/Files/Notify/RenameChange.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @author Robin Appelman <robin@icewind.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OC\Files\Notify;
+
+use OCP\Files\Notify\IRenameChange;
+
+class RenameChange extends Change implements IRenameChange {
+ /** @var string */
+ private $targetPath;
+
+ /**
+ * Change constructor.
+ *
+ * @param int $type
+ * @param string $path
+ * @param string $targetPath
+ */
+ public function __construct($type, $path, $targetPath) {
+ parent::__construct($type, $path);
+ $this->targetPath = $targetPath;
+ }
+
+ /**
+ * Get the new path of the renamed file relative to the storage root
+ *
+ * @return string
+ */
+ public function getTargetPath() {
+ return $this->targetPath;
+ }
+}
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php
index 4fe7dcafbbf..80d48680be1 100644
--- a/lib/private/Files/Storage/Local.php
+++ b/lib/private/Files/Storage/Local.php
@@ -205,18 +205,7 @@ class Local extends \OC\Files\Storage\Common {
}
public function file_get_contents($path) {
- // file_get_contents() has a memory leak: https://bugs.php.net/bug.php?id=61961
- $fileName = $this->getSourcePath($path);
-
- $fileSize = filesize($fileName);
- if ($fileSize === 0) {
- return '';
- }
-
- $handle = fopen($fileName, 'rb');
- $content = fread($handle, $fileSize);
- fclose($handle);
- return $content;
+ return file_get_contents($this->getSourcePath($path));
}
public function file_put_contents($path, $data) {
diff --git a/lib/private/Server.php b/lib/private/Server.php
index bd8818e9460..3c716ae6ce6 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -46,6 +46,7 @@ use OC\App\AppStore\Fetcher\AppFetcher;
use OC\App\AppStore\Fetcher\CategoryFetcher;
use OC\AppFramework\Http\Request;
use OC\AppFramework\Utility\TimeFactory;
+use OC\Authentication\LoginCredentials\Store;
use OC\Command\AsyncBus;
use OC\Diagnostics\EventLogger;
use OC\Diagnostics\NullEventLogger;
@@ -89,6 +90,7 @@ use OC\Security\TrustedDomainHelper;
use OC\Session\CryptoWrapper;
use OC\Tagging\TagMapper;
use OCA\Theming\ThemingDefaults;
+use OCP\Authentication\LoginCredentials\IStore;
use OCP\IL10N;
use OCP\IServerContainer;
use OCP\RichObjectStrings\IValidator;
@@ -246,6 +248,17 @@ class Server extends ServerContainer implements IServerContainer {
});
return $groupManager;
});
+ $this->registerService(Store::class, function(Server $c) {
+ $session = $c->getSession();
+ if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
+ $tokenProvider = $c->query('OC\Authentication\Token\IProvider');
+ } else {
+ $tokenProvider = null;
+ }
+ $logger = $c->getLogger();
+ return new Store($session, $logger, $tokenProvider);
+ });
+ $this->registerAlias(IStore::class, Store::class);
$this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) {
$dbConnection = $c->getDatabaseConnection();
return new Authentication\Token\DefaultTokenMapper($dbConnection);
@@ -1000,7 +1013,8 @@ class Server extends ServerContainer implements IServerContainer {
*/
public function setSession(\OCP\ISession $session) {
$this->query(SessionStorage::class)->setSession($session);
- return $this->query('UserSession')->setSession($session);
+ $this->query('UserSession')->setSession($session);
+ $this->query(Store::class)->setSession($session);
}
/**
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index d97ba37c4c0..5ef1130d361 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -1002,27 +1002,6 @@ 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;
- }
-
- /**
* Check if the user is a subadmin, redirects to home if not
*
* @return null|boolean $groups where the current user is subadmin
diff --git a/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php b/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php
new file mode 100644
index 00000000000..9f9e38103f7
--- /dev/null
+++ b/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php
@@ -0,0 +1,34 @@
+<?php
+
+/**
+ * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @author 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Authentication\Exceptions;
+
+use Exception;
+
+/**
+ * @since 12
+ */
+class CredentialsUnavailableException extends Exception {
+
+}
diff --git a/lib/public/Authentication/LoginCredentials/ICredentials.php b/lib/public/Authentication/LoginCredentials/ICredentials.php
new file mode 100644
index 00000000000..c5ef9574398
--- /dev/null
+++ b/lib/public/Authentication/LoginCredentials/ICredentials.php
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @author 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Authentication\LoginCredentials;
+
+/**
+ * @since 12
+ */
+interface ICredentials {
+
+ /**
+ * Get the user UID
+ *
+ * @since 12
+ *
+ * @return string
+ */
+ public function getUID();
+
+ /**
+ * Get the login name the users used to login
+ *
+ * @since 12
+ *
+ * @return string
+ */
+ public function getLoginName();
+
+ /**
+ * Get the password
+ *
+ * @since 12
+ *
+ * @return string
+ */
+ public function getPassword();
+}
diff --git a/lib/public/Authentication/LoginCredentials/IStore.php b/lib/public/Authentication/LoginCredentials/IStore.php
new file mode 100644
index 00000000000..4787b16d982
--- /dev/null
+++ b/lib/public/Authentication/LoginCredentials/IStore.php
@@ -0,0 +1,44 @@
+<?php
+
+/**
+ * @copyright 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @author 2016 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Authentication\LoginCredentials;
+
+use OCP\Authentication\Exceptions\CredentialsUnavailableException;
+
+/**
+ * @since 12
+ */
+interface IStore {
+
+ /**
+ * Get login credentials of the currently logged in user
+ *
+ * @since 12
+ *
+ * @throws CredentialsUnavailableException
+ * @return ICredentials the login credentials of the current user
+ */
+ public function getLoginCredentials();
+
+}
diff --git a/lib/public/Files/Notify/IChange.php b/lib/public/Files/Notify/IChange.php
new file mode 100644
index 00000000000..1e6aaa8abe0
--- /dev/null
+++ b/lib/public/Files/Notify/IChange.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @author Robin Appelman <robin@icewind.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Files\Notify;
+
+/**
+ * Represents a detected change in the storage
+ *
+ * @since 12.0.0
+ */
+interface IChange {
+ const ADDED = 1;
+ const REMOVED = 2;
+ const MODIFIED = 3;
+ const RENAMED = 4;
+
+ /**
+ * Get the type of the change
+ *
+ * @return int IChange::ADDED, IChange::REMOVED, IChange::MODIFIED or IChange::RENAMED
+ *
+ * @since 12.0.0
+ */
+ public function getType();
+
+ /**
+ * Get the path of the file that was changed relative to the root of the storage
+ *
+ * Note, for rename changes this path is the old path for the file
+ *
+ * @return mixed
+ *
+ * @since 12.0.0
+ */
+ public function getPath();
+}
diff --git a/lib/public/Files/Notify/INotifyHandler.php b/lib/public/Files/Notify/INotifyHandler.php
new file mode 100644
index 00000000000..7e0e6a610d8
--- /dev/null
+++ b/lib/public/Files/Notify/INotifyHandler.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @author Robin Appelman <robin@icewind.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Files\Notify;
+
+/**
+ * Provides access to detected changes in the storage by either actively listening
+ * or getting the list of changes that happened in the background
+ *
+ * @since 12.0.0
+ */
+interface INotifyHandler {
+ /**
+ * Start listening for update notifications
+ *
+ * The provided callback will be called for every incoming notification with the following parameters
+ * - IChange|IRenameChange $change
+ *
+ * Note that this call is blocking and will not exit on it's own, to stop listening for notifications return `false` from the callback
+ *
+ * @param callable $callback
+ *
+ * @since 12.0.0
+ */
+ public function listen(callable $callback);
+
+ /**
+ * Get all changes detected since the start of the notify process or the last call to getChanges
+ *
+ * @return IChange[]
+ *
+ * @since 12.0.0
+ */
+ public function getChanges();
+
+ /**
+ * Stop listening for changes
+ *
+ * Note that any pending changes will be discarded
+ *
+ * @since 12.0.0
+ */
+ public function stop();
+}
diff --git a/lib/public/Files/Notify/IRenameChange.php b/lib/public/Files/Notify/IRenameChange.php
new file mode 100644
index 00000000000..c95499a7e74
--- /dev/null
+++ b/lib/public/Files/Notify/IRenameChange.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @author Robin Appelman <robin@icewind.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Files\Notify;
+
+/**
+ * Represents a detected rename change
+ *
+ * @since 12.0.0
+ */
+interface IRenameChange extends IChange {
+ /**
+ * Get the new path of the renamed file relative to the storage root
+ *
+ * @return string
+ *
+ * @since 12.0.0
+ */
+ public function getTargetPath();
+}
diff --git a/lib/public/Files/Storage/INotifyStorage.php b/lib/public/Files/Storage/INotifyStorage.php
index e99124abdfd..c6fdd44724f 100644
--- a/lib/public/Files/Storage/INotifyStorage.php
+++ b/lib/public/Files/Storage/INotifyStorage.php
@@ -23,6 +23,8 @@
namespace OCP\Files\Storage;
+use OCP\Files\Notify\INotifyHandler;
+
/**
* Storage backend that support active notifications
*
@@ -48,6 +50,17 @@ interface INotifyStorage {
* @param callable $callback
*
* @since 9.1.0
+ * @deprecated 12.0.0 use INotifyStorage::notify()->listen() instead
*/
public function listen($path, callable $callback);
+
+ /**
+ * Start the notification handler for this storage
+ *
+ * @param $path
+ * @return INotifyHandler
+ *
+ * @since 12.0.0
+ */
+ public function notify($path);
}