aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php8
-rw-r--r--lib/composer/composer/autoload_classmap.php1
-rw-r--r--lib/composer/composer/autoload_static.php1
-rw-r--r--lib/l10n/ko.js5
-rw-r--r--lib/l10n/ko.json5
-rw-r--r--lib/private/Files/SetupManager.php3
-rw-r--r--lib/private/User/LazyUser.php4
-rw-r--r--lib/private/User/User.php13
-rw-r--r--lib/private/legacy/OC_Helper.php2
-rw-r--r--lib/private/legacy/OC_Util.php2
-rw-r--r--lib/public/IUser.php9
11 files changed, 45 insertions, 8 deletions
diff --git a/lib/base.php b/lib/base.php
index ad80df357c5..639568cf640 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -551,10 +551,10 @@ class OC {
$processingScript = explode('/', $requestUri);
$processingScript = $processingScript[count($processingScript) - 1];
- // index.php routes are handled in the middleware
- // and cron.php does not need any authentication at all
- if ($processingScript === 'index.php'
- || $processingScript === 'cron.php') {
+ if ($processingScript === 'index.php' // index.php routes are handled in the middleware
+ || $processingScript === 'cron.php' // and cron.php does not need any authentication at all
+ || $processingScript === 'public.php' // For public.php, auth for password protected shares is done in the PublicAuth plugin
+ ) {
return;
}
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index c65c26af2f2..61c06939d15 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -1387,6 +1387,7 @@ return array(
'OC\\Core\\Exception\\ResetPasswordException' => $baseDir . '/core/Exception/ResetPasswordException.php',
'OC\\Core\\Listener\\BeforeMessageLoggedEventListener' => $baseDir . '/core/Listener/BeforeMessageLoggedEventListener.php',
'OC\\Core\\Listener\\BeforeTemplateRenderedListener' => $baseDir . '/core/Listener/BeforeTemplateRenderedListener.php',
+ 'OC\\Core\\Listener\\FeedBackHandler' => $baseDir . '/core/Listener/FeedBackHandler.php',
'OC\\Core\\Middleware\\TwoFactorMiddleware' => $baseDir . '/core/Middleware/TwoFactorMiddleware.php',
'OC\\Core\\Migrations\\Version13000Date20170705121758' => $baseDir . '/core/Migrations/Version13000Date20170705121758.php',
'OC\\Core\\Migrations\\Version13000Date20170718121200' => $baseDir . '/core/Migrations/Version13000Date20170718121200.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index b1e162bf71e..f6da9ef7382 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -1428,6 +1428,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OC\\Core\\Exception\\ResetPasswordException' => __DIR__ . '/../../..' . '/core/Exception/ResetPasswordException.php',
'OC\\Core\\Listener\\BeforeMessageLoggedEventListener' => __DIR__ . '/../../..' . '/core/Listener/BeforeMessageLoggedEventListener.php',
'OC\\Core\\Listener\\BeforeTemplateRenderedListener' => __DIR__ . '/../../..' . '/core/Listener/BeforeTemplateRenderedListener.php',
+ 'OC\\Core\\Listener\\FeedBackHandler' => __DIR__ . '/../../..' . '/core/Listener/FeedBackHandler.php',
'OC\\Core\\Middleware\\TwoFactorMiddleware' => __DIR__ . '/../../..' . '/core/Middleware/TwoFactorMiddleware.php',
'OC\\Core\\Migrations\\Version13000Date20170705121758' => __DIR__ . '/../../..' . '/core/Migrations/Version13000Date20170705121758.php',
'OC\\Core\\Migrations\\Version13000Date20170718121200' => __DIR__ . '/../../..' . '/core/Migrations/Version13000Date20170718121200.php',
diff --git a/lib/l10n/ko.js b/lib/l10n/ko.js
index 2ae40fc9454..375f75f4583 100644
--- a/lib/l10n/ko.js
+++ b/lib/l10n/ko.js
@@ -140,6 +140,7 @@ OC.L10N.register(
"The requested share comes from a disabled user" : "요청한 공유가 비활성화된 사용자로부터 수신되었습니다",
"The user was not created because the user limit has been reached. Check your notifications to learn more." : "사용자 수 제한에 도달하여 사용자를 만들 수 없습니다. 더 자세한 정보는 알림을 참조하십시오.",
"Could not find category \"%s\"" : "분류 \"%s\"을(를) 찾을 수 없습니다",
+ "Input text" : "텍스트를 입력",
"Sunday" : "일요일",
"Monday" : "월요일",
"Tuesday" : "화요일",
@@ -234,12 +235,16 @@ OC.L10N.register(
"Storage connection timeout. %s" : "저장소 연결 시간이 초과되었습니다. %s",
"Audio input" : "음성 입력",
"Confirmation" : "확인",
+ "Generated response" : "생성된 응답",
"Context write" : "컨텍스트 쓰기",
"Writes text in a given style based on the provided source material." : "제공된 소스 자료를 기반으로 특정 스타일로 텍스트를 작성합니다.",
"Writing style" : "작문 스타일",
"Source material" : "소스 자료",
"Generate image" : "이미지 생성",
"Prompt" : "프롬프트",
+ "Change Tone" : "톤을 변경",
+ "Write a text that you want the assistant to rewrite in another tone." : "어시스턴트에 다른 톤으로 다시 쓰고 싶은 텍스트를 쓰기",
+ "Desired tone" : "희망하는 톤",
"Chat" : "대화",
"Generates a possible headline for a text." : "내용에 대한 헤드라인을 생성하십시오.",
"Text" : "텍스트",
diff --git a/lib/l10n/ko.json b/lib/l10n/ko.json
index 2c2001dcc04..3fe9b3cdebd 100644
--- a/lib/l10n/ko.json
+++ b/lib/l10n/ko.json
@@ -138,6 +138,7 @@
"The requested share comes from a disabled user" : "요청한 공유가 비활성화된 사용자로부터 수신되었습니다",
"The user was not created because the user limit has been reached. Check your notifications to learn more." : "사용자 수 제한에 도달하여 사용자를 만들 수 없습니다. 더 자세한 정보는 알림을 참조하십시오.",
"Could not find category \"%s\"" : "분류 \"%s\"을(를) 찾을 수 없습니다",
+ "Input text" : "텍스트를 입력",
"Sunday" : "일요일",
"Monday" : "월요일",
"Tuesday" : "화요일",
@@ -232,12 +233,16 @@
"Storage connection timeout. %s" : "저장소 연결 시간이 초과되었습니다. %s",
"Audio input" : "음성 입력",
"Confirmation" : "확인",
+ "Generated response" : "생성된 응답",
"Context write" : "컨텍스트 쓰기",
"Writes text in a given style based on the provided source material." : "제공된 소스 자료를 기반으로 특정 스타일로 텍스트를 작성합니다.",
"Writing style" : "작문 스타일",
"Source material" : "소스 자료",
"Generate image" : "이미지 생성",
"Prompt" : "프롬프트",
+ "Change Tone" : "톤을 변경",
+ "Write a text that you want the assistant to rewrite in another tone." : "어시스턴트에 다른 톤으로 다시 쓰고 싶은 텍스트를 쓰기",
+ "Desired tone" : "희망하는 톤",
"Chat" : "대화",
"Generates a possible headline for a text." : "내용에 대한 헤드라인을 생성하십시오.",
"Text" : "텍스트",
diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php
index 7f97187179e..4ab40b01f4a 100644
--- a/lib/private/Files/SetupManager.php
+++ b/lib/private/Files/SetupManager.php
@@ -23,7 +23,6 @@ use OC\Share\Share;
use OC\Share20\ShareDisableChecker;
use OC_App;
use OC_Hook;
-use OC_Util;
use OCA\Files_External\Config\ExternalMountPoint;
use OCA\Files_Sharing\External\Mount;
use OCA\Files_Sharing\ISharedMountPoint;
@@ -157,7 +156,7 @@ class SetupManager {
if ($mount instanceof HomeMountPoint) {
$user = $mount->getUser();
return new Quota(['storage' => $storage, 'quotaCallback' => function () use ($user) {
- return OC_Util::getUserQuota($user);
+ return $user->getQuotaBytes();
}, 'root' => 'files', 'include_external_storage' => $quotaIncludeExternal]);
}
diff --git a/lib/private/User/LazyUser.php b/lib/private/User/LazyUser.php
index 715265f6a39..501169019d4 100644
--- a/lib/private/User/LazyUser.php
+++ b/lib/private/User/LazyUser.php
@@ -160,6 +160,10 @@ class LazyUser implements IUser {
return $this->getUser()->getQuota();
}
+ public function getQuotaBytes(): int|float {
+ return $this->getUser()->getQuotaBytes();
+ }
+
public function setQuota($quota) {
$this->getUser()->setQuota($quota);
}
diff --git a/lib/private/User/User.php b/lib/private/User/User.php
index 8e01a15695c..88ed0d44387 100644
--- a/lib/private/User/User.php
+++ b/lib/private/User/User.php
@@ -558,6 +558,19 @@ class User implements IUser {
return $quota;
}
+ public function getQuotaBytes(): int|float {
+ $quota = $this->getQuota();
+ if ($quota === 'none') {
+ return \OCP\Files\FileInfo::SPACE_UNLIMITED;
+ }
+
+ $bytes = \OCP\Util::computerFileSize($quota);
+ if ($bytes === false) {
+ return \OCP\Files\FileInfo::SPACE_UNKNOWN;
+ }
+ return $bytes;
+ }
+
/**
* set the users' quota
*
diff --git a/lib/private/legacy/OC_Helper.php b/lib/private/legacy/OC_Helper.php
index 87c820dcd53..4388f775623 100644
--- a/lib/private/legacy/OC_Helper.php
+++ b/lib/private/legacy/OC_Helper.php
@@ -272,7 +272,7 @@ class OC_Helper {
} else {
$user = \OC::$server->getUserSession()->getUser();
}
- $quota = OC_Util::getUserQuota($user);
+ $quota = $user?->getQuotaBytes() ?? \OCP\Files\FileInfo::SPACE_UNKNOWN;
if ($quota !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
// always get free space / total space from root + mount points
return self::getGlobalStorageInfo($quota, $user, $mount);
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php
index 9444da4f36d..87447af8adc 100644
--- a/lib/private/legacy/OC_Util.php
+++ b/lib/private/legacy/OC_Util.php
@@ -98,7 +98,7 @@ class OC_Util {
*
* @param IUser|null $user
* @return int|\OCP\Files\FileInfo::SPACE_UNLIMITED|false|float Quota bytes
- * @deprecated 9.0.0 - Use \OCP\IUser::getQuota
+ * @deprecated 9.0.0 - Use \OCP\IUser::getQuota or \OCP\IUser::getQuotaBytes
*/
public static function getUserQuota(?IUser $user) {
if (is_null($user)) {
diff --git a/lib/public/IUser.php b/lib/public/IUser.php
index 52f79083dc1..945e7e1602a 100644
--- a/lib/public/IUser.php
+++ b/lib/public/IUser.php
@@ -281,6 +281,15 @@ interface IUser {
public function getQuota();
/**
+ * Get the users' quota in machine readable form. If a specific quota is set
+ * for the user, then the quota is returned in bytes. Otherwise the default value is returned.
+ * If a default setting was not set, it is return as `\OCP\Files\FileInfo::SPACE_UNLIMITED`, i.e. quota is not limited.
+ *
+ * @since 32.0.0
+ */
+ public function getQuotaBytes(): int|float;
+
+ /**
* set the users' quota
*
* @param string $quota