diff options
Diffstat (limited to 'lib')
47 files changed, 370 insertions, 127 deletions
diff --git a/lib/base.php b/lib/base.php index 2b08137aff2..876d62c3596 100644 --- a/lib/base.php +++ b/lib/base.php @@ -393,6 +393,12 @@ class OC { $cookie_path = OC::$WEBROOT ? : '/'; ini_set('session.cookie_path', $cookie_path); + // set the cookie domain to the Nextcloud domain + $cookie_domain = self::$config->getValue('cookie_domain', ''); + if ($cookie_domain) { + ini_set('session.cookie_domain', $cookie_domain); + } + // Let the session name be changed in the initSession Hook $sessionName = OC_Util::getInstanceId(); @@ -618,6 +624,9 @@ class OC { } $loaderEnd = microtime(true); + // Enable lazy loading if activated + \OC\AppFramework\Utility\SimpleContainer::$useLazyObjects = (bool)self::$config->getValue('enable_lazy_objects', true); + // setup the basic server self::$server = new \OC\Server(\OC::$WEBROOT, self::$config); self::$server->boot(); diff --git a/lib/composer/autoload.php b/lib/composer/autoload.php index b3b39129e7a..7b1481e876c 100644 --- a/lib/composer/autoload.php +++ b/lib/composer/autoload.php @@ -14,10 +14,7 @@ if (PHP_VERSION_ID < 50600) { echo $err; } } - trigger_error( - $err, - E_USER_ERROR - ); + throw new RuntimeException($err); } require_once __DIR__ . '/composer/autoload_real.php'; diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 36f64d970c3..3bf63efce0f 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -679,6 +679,7 @@ return array( 'OCP\\OCM\\Events\\ResourceTypeRegisterEvent' => $baseDir . '/lib/public/OCM/Events/ResourceTypeRegisterEvent.php', 'OCP\\OCM\\Exceptions\\OCMArgumentException' => $baseDir . '/lib/public/OCM/Exceptions/OCMArgumentException.php', 'OCP\\OCM\\Exceptions\\OCMProviderException' => $baseDir . '/lib/public/OCM/Exceptions/OCMProviderException.php', + 'OCP\\OCM\\ICapabilityAwareOCMProvider' => $baseDir . '/lib/public/OCM/ICapabilityAwareOCMProvider.php', 'OCP\\OCM\\IOCMDiscoveryService' => $baseDir . '/lib/public/OCM/IOCMDiscoveryService.php', 'OCP\\OCM\\IOCMProvider' => $baseDir . '/lib/public/OCM/IOCMProvider.php', 'OCP\\OCM\\IOCMResource' => $baseDir . '/lib/public/OCM/IOCMResource.php', @@ -1330,6 +1331,7 @@ return array( 'OC\\Core\\Command\\User\\Keys\\Verify' => $baseDir . '/core/Command/User/Keys/Verify.php', 'OC\\Core\\Command\\User\\LastSeen' => $baseDir . '/core/Command/User/LastSeen.php', 'OC\\Core\\Command\\User\\ListCommand' => $baseDir . '/core/Command/User/ListCommand.php', + 'OC\\Core\\Command\\User\\Profile' => $baseDir . '/core/Command/User/Profile.php', 'OC\\Core\\Command\\User\\Report' => $baseDir . '/core/Command/User/Report.php', 'OC\\Core\\Command\\User\\ResetPassword' => $baseDir . '/core/Command/User/ResetPassword.php', 'OC\\Core\\Command\\User\\Setting' => $baseDir . '/core/Command/User/Setting.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index 327366ca889..f076aaca783 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -720,6 +720,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OCP\\OCM\\Events\\ResourceTypeRegisterEvent' => __DIR__ . '/../../..' . '/lib/public/OCM/Events/ResourceTypeRegisterEvent.php', 'OCP\\OCM\\Exceptions\\OCMArgumentException' => __DIR__ . '/../../..' . '/lib/public/OCM/Exceptions/OCMArgumentException.php', 'OCP\\OCM\\Exceptions\\OCMProviderException' => __DIR__ . '/../../..' . '/lib/public/OCM/Exceptions/OCMProviderException.php', + 'OCP\\OCM\\ICapabilityAwareOCMProvider' => __DIR__ . '/../../..' . '/lib/public/OCM/ICapabilityAwareOCMProvider.php', 'OCP\\OCM\\IOCMDiscoveryService' => __DIR__ . '/../../..' . '/lib/public/OCM/IOCMDiscoveryService.php', 'OCP\\OCM\\IOCMProvider' => __DIR__ . '/../../..' . '/lib/public/OCM/IOCMProvider.php', 'OCP\\OCM\\IOCMResource' => __DIR__ . '/../../..' . '/lib/public/OCM/IOCMResource.php', @@ -1371,6 +1372,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OC\\Core\\Command\\User\\Keys\\Verify' => __DIR__ . '/../../..' . '/core/Command/User/Keys/Verify.php', 'OC\\Core\\Command\\User\\LastSeen' => __DIR__ . '/../../..' . '/core/Command/User/LastSeen.php', 'OC\\Core\\Command\\User\\ListCommand' => __DIR__ . '/../../..' . '/core/Command/User/ListCommand.php', + 'OC\\Core\\Command\\User\\Profile' => __DIR__ . '/../../..' . '/core/Command/User/Profile.php', 'OC\\Core\\Command\\User\\Report' => __DIR__ . '/../../..' . '/core/Command/User/Report.php', 'OC\\Core\\Command\\User\\ResetPassword' => __DIR__ . '/../../..' . '/core/Command/User/ResetPassword.php', 'OC\\Core\\Command\\User\\Setting' => __DIR__ . '/../../..' . '/core/Command/User/Setting.php', diff --git a/lib/l10n/ar.js b/lib/l10n/ar.js index 734d8c693d7..4747362aaa8 100644 --- a/lib/l10n/ar.js +++ b/lib/l10n/ar.js @@ -93,6 +93,7 @@ OC.L10N.register( "Destination does not exist" : "المَقصِد غير موجود", "Destination is not creatable" : "المِقصِد لايمكن إنشاؤه", "Dot files are not allowed" : "الملفات النقطية (ملفات ذات أسماء تبدأ بنقطة) غير مسموح بها", + "renamed file" : "ملف معاد تسميته", "\"%1$s\" is a forbidden file or folder name." : "\"%1$s\" غير مسموح به أن يكون اسم ملف أو مجلد.", "\"%1$s\" is a forbidden prefix for file or folder names." : "\"%1$s\" غير مسموح به أن يكون بادئة لاسم ملف أو مجلد.", "\"%1$s\" is not allowed inside a file or folder name." : "\"%1$s\" غير مسموح به أن يكون داخل اسم ملف أو مجلد.", diff --git a/lib/l10n/ar.json b/lib/l10n/ar.json index e53cdc2fd6c..2bc87515bac 100644 --- a/lib/l10n/ar.json +++ b/lib/l10n/ar.json @@ -91,6 +91,7 @@ "Destination does not exist" : "المَقصِد غير موجود", "Destination is not creatable" : "المِقصِد لايمكن إنشاؤه", "Dot files are not allowed" : "الملفات النقطية (ملفات ذات أسماء تبدأ بنقطة) غير مسموح بها", + "renamed file" : "ملف معاد تسميته", "\"%1$s\" is a forbidden file or folder name." : "\"%1$s\" غير مسموح به أن يكون اسم ملف أو مجلد.", "\"%1$s\" is a forbidden prefix for file or folder names." : "\"%1$s\" غير مسموح به أن يكون بادئة لاسم ملف أو مجلد.", "\"%1$s\" is not allowed inside a file or folder name." : "\"%1$s\" غير مسموح به أن يكون داخل اسم ملف أو مجلد.", diff --git a/lib/l10n/bg.js b/lib/l10n/bg.js index 6674c4be2ad..445da4c9626 100644 --- a/lib/l10n/bg.js +++ b/lib/l10n/bg.js @@ -92,6 +92,7 @@ OC.L10N.register( "Administration settings" : "Административни настройки", "Settings" : "Настройки", "Log out" : "Отписване", + "Accounts" : "Профили", "Email" : "Имейл", "Mail %s" : "Поща %s", "Fediverse" : "Fediverse /съвкупност от обединени сървъри/", @@ -103,12 +104,13 @@ OC.L10N.register( "Website" : "Уеб сайт", "Visit %s" : "Посещение %s", "Address" : "Адрес", - "Profile picture" : "Снимка на профила", + "Profile picture" : "Профилна снимка", "About" : "Относно", "Display name" : "Име за визуализация", "Headline" : "Заглавие", "Organisation" : "Организация", "Role" : "Роля", + "Pronouns" : "Обръщение", "Additional settings" : "Допълнителни настройки", "Enter the database name for %s" : "Въведете името на базата данни за %s", "You cannot use dots in the database name %s" : "Не можете да използвате точки в името на базата данни %s", @@ -196,8 +198,8 @@ OC.L10N.register( "This can usually be fixed by giving the web server write access to the root directory. See %s" : "Това обикновено може да бъде оправено като, се даде достъп на уеб сървъра да записва в основната директория. Погледнете %s", "Permissions can usually be fixed by giving the web server write access to the root directory. See %s." : "Права обикновено могат да бъдат оправени когато се даде достъп на уеб сървъра да пише в основната директория. Погледнете %s.", "Your data directory is not writable." : "Вашата директория с данни не е записваема.", - "Setting locale to %s failed." : "Неуспешно задаване на езикова променлива %s.", - "Please install one of these locales on your system and restart your web server." : "Моля, инсталирайте една от тези езикови променливи на вашата система и си рестартирайте уеб сървъра.", + "Setting locale to %s failed." : "Неуспешно задаване на регион %s. ", + "Please install one of these locales on your system and restart your web server." : "Моля, задайте един от следните региони във Вашата система след което рестартирайте сървъра.", "PHP module %s not installed." : "PHP модулът %s не е инсталиран.", "Please ask your server administrator to install the module." : "Моля, помолете вашия администратор да инсталира модула.", "PHP setting \"%s\" is not set to \"%s\"." : "PHP настройка \"%s\" не е зададена на \"%s\".", diff --git a/lib/l10n/bg.json b/lib/l10n/bg.json index 0dfca8ec315..a4bc3162762 100644 --- a/lib/l10n/bg.json +++ b/lib/l10n/bg.json @@ -90,6 +90,7 @@ "Administration settings" : "Административни настройки", "Settings" : "Настройки", "Log out" : "Отписване", + "Accounts" : "Профили", "Email" : "Имейл", "Mail %s" : "Поща %s", "Fediverse" : "Fediverse /съвкупност от обединени сървъри/", @@ -101,12 +102,13 @@ "Website" : "Уеб сайт", "Visit %s" : "Посещение %s", "Address" : "Адрес", - "Profile picture" : "Снимка на профила", + "Profile picture" : "Профилна снимка", "About" : "Относно", "Display name" : "Име за визуализация", "Headline" : "Заглавие", "Organisation" : "Организация", "Role" : "Роля", + "Pronouns" : "Обръщение", "Additional settings" : "Допълнителни настройки", "Enter the database name for %s" : "Въведете името на базата данни за %s", "You cannot use dots in the database name %s" : "Не можете да използвате точки в името на базата данни %s", @@ -194,8 +196,8 @@ "This can usually be fixed by giving the web server write access to the root directory. See %s" : "Това обикновено може да бъде оправено като, се даде достъп на уеб сървъра да записва в основната директория. Погледнете %s", "Permissions can usually be fixed by giving the web server write access to the root directory. See %s." : "Права обикновено могат да бъдат оправени когато се даде достъп на уеб сървъра да пише в основната директория. Погледнете %s.", "Your data directory is not writable." : "Вашата директория с данни не е записваема.", - "Setting locale to %s failed." : "Неуспешно задаване на езикова променлива %s.", - "Please install one of these locales on your system and restart your web server." : "Моля, инсталирайте една от тези езикови променливи на вашата система и си рестартирайте уеб сървъра.", + "Setting locale to %s failed." : "Неуспешно задаване на регион %s. ", + "Please install one of these locales on your system and restart your web server." : "Моля, задайте един от следните региони във Вашата система след което рестартирайте сървъра.", "PHP module %s not installed." : "PHP модулът %s не е инсталиран.", "Please ask your server administrator to install the module." : "Моля, помолете вашия администратор да инсталира модула.", "PHP setting \"%s\" is not set to \"%s\"." : "PHP настройка \"%s\" не е зададена на \"%s\".", diff --git a/lib/l10n/cs.js b/lib/l10n/cs.js index ae17a582e39..78b1ce3dfe2 100644 --- a/lib/l10n/cs.js +++ b/lib/l10n/cs.js @@ -275,6 +275,7 @@ OC.L10N.register( "A valid Login must be provided" : "Je třeba zadat platné přihlašovací jméno", "Login contains whitespace at the beginning or at the end" : "Přihlašovací jméno je chybné – na jeho začátku či konci se nachází prázdný znak (mezera, tabulátor, atp.)", "Login must not consist of dots only" : "Přihlašovací jméno se nemůže skládat pouze ze samých teček", + "Username is too long" : "Uživatelské jméno je příliš dlouhé", "Login is invalid because files already exist for this user" : "Přihlašovací jméno není platné, protože protože pro tohoto uživatele už existují soubory", "Account disabled" : "Účet znepřístupněn", "Login canceled by app" : "Přihlášení zrušeno aplikací", diff --git a/lib/l10n/cs.json b/lib/l10n/cs.json index 59deb2babce..aa3b9876ad3 100644 --- a/lib/l10n/cs.json +++ b/lib/l10n/cs.json @@ -273,6 +273,7 @@ "A valid Login must be provided" : "Je třeba zadat platné přihlašovací jméno", "Login contains whitespace at the beginning or at the end" : "Přihlašovací jméno je chybné – na jeho začátku či konci se nachází prázdný znak (mezera, tabulátor, atp.)", "Login must not consist of dots only" : "Přihlašovací jméno se nemůže skládat pouze ze samých teček", + "Username is too long" : "Uživatelské jméno je příliš dlouhé", "Login is invalid because files already exist for this user" : "Přihlašovací jméno není platné, protože protože pro tohoto uživatele už existují soubory", "Account disabled" : "Účet znepřístupněn", "Login canceled by app" : "Přihlášení zrušeno aplikací", diff --git a/lib/l10n/lv.js b/lib/l10n/lv.js index 13a169c3fd2..d70b713b15f 100644 --- a/lib/l10n/lv.js +++ b/lib/l10n/lv.js @@ -40,6 +40,8 @@ OC.L10N.register( "_%n minute ago_::_%n minutes ago_" : ["pirms %n minūtēm","pirms %n minūtes","pirms %n minūtēm"], "seconds ago" : "pirms vairākām sekundēm", "Empty file" : "Tukša datne", + "%1$s (renamed)" : "%1$s (pārdēvēta)", + "renamed file" : "pārdēvēja datni", "File already exists" : "Datne jau pastāv", "Filename contains at least one invalid character" : "Datnes nosaukums satur vismaz vienu nederīgu rakstzīmi", "Empty filename is not allowed" : "Tukšs datnes nosaukums nav atļauts", diff --git a/lib/l10n/lv.json b/lib/l10n/lv.json index 0540c50ad27..985ca12e30a 100644 --- a/lib/l10n/lv.json +++ b/lib/l10n/lv.json @@ -38,6 +38,8 @@ "_%n minute ago_::_%n minutes ago_" : ["pirms %n minūtēm","pirms %n minūtes","pirms %n minūtēm"], "seconds ago" : "pirms vairākām sekundēm", "Empty file" : "Tukša datne", + "%1$s (renamed)" : "%1$s (pārdēvēta)", + "renamed file" : "pārdēvēja datni", "File already exists" : "Datne jau pastāv", "Filename contains at least one invalid character" : "Datnes nosaukums satur vismaz vienu nederīgu rakstzīmi", "Empty filename is not allowed" : "Tukšs datnes nosaukums nav atļauts", diff --git a/lib/l10n/nl.js b/lib/l10n/nl.js index 7d9c078ad71..fec337c601d 100644 --- a/lib/l10n/nl.js +++ b/lib/l10n/nl.js @@ -75,6 +75,7 @@ OC.L10N.register( "Empty file" : "Leeg bestand", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Module met ID: %s bestaat niet. Schakel die in binnen de app-instellingen of neem contact op met je beheerder.", "Dot files are not allowed" : "Punt-bestanden zijn niet toegestaan", + "renamed file" : "bestand hernoemd", "File already exists" : "Bestand bestaat al", "Invalid path" : "Ongeldig pad", "Failed to create file from template" : "Kon geen bestand van het sjabloon maken", diff --git a/lib/l10n/nl.json b/lib/l10n/nl.json index 0d11433dc52..75f2c23423e 100644 --- a/lib/l10n/nl.json +++ b/lib/l10n/nl.json @@ -73,6 +73,7 @@ "Empty file" : "Leeg bestand", "Module with ID: %s does not exist. Please enable it in your apps settings or contact your administrator." : "Module met ID: %s bestaat niet. Schakel die in binnen de app-instellingen of neem contact op met je beheerder.", "Dot files are not allowed" : "Punt-bestanden zijn niet toegestaan", + "renamed file" : "bestand hernoemd", "File already exists" : "Bestand bestaat al", "Invalid path" : "Ongeldig pad", "Failed to create file from template" : "Kon geen bestand van het sjabloon maken", diff --git a/lib/l10n/pt_BR.js b/lib/l10n/pt_BR.js index bc5f451a985..af2d50b9d1c 100644 --- a/lib/l10n/pt_BR.js +++ b/lib/l10n/pt_BR.js @@ -393,12 +393,12 @@ OC.L10N.register( "Chat with tools" : "Conversar com ferramentas", "Chat with the language model with tool calling support." : "Converse com o modelo de linguagem com suporte a tool calling (\"chamadas a ferramentas\").", "Tool message" : "Mensagem da ferramenta", - "The result of tool calls in the last interaction" : "O resultado das chamadas de ferramentas na última interação", + "The result of tool calls in the last interaction" : "O resultado das chamadas a ferramentas na última interação", "Available tools" : "Ferramentas disponíveis", "The available tools in JSON format" : "As ferramentas disponíveis em formato JSON", "The response from the chat model" : "A resposta do modelo de bate-papo", - "Tool calls" : "Chamadas de ferramentas", - "Tools call instructions from the model in JSON format" : "Instruções de chamada de ferramentas do modelo no formato JSON", + "Tool calls" : "Chamadas a ferramentas", + "Tools call instructions from the model in JSON format" : "Instruções para chamadas a ferramentas do modelo no formato JSON", "Formalize text" : "Formalizar texto", "Takes a text and makes it sound more formal" : "Pega um texto e o faz parecer mais formal", "Write a text that you want the assistant to formalize" : "Escreva um texto que você deseja que o assistente formalize", @@ -407,7 +407,7 @@ OC.L10N.register( "Generate a headline" : "Gere um título", "Generates a possible headline for a text." : "Gera um possível título para um texto.", "Original text" : "Texto original", - "The original text to generate a headline for" : "O texto original para gerar um título para", + "The original text to generate a headline for" : "O texto original para gerar um título", "The generated headline" : "O título gerado", "Proofread" : "Revisar", "Proofreads a text and lists corrections" : "Revisa um texto e lista as correções", @@ -417,11 +417,11 @@ OC.L10N.register( "The corrections that should be made in your text" : "As correções que devem ser feitas em seu texto", "Reformulate text" : "Reformular texto", "Takes a text and reformulates it" : "Pega um texto e o reformula", - "Write a text that you want the assistant to reformulate" : "Escrever um texto que você deseja que o assistente reformule", + "Write a text that you want the assistant to reformulate" : "Escreva um texto que você deseja que o assistente reformule", "Reformulated text" : "Texto reformulado", - "The reformulated text, written by the assistant" : "O texto reformulado, escrito pela assistente", + "The reformulated text, written by the assistant" : "O texto reformulado, escrito pelo assistente", "Simplify text" : "Simplificar texto", - "Takes a text and simplifies it" : "Pega e simplifica um texto", + "Takes a text and simplifies it" : "Pega um texto e o simplifica", "Write a text that you want the assistant to simplify" : "Escreva um texto que você deseja que o assistente simplifique", "Simplified text" : "Texto simplificado", "The simplified text" : "O texto simplificado", diff --git a/lib/l10n/pt_BR.json b/lib/l10n/pt_BR.json index 791f8eff351..3c28e56e91d 100644 --- a/lib/l10n/pt_BR.json +++ b/lib/l10n/pt_BR.json @@ -391,12 +391,12 @@ "Chat with tools" : "Conversar com ferramentas", "Chat with the language model with tool calling support." : "Converse com o modelo de linguagem com suporte a tool calling (\"chamadas a ferramentas\").", "Tool message" : "Mensagem da ferramenta", - "The result of tool calls in the last interaction" : "O resultado das chamadas de ferramentas na última interação", + "The result of tool calls in the last interaction" : "O resultado das chamadas a ferramentas na última interação", "Available tools" : "Ferramentas disponíveis", "The available tools in JSON format" : "As ferramentas disponíveis em formato JSON", "The response from the chat model" : "A resposta do modelo de bate-papo", - "Tool calls" : "Chamadas de ferramentas", - "Tools call instructions from the model in JSON format" : "Instruções de chamada de ferramentas do modelo no formato JSON", + "Tool calls" : "Chamadas a ferramentas", + "Tools call instructions from the model in JSON format" : "Instruções para chamadas a ferramentas do modelo no formato JSON", "Formalize text" : "Formalizar texto", "Takes a text and makes it sound more formal" : "Pega um texto e o faz parecer mais formal", "Write a text that you want the assistant to formalize" : "Escreva um texto que você deseja que o assistente formalize", @@ -405,7 +405,7 @@ "Generate a headline" : "Gere um título", "Generates a possible headline for a text." : "Gera um possível título para um texto.", "Original text" : "Texto original", - "The original text to generate a headline for" : "O texto original para gerar um título para", + "The original text to generate a headline for" : "O texto original para gerar um título", "The generated headline" : "O título gerado", "Proofread" : "Revisar", "Proofreads a text and lists corrections" : "Revisa um texto e lista as correções", @@ -415,11 +415,11 @@ "The corrections that should be made in your text" : "As correções que devem ser feitas em seu texto", "Reformulate text" : "Reformular texto", "Takes a text and reformulates it" : "Pega um texto e o reformula", - "Write a text that you want the assistant to reformulate" : "Escrever um texto que você deseja que o assistente reformule", + "Write a text that you want the assistant to reformulate" : "Escreva um texto que você deseja que o assistente reformule", "Reformulated text" : "Texto reformulado", - "The reformulated text, written by the assistant" : "O texto reformulado, escrito pela assistente", + "The reformulated text, written by the assistant" : "O texto reformulado, escrito pelo assistente", "Simplify text" : "Simplificar texto", - "Takes a text and simplifies it" : "Pega e simplifica um texto", + "Takes a text and simplifies it" : "Pega um texto e o simplifica", "Write a text that you want the assistant to simplify" : "Escreva um texto que você deseja que o assistente simplifique", "Simplified text" : "Texto simplificado", "The simplified text" : "O texto simplificado", diff --git a/lib/l10n/ru.js b/lib/l10n/ru.js index 4cd51ae9b80..abf9785da23 100644 --- a/lib/l10n/ru.js +++ b/lib/l10n/ru.js @@ -38,6 +38,7 @@ OC.L10N.register( "Server version %s or higher is required." : "Требуется сервер версии %s или выше.", "Server version %s or lower is required." : "Требуется сервер версии %s или ниже.", "Logged in account must be an admin, a sub admin or gotten special right to access this setting" : "Для доступа к этой настройке зарегистрированная учетная запись должна быть администратором, субадминистратором или иметь специальные права", + "Your current IP address doesn't allow you to perform admin actions" : "Ваш текущий IP-адрес не позволяет вам выполнять действия администратора.", "Logged in account must be an admin or sub admin" : "Зарегистрированная учетная запись должна быть администратором или субадминистратором", "Logged in account must be an admin" : "Вошедший в систему пользователь должен быть администратором", "Wiping of device %s has started" : "Удаление данных с устройства «%s».", @@ -58,6 +59,7 @@ OC.L10N.register( "Avatar image is not square" : "Изображение аватара не квадратное", "Files" : "Файлы", "View profile" : "Открыть профиль", + "same time" : "в то же время", "_%nh_::_%nh_" : ["%nч","%nч","%nч","%nч"], "Local time: %s" : "Местное время: %s", "today" : "сегодня", @@ -86,7 +88,10 @@ OC.L10N.register( "Destination does not match conversion extension" : "Назначение не соответствует расширению преобразования", "Could not convert file" : "Не удалось преобразовать файл", "Destination does not exist" : "Пункт назначения не существует", + "Destination is not creatable" : "Место назначения не может быть создано", "Dot files are not allowed" : "Файлы начинающиеся с точки не допускаются", + "%1$s (renamed)" : "%1$s (переименовано)", + "renamed file" : "переименованный файл", "\"%1$s\" is a forbidden file or folder name." : "\"%1$s\" это запрещенное имя файла или папки.", "\"%1$s\" is a forbidden prefix for file or folder names." : "\"%1$s\" является запрещенным префиксом для имен файлов или папок.", "\"%1$s\" is not allowed inside a file or folder name." : "\"%1$s\" не допускается указывать имя файла или папки внутри него.", diff --git a/lib/l10n/ru.json b/lib/l10n/ru.json index 4842de706a2..e34ba41d3b3 100644 --- a/lib/l10n/ru.json +++ b/lib/l10n/ru.json @@ -36,6 +36,7 @@ "Server version %s or higher is required." : "Требуется сервер версии %s или выше.", "Server version %s or lower is required." : "Требуется сервер версии %s или ниже.", "Logged in account must be an admin, a sub admin or gotten special right to access this setting" : "Для доступа к этой настройке зарегистрированная учетная запись должна быть администратором, субадминистратором или иметь специальные права", + "Your current IP address doesn't allow you to perform admin actions" : "Ваш текущий IP-адрес не позволяет вам выполнять действия администратора.", "Logged in account must be an admin or sub admin" : "Зарегистрированная учетная запись должна быть администратором или субадминистратором", "Logged in account must be an admin" : "Вошедший в систему пользователь должен быть администратором", "Wiping of device %s has started" : "Удаление данных с устройства «%s».", @@ -56,6 +57,7 @@ "Avatar image is not square" : "Изображение аватара не квадратное", "Files" : "Файлы", "View profile" : "Открыть профиль", + "same time" : "в то же время", "_%nh_::_%nh_" : ["%nч","%nч","%nч","%nч"], "Local time: %s" : "Местное время: %s", "today" : "сегодня", @@ -84,7 +86,10 @@ "Destination does not match conversion extension" : "Назначение не соответствует расширению преобразования", "Could not convert file" : "Не удалось преобразовать файл", "Destination does not exist" : "Пункт назначения не существует", + "Destination is not creatable" : "Место назначения не может быть создано", "Dot files are not allowed" : "Файлы начинающиеся с точки не допускаются", + "%1$s (renamed)" : "%1$s (переименовано)", + "renamed file" : "переименованный файл", "\"%1$s\" is a forbidden file or folder name." : "\"%1$s\" это запрещенное имя файла или папки.", "\"%1$s\" is a forbidden prefix for file or folder names." : "\"%1$s\" является запрещенным префиксом для имен файлов или папок.", "\"%1$s\" is not allowed inside a file or folder name." : "\"%1$s\" не допускается указывать имя файла или папки внутри него.", diff --git a/lib/l10n/sw.js b/lib/l10n/sw.js new file mode 100644 index 00000000000..baef028baf7 --- /dev/null +++ b/lib/l10n/sw.js @@ -0,0 +1,21 @@ +OC.L10N.register( + "lib", + { + "Files" : "Mafaili", + "seconds ago" : "sukunde zilizopita", + "File already exists" : "Faili lipo tayari", + "Settings" : "Mipangilio", + "Email" : "Barua pepe", + "Additional settings" : "Mipangilio ya nyongeza", + "Sunday" : "Jumapili", + "Monday" : "Jumatatu", + "Tuesday" : "Jumanne", + "Wednesday" : "Jumatano", + "Thursday" : "Alhamisi", + "Friday" : "Ijumaa", + "Saturday" : "Jumamosi", + "Confirmation" : "Uthibitisho", + "Text" : "Maandishi", + "Summary" : "Muhtasari" +}, +"nplurals=2; plural=(n != 1);"); diff --git a/lib/l10n/sw.json b/lib/l10n/sw.json new file mode 100644 index 00000000000..bc299dcef06 --- /dev/null +++ b/lib/l10n/sw.json @@ -0,0 +1,19 @@ +{ "translations": { + "Files" : "Mafaili", + "seconds ago" : "sukunde zilizopita", + "File already exists" : "Faili lipo tayari", + "Settings" : "Mipangilio", + "Email" : "Barua pepe", + "Additional settings" : "Mipangilio ya nyongeza", + "Sunday" : "Jumapili", + "Monday" : "Jumatatu", + "Tuesday" : "Jumanne", + "Wednesday" : "Jumatano", + "Thursday" : "Alhamisi", + "Friday" : "Ijumaa", + "Saturday" : "Jumamosi", + "Confirmation" : "Uthibitisho", + "Text" : "Maandishi", + "Summary" : "Muhtasari" +},"pluralForm" :"nplurals=2; plural=(n != 1);" +}
\ No newline at end of file diff --git a/lib/l10n/uk.js b/lib/l10n/uk.js index d511d276c9e..b92f38a5f57 100644 --- a/lib/l10n/uk.js +++ b/lib/l10n/uk.js @@ -275,6 +275,7 @@ OC.L10N.register( "A valid Login must be provided" : "Зазначте дійсне ім'я користувача", "Login contains whitespace at the beginning or at the end" : "Ім'я користувача містить символ пробілу на початку або наприкінці", "Login must not consist of dots only" : "Ім'я користувача не може складатися лише з крапок", + "Username is too long" : "Ім'я користувача задовге", "Login is invalid because files already exist for this user" : "Недійсне ім'я облікового запису, оскільки файли для цього користувача вже присутні", "Account disabled" : "Обліковий запис вимкнено", "Login canceled by app" : "Вхід скасовано застосунком", diff --git a/lib/l10n/uk.json b/lib/l10n/uk.json index c21e23f71f3..e091c070aa7 100644 --- a/lib/l10n/uk.json +++ b/lib/l10n/uk.json @@ -273,6 +273,7 @@ "A valid Login must be provided" : "Зазначте дійсне ім'я користувача", "Login contains whitespace at the beginning or at the end" : "Ім'я користувача містить символ пробілу на початку або наприкінці", "Login must not consist of dots only" : "Ім'я користувача не може складатися лише з крапок", + "Username is too long" : "Ім'я користувача задовге", "Login is invalid because files already exist for this user" : "Недійсне ім'я облікового запису, оскільки файли для цього користувача вже присутні", "Account disabled" : "Обліковий запис вимкнено", "Login canceled by app" : "Вхід скасовано застосунком", diff --git a/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php b/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php index 17b423164f6..08b30092155 100644 --- a/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php +++ b/lib/private/AppFramework/Middleware/NotModifiedMiddleware.php @@ -29,7 +29,7 @@ class NotModifiedMiddleware extends Middleware { } $modifiedSinceHeader = $this->request->getHeader('IF_MODIFIED_SINCE'); - if ($modifiedSinceHeader !== '' && $response->getLastModified() !== null && trim($modifiedSinceHeader) === $response->getLastModified()->format(\DateTimeInterface::RFC2822)) { + if ($modifiedSinceHeader !== '' && $response->getLastModified() !== null && trim($modifiedSinceHeader) === $response->getLastModified()->format(\DateTimeInterface::RFC7231)) { $response->setStatus(Http::STATUS_NOT_MODIFIED); return $response; } diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php index 9af65a37ab8..481c12cc708 100644 --- a/lib/private/AppFramework/Utility/SimpleContainer.php +++ b/lib/private/AppFramework/Utility/SimpleContainer.php @@ -12,6 +12,7 @@ use Closure; use OCP\AppFramework\QueryException; use OCP\IContainer; use Pimple\Container; +use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerInterface; use ReflectionClass; use ReflectionException; @@ -23,8 +24,9 @@ use function class_exists; * SimpleContainer is a simple implementation of a container on basis of Pimple */ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer { - /** @var Container */ - private $container; + public static bool $useLazyObjects = false; + + private Container $container; public function __construct() { $this->container = new Container(); @@ -49,16 +51,29 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer { /** * @param ReflectionClass $class the class to instantiate - * @return \stdClass the created class + * @return object the created class * @suppress PhanUndeclaredClassInstanceof */ - private function buildClass(ReflectionClass $class) { + private function buildClass(ReflectionClass $class): object { $constructor = $class->getConstructor(); if ($constructor === null) { + /* No constructor, return a instance directly */ return $class->newInstance(); } + if (PHP_VERSION_ID >= 80400 && self::$useLazyObjects) { + /* For PHP>=8.4, use a lazy ghost to delay constructor and dependency resolving */ + /** @psalm-suppress UndefinedMethod */ + return $class->newLazyGhost(function (object $object) use ($constructor): void { + /** @psalm-suppress DirectConstructorCall For lazy ghosts we have to call the constructor directly */ + $object->__construct(...$this->buildClassConstructorParameters($constructor)); + }); + } else { + return $class->newInstanceArgs($this->buildClassConstructorParameters($constructor)); + } + } - return $class->newInstanceArgs(array_map(function (ReflectionParameter $parameter) { + private function buildClassConstructorParameters(\ReflectionMethod $constructor): array { + return array_map(function (ReflectionParameter $parameter) { $parameterType = $parameter->getType(); $resolveName = $parameter->getName(); @@ -69,10 +84,10 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer { } try { - $builtIn = $parameter->hasType() && ($parameter->getType() instanceof ReflectionNamedType) - && $parameter->getType()->isBuiltin(); + $builtIn = $parameterType !== null && ($parameterType instanceof ReflectionNamedType) + && $parameterType->isBuiltin(); return $this->query($resolveName, !$builtIn); - } catch (QueryException $e) { + } catch (ContainerExceptionInterface $e) { // Service not found, use the default value when available if ($parameter->isDefaultValueAvailable()) { return $parameter->getDefaultValue(); @@ -82,7 +97,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer { $resolveName = $parameter->getName(); try { return $this->query($resolveName); - } catch (QueryException $e2) { + } catch (ContainerExceptionInterface $e2) { // Pass null if typed and nullable if ($parameter->allowsNull() && ($parameterType instanceof ReflectionNamedType)) { return null; @@ -95,7 +110,7 @@ class SimpleContainer implements ArrayAccess, ContainerInterface, IContainer { throw $e; } - }, $constructor->getParameters())); + }, $constructor->getParameters()); } public function resolve($name) { diff --git a/lib/private/DB/QueryBuilder/Partitioned/PartitionedQueryBuilder.php b/lib/private/DB/QueryBuilder/Partitioned/PartitionedQueryBuilder.php index 2942eeccdf7..8b051561a2e 100644 --- a/lib/private/DB/QueryBuilder/Partitioned/PartitionedQueryBuilder.php +++ b/lib/private/DB/QueryBuilder/Partitioned/PartitionedQueryBuilder.php @@ -444,4 +444,19 @@ class PartitionedQueryBuilder extends ShardedQueryBuilder { public function getPartitionCount(): int { return count($this->splitQueries) + 1; } + + public function hintShardKey(string $column, mixed $value, bool $overwrite = false): self { + if (str_contains($column, '.')) { + [$alias, $column] = explode('.', $column); + $partition = $this->getPartition($alias); + if ($partition) { + $this->splitQueries[$partition->name]->query->hintShardKey($column, $value, $overwrite); + } else { + parent::hintShardKey($column, $value, $overwrite); + } + } else { + parent::hintShardKey($column, $value, $overwrite); + } + return $this; + } } diff --git a/lib/private/Files/ObjectStore/S3ConfigTrait.php b/lib/private/Files/ObjectStore/S3ConfigTrait.php index 63f14ac2d00..5b086db8f77 100644 --- a/lib/private/Files/ObjectStore/S3ConfigTrait.php +++ b/lib/private/Files/ObjectStore/S3ConfigTrait.php @@ -18,6 +18,10 @@ trait S3ConfigTrait { /** Maximum number of concurrent multipart uploads */ protected int $concurrency; + /** Timeout, in seconds, for the connection to S3 server, not for the + * request. */ + protected float $connectTimeout; + protected int $timeout; protected string|false $proxy; diff --git a/lib/private/Files/ObjectStore/S3ConnectionTrait.php b/lib/private/Files/ObjectStore/S3ConnectionTrait.php index b7017583dc2..062d2e4bde4 100644 --- a/lib/private/Files/ObjectStore/S3ConnectionTrait.php +++ b/lib/private/Files/ObjectStore/S3ConnectionTrait.php @@ -39,6 +39,7 @@ trait S3ConnectionTrait { // Default to 5 like the S3 SDK does $this->concurrency = $params['concurrency'] ?? 5; $this->proxy = $params['proxy'] ?? false; + $this->connectTimeout = $params['connect_timeout'] ?? 5; $this->timeout = $params['timeout'] ?? 15; $this->storageClass = !empty($params['storageClass']) ? $params['storageClass'] : 'STANDARD'; $this->uploadPartSize = $params['uploadPartSize'] ?? 524288000; @@ -102,8 +103,7 @@ trait S3ConnectionTrait { 'use_arn_region' => false, 'http' => [ 'verify' => $this->getCertificateBundlePath(), - // Timeout for the connection to S3 server, not for the request. - 'connect_timeout' => 5 + 'connect_timeout' => $this->connectTimeout, ], 'use_aws_shared_config_files' => false, 'retries' => [ diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php index 147c5baf543..6e42fad8b9f 100644 --- a/lib/private/Group/Group.php +++ b/lib/private/Group/Group.php @@ -377,7 +377,7 @@ class Group implements IGroup { */ public function hideFromCollaboration(): bool { return array_reduce($this->backends, function (bool $hide, GroupInterface $backend) { - return $hide | ($backend instanceof IHideFromCollaborationBackend && $backend->hideGroup($this->gid)); + return $hide || ($backend instanceof IHideFromCollaborationBackend && $backend->hideGroup($this->gid)); }, false); } } diff --git a/lib/private/OCM/Model/OCMProvider.php b/lib/private/OCM/Model/OCMProvider.php index f4b0ac584de..be13d65a40f 100644 --- a/lib/private/OCM/Model/OCMProvider.php +++ b/lib/private/OCM/Model/OCMProvider.php @@ -11,18 +11,22 @@ namespace OC\OCM\Model; use NCU\Security\Signature\Model\Signatory; use OCP\EventDispatcher\IEventDispatcher; +use OCP\IConfig; use OCP\OCM\Events\ResourceTypeRegisterEvent; use OCP\OCM\Exceptions\OCMArgumentException; use OCP\OCM\Exceptions\OCMProviderException; -use OCP\OCM\IOCMProvider; +use OCP\OCM\ICapabilityAwareOCMProvider; use OCP\OCM\IOCMResource; /** * @since 28.0.0 */ -class OCMProvider implements IOCMProvider { +class OCMProvider implements ICapabilityAwareOCMProvider { + private string $provider; private bool $enabled = false; private string $apiVersion = ''; + private string $inviteAcceptDialog = ''; + private array $capabilities = []; private string $endPoint = ''; /** @var IOCMResource[] */ private array $resourceTypes = []; @@ -31,7 +35,9 @@ class OCMProvider implements IOCMProvider { public function __construct( protected IEventDispatcher $dispatcher, + protected IConfig $config, ) { + $this->provider = 'Nextcloud ' . $config->getSystemValue('version'); } /** @@ -71,6 +77,30 @@ class OCMProvider implements IOCMProvider { } /** + * returns the invite accept dialog + * + * @return string + * @since 32.0.0 + */ + public function getInviteAcceptDialog(): string { + return $this->inviteAcceptDialog; + } + + /** + * set the invite accept dialog + * + * @param string $inviteAcceptDialog + * + * @return $this + * @since 32.0.0 + */ + public function setInviteAcceptDialog(string $inviteAcceptDialog): static { + $this->inviteAcceptDialog = $inviteAcceptDialog; + + return $this; + } + + /** * @param string $endPoint * * @return $this @@ -89,6 +119,34 @@ class OCMProvider implements IOCMProvider { } /** + * @return string + */ + public function getProvider(): string { + return $this->provider; + } + + /** + * @param array $capabilities + * + * @return $this + */ + public function setCapabilities(array $capabilities): static { + foreach ($capabilities as $value) { + if (!in_array($value, $this->capabilities)) { + array_push($this->capabilities, $value); + } + } + + return $this; + } + + /** + * @return array + */ + public function getCapabilities(): array { + return $this->capabilities; + } + /** * create a new resource to later add it with {@see IOCMProvider::addResourceType()} * @return IOCMResource */ @@ -166,9 +224,8 @@ class OCMProvider implements IOCMProvider { * * @param array $data * - * @return $this + * @return OCMProvider&static * @throws OCMProviderException in case a descent provider cannot be generated from data - * @see self::jsonSerialize() */ public function import(array $data): static { $this->setEnabled(is_bool($data['enabled'] ?? '') ? $data['enabled'] : false) @@ -209,21 +266,7 @@ class OCMProvider implements IOCMProvider { } /** - * @return array{ - * enabled: bool, - * apiVersion: '1.0-proposal1', - * endPoint: string, - * publicKey?: array{ - * keyId: string, - * publicKeyPem: string - * }, - * resourceTypes: list<array{ - * name: string, - * shareTypes: list<string>, - * protocols: array<string, string> - * }>, - * version: string - * } + * @since 28.0.0 */ public function jsonSerialize(): array { $resourceTypes = []; @@ -231,7 +274,7 @@ class OCMProvider implements IOCMProvider { $resourceTypes[] = $res->jsonSerialize(); } - return [ + $response = [ 'enabled' => $this->isEnabled(), 'apiVersion' => '1.0-proposal1', // deprecated, but keep it to stay compatible with old version 'version' => $this->getApiVersion(), // informative but real version @@ -239,5 +282,16 @@ class OCMProvider implements IOCMProvider { 'publicKey' => $this->getSignatory()?->jsonSerialize(), 'resourceTypes' => $resourceTypes ]; + + $capabilities = $this->getCapabilities(); + $inviteAcceptDialog = $this->getInviteAcceptDialog(); + if ($capabilities) { + $response['capabilities'] = $capabilities; + } + if ($inviteAcceptDialog) { + $response['inviteAcceptDialog'] = $inviteAcceptDialog; + } + return $response; + } } diff --git a/lib/private/OCM/OCMDiscoveryService.php b/lib/private/OCM/OCMDiscoveryService.php index af612416372..a151bbc753c 100644 --- a/lib/private/OCM/OCMDiscoveryService.php +++ b/lib/private/OCM/OCMDiscoveryService.php @@ -17,8 +17,8 @@ use OCP\ICache; use OCP\ICacheFactory; use OCP\IConfig; use OCP\OCM\Exceptions\OCMProviderException; +use OCP\OCM\ICapabilityAwareOCMProvider; use OCP\OCM\IOCMDiscoveryService; -use OCP\OCM\IOCMProvider; use Psr\Log\LoggerInterface; /** @@ -31,7 +31,7 @@ class OCMDiscoveryService implements IOCMDiscoveryService { ICacheFactory $cacheFactory, private IClientService $clientService, private IConfig $config, - private IOCMProvider $provider, + private ICapabilityAwareOCMProvider $provider, private LoggerInterface $logger, ) { $this->cache = $cacheFactory->createDistributed('ocm-discovery'); @@ -42,10 +42,10 @@ class OCMDiscoveryService implements IOCMDiscoveryService { * @param string $remote * @param bool $skipCache * - * @return IOCMProvider + * @return ICapabilityAwareOCMProvider * @throws OCMProviderException */ - public function discover(string $remote, bool $skipCache = false): IOCMProvider { + public function discover(string $remote, bool $skipCache = false): ICapabilityAwareOCMProvider { $remote = rtrim($remote, '/'); if (!str_starts_with($remote, 'http://') && !str_starts_with($remote, 'https://')) { // if scheme not specified, we test both; diff --git a/lib/private/Preview/Movie.php b/lib/private/Preview/Movie.php index 7de543198f4..47895f999d8 100644 --- a/lib/private/Preview/Movie.php +++ b/lib/private/Preview/Movie.php @@ -166,8 +166,8 @@ class Movie extends ProviderV2 { $returnCode = -1; $output = ''; if (is_resource($proc)) { - $stdout = trim(stream_get_contents($pipes[1])); $stderr = trim(stream_get_contents($pipes[2])); + $stdout = trim(stream_get_contents($pipes[1])); $returnCode = proc_close($proc); $output = $stdout . $stderr; } diff --git a/lib/private/Route/CachingRouter.php b/lib/private/Route/CachingRouter.php index dbd5ef02603..becdb807f73 100644 --- a/lib/private/Route/CachingRouter.php +++ b/lib/private/Route/CachingRouter.php @@ -80,7 +80,7 @@ class CachingRouter extends Router { if (!$cachedRoutes) { parent::loadRoutes(); $cachedRoutes = $this->serializeRouteCollection($this->root); - $this->cache->set($key, $cachedRoutes, 3600); + $this->cache->set($key, $cachedRoutes, ($this->config->getSystemValueBool('debug') ? 3 : 3600)); } $matcher = new CompiledUrlMatcher($cachedRoutes, $this->context); $this->eventLogger->start('cacheroute:url:match', 'Symfony URL match call'); diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php index 02f371e808a..22dfb21d4f3 100644 --- a/lib/private/Route/Router.php +++ b/lib/private/Route/Router.php @@ -53,7 +53,7 @@ class Router implements IRouter { public function __construct( protected LoggerInterface $logger, IRequest $request, - private IConfig $config, + protected IConfig $config, protected IEventLogger $eventLogger, private ContainerInterface $container, protected IAppManager $appManager, diff --git a/lib/private/Server.php b/lib/private/Server.php index 83eb95cd671..5964a979e21 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -1,4 +1,5 @@ <?php + /** * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors * SPDX-FileCopyrightText: 2016 ownCloud, Inc. @@ -196,6 +197,7 @@ use OCP\Lock\ILockingProvider; use OCP\Lockdown\ILockdownManager; use OCP\Log\ILogFactory; use OCP\Mail\IMailer; +use OCP\OCM\ICapabilityAwareOCMProvider; use OCP\OCM\IOCMDiscoveryService; use OCP\OCM\IOCMProvider; use OCP\Preview\IMimeIconProvider; @@ -320,7 +322,7 @@ class Server extends ServerContainer implements IServerContainer { return new Profiler($c->get(SystemConfig::class)); }); - $this->registerService(\OCP\Encryption\IManager::class, function (Server $c): Encryption\Manager { + $this->registerService(Encryption\Manager::class, function (Server $c): Encryption\Manager { $view = new View(); $util = new Encryption\Util( $view, @@ -337,6 +339,7 @@ class Server extends ServerContainer implements IServerContainer { new ArrayCache() ); }); + $this->registerAlias(\OCP\Encryption\IManager::class, Encryption\Manager::class); $this->registerService(IFile::class, function (ContainerInterface $c) { $util = new Encryption\Util( @@ -1271,7 +1274,8 @@ class Server extends ServerContainer implements IServerContainer { $this->registerAlias(IPhoneNumberUtil::class, PhoneNumberUtil::class); - $this->registerAlias(IOCMProvider::class, OCMProvider::class); + $this->registerAlias(ICapabilityAwareOCMProvider::class, OCMProvider::class); + $this->registerDeprecatedAlias(IOCMProvider::class, OCMProvider::class); $this->registerAlias(ISetupCheckManager::class, SetupCheckManager::class); diff --git a/lib/private/Session/CryptoWrapper.php b/lib/private/Session/CryptoWrapper.php index 380c699d32d..40c2ba6adf3 100644 --- a/lib/private/Session/CryptoWrapper.php +++ b/lib/private/Session/CryptoWrapper.php @@ -59,7 +59,7 @@ class CryptoWrapper { [ 'expires' => 0, 'path' => $webRoot, - 'domain' => '', + 'domain' => \OCP\Server::get(\OCP\IConfig::class)->getSystemValueString('cookie_domain'), 'secure' => $secureCookie, 'httponly' => true, 'samesite' => 'Lax', diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 959797fb962..c8b5060076a 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -304,11 +304,15 @@ class Setup { $error = []; $dbType = $options['dbtype']; - if (empty($options['adminlogin'])) { - $error[] = $l->t('Set an admin Login.'); - } - if (empty($options['adminpass'])) { - $error[] = $l->t('Set an admin password.'); + $disableAdminUser = (bool)($options['admindisable'] ?? false); + + if (!$disableAdminUser) { + if (empty($options['adminlogin'])) { + $error[] = $l->t('Set an admin Login.'); + } + if (empty($options['adminpass'])) { + $error[] = $l->t('Set an admin password.'); + } } if (empty($options['directory'])) { $options['directory'] = \OC::$SERVERROOT . '/data'; @@ -318,8 +322,6 @@ class Setup { $dbType = 'sqlite'; } - $username = htmlspecialchars_decode($options['adminlogin']); - $password = htmlspecialchars_decode($options['adminpass']); $dataDir = htmlspecialchars_decode($options['directory']); $class = self::$dbSetupClasses[$dbType]; @@ -375,7 +377,7 @@ class Setup { $this->outputDebug($output, 'Configuring database'); $dbSetup->initialize($options); try { - $dbSetup->setupDatabase($username); + $dbSetup->setupDatabase(); } catch (\OC\DatabaseSetupException $e) { $error[] = [ 'error' => $e->getMessage(), @@ -405,19 +407,22 @@ class Setup { return $error; } - $this->outputDebug($output, 'Create admin account'); - - // create the admin account and group $user = null; - try { - $user = Server::get(IUserManager::class)->createUser($username, $password); - if (!$user) { - $error[] = "Account <$username> could not be created."; + if (!$disableAdminUser) { + $username = htmlspecialchars_decode($options['adminlogin']); + $password = htmlspecialchars_decode($options['adminpass']); + $this->outputDebug($output, 'Create admin account'); + + try { + $user = Server::get(IUserManager::class)->createUser($username, $password); + if (!$user) { + $error[] = "Account <$username> could not be created."; + return $error; + } + } catch (Exception $exception) { + $error[] = $exception->getMessage(); return $error; } - } catch (Exception $exception) { - $error[] = $exception->getMessage(); - return $error; } $config = Server::get(IConfig::class); @@ -432,7 +437,7 @@ class Setup { } $group = Server::get(IGroupManager::class)->createGroup('admin'); - if ($group instanceof IGroup) { + if ($user !== null && $group instanceof IGroup) { $group->addUser($user); } @@ -464,26 +469,28 @@ class Setup { $bootstrapCoordinator = Server::get(\OC\AppFramework\Bootstrap\Coordinator::class); $bootstrapCoordinator->runInitialRegistration(); - // Create a session token for the newly created user - // The token provider requires a working db, so it's not injected on setup - /** @var \OC\User\Session $userSession */ - $userSession = Server::get(IUserSession::class); - $provider = Server::get(PublicKeyTokenProvider::class); - $userSession->setTokenProvider($provider); - $userSession->login($username, $password); - $user = $userSession->getUser(); - if (!$user) { - $error[] = 'No account found in session.'; - return $error; - } - $userSession->createSessionToken($request, $user->getUID(), $username, $password); + if (!$disableAdminUser) { + // Create a session token for the newly created user + // The token provider requires a working db, so it's not injected on setup + /** @var \OC\User\Session $userSession */ + $userSession = Server::get(IUserSession::class); + $provider = Server::get(PublicKeyTokenProvider::class); + $userSession->setTokenProvider($provider); + $userSession->login($username, $password); + $user = $userSession->getUser(); + if (!$user) { + $error[] = 'No account found in session.'; + return $error; + } + $userSession->createSessionToken($request, $user->getUID(), $username, $password); - $session = $userSession->getSession(); - $session->set('last-password-confirm', Server::get(ITimeFactory::class)->getTime()); + $session = $userSession->getSession(); + $session->set('last-password-confirm', Server::get(ITimeFactory::class)->getTime()); - // Set email for admin - if (!empty($options['adminemail'])) { - $user->setSystemEMailAddress($options['adminemail']); + // Set email for admin + if (!empty($options['adminemail'])) { + $user->setSystemEMailAddress($options['adminemail']); + } } return $error; diff --git a/lib/private/Setup/AbstractDatabase.php b/lib/private/Setup/AbstractDatabase.php index dbbb587206b..ec4ce040090 100644 --- a/lib/private/Setup/AbstractDatabase.php +++ b/lib/private/Setup/AbstractDatabase.php @@ -127,10 +127,7 @@ abstract class AbstractDatabase { return $connection; } - /** - * @param string $username - */ - abstract public function setupDatabase($username); + abstract public function setupDatabase(); public function runMigrations(?IOutput $output = null) { if (!is_dir(\OC::$SERVERROOT . '/core/Migrations')) { diff --git a/lib/private/Setup/MySQL.php b/lib/private/Setup/MySQL.php index 6dd9855d851..1e2dda4c609 100644 --- a/lib/private/Setup/MySQL.php +++ b/lib/private/Setup/MySQL.php @@ -16,7 +16,7 @@ use OCP\Security\ISecureRandom; class MySQL extends AbstractDatabase { public $dbprettyname = 'MySQL/MariaDB'; - public function setupDatabase($username) { + public function setupDatabase() { //check if the database user has admin right $connection = $this->connect(['dbname' => null]); @@ -28,7 +28,7 @@ class MySQL extends AbstractDatabase { } if ($this->tryCreateDbUser) { - $this->createSpecificUser($username, new ConnectionAdapter($connection)); + $this->createSpecificUser('oc_admin', new ConnectionAdapter($connection)); } $this->config->setValues([ diff --git a/lib/private/Setup/OCI.php b/lib/private/Setup/OCI.php index 47e5e5436a5..61c7f968787 100644 --- a/lib/private/Setup/OCI.php +++ b/lib/private/Setup/OCI.php @@ -40,7 +40,7 @@ class OCI extends AbstractDatabase { return $errors; } - public function setupDatabase($username) { + public function setupDatabase() { try { $this->connect(); } catch (\Exception $e) { diff --git a/lib/private/Setup/PostgreSQL.php b/lib/private/Setup/PostgreSQL.php index b1cf031e876..9a686db2e54 100644 --- a/lib/private/Setup/PostgreSQL.php +++ b/lib/private/Setup/PostgreSQL.php @@ -16,10 +16,9 @@ class PostgreSQL extends AbstractDatabase { public $dbprettyname = 'PostgreSQL'; /** - * @param string $username * @throws \OC\DatabaseSetupException */ - public function setupDatabase($username) { + public function setupDatabase() { try { $connection = $this->connect([ 'dbname' => 'postgres' @@ -46,7 +45,7 @@ class PostgreSQL extends AbstractDatabase { //use the admin login data for the new database user //add prefix to the postgresql user name to prevent collisions - $this->dbUser = 'oc_' . strtolower($username); + $this->dbUser = 'oc_admin'; //create a new password so we don't need to store the admin config in the config file $this->dbPassword = \OC::$server->get(ISecureRandom::class)->generate(30, ISecureRandom::CHAR_ALPHANUMERIC); diff --git a/lib/private/Setup/Sqlite.php b/lib/private/Setup/Sqlite.php index 1b90ebd5a5e..b34b1e32ede 100644 --- a/lib/private/Setup/Sqlite.php +++ b/lib/private/Setup/Sqlite.php @@ -45,7 +45,7 @@ class Sqlite extends AbstractDatabase { } } - public function setupDatabase($username) { + public function setupDatabase() { $datadir = $this->config->getValue( 'datadirectory', \OC::$SERVERROOT . '/data' diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php index 27570822ef2..a638cd24557 100644 --- a/lib/private/User/Session.php +++ b/lib/private/User/Session.php @@ -967,6 +967,7 @@ class Session implements IUserSession, Emitter { if ($webRoot === '') { $webRoot = '/'; } + $domain = $this->config->getSystemValueString('cookie_domain'); $maxAge = $this->config->getSystemValueInt('remember_login_cookie_lifetime', 60 * 60 * 24 * 15); \OC\Http\CookieHelper::setCookie( @@ -974,7 +975,7 @@ class Session implements IUserSession, Emitter { $username, $maxAge, $webRoot, - '', + $domain, $secureCookie, true, \OC\Http\CookieHelper::SAMESITE_LAX @@ -984,7 +985,7 @@ class Session implements IUserSession, Emitter { $token, $maxAge, $webRoot, - '', + $domain, $secureCookie, true, \OC\Http\CookieHelper::SAMESITE_LAX @@ -995,7 +996,7 @@ class Session implements IUserSession, Emitter { $this->session->getId(), $maxAge, $webRoot, - '', + $domain, $secureCookie, true, \OC\Http\CookieHelper::SAMESITE_LAX @@ -1011,18 +1012,19 @@ class Session implements IUserSession, Emitter { public function unsetMagicInCookie() { //TODO: DI for cookies and IRequest $secureCookie = OC::$server->getRequest()->getServerProtocol() === 'https'; + $domain = $this->config->getSystemValueString('cookie_domain'); unset($_COOKIE['nc_username']); //TODO: DI unset($_COOKIE['nc_token']); unset($_COOKIE['nc_session_id']); - setcookie('nc_username', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT, '', $secureCookie, true); - setcookie('nc_token', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT, '', $secureCookie, true); - setcookie('nc_session_id', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT, '', $secureCookie, true); + setcookie('nc_username', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT, $domain, $secureCookie, true); + setcookie('nc_token', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT, $domain, $secureCookie, true); + setcookie('nc_session_id', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT, $domain, $secureCookie, true); // old cookies might be stored under /webroot/ instead of /webroot // and Firefox doesn't like it! - setcookie('nc_username', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', '', $secureCookie, true); - setcookie('nc_token', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', '', $secureCookie, true); - setcookie('nc_session_id', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', '', $secureCookie, true); + setcookie('nc_username', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', $domain, $secureCookie, true); + setcookie('nc_token', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', $domain, $secureCookie, true); + setcookie('nc_session_id', '', $this->timeFactory->getTime() - 3600, OC::$WEBROOT . '/', $domain, $secureCookie, true); } /** diff --git a/lib/public/AppFramework/App.php b/lib/public/AppFramework/App.php index 6860de7c324..2cf976ce90a 100644 --- a/lib/public/AppFramework/App.php +++ b/lib/public/AppFramework/App.php @@ -9,6 +9,7 @@ declare(strict_types=1); */ namespace OCP\AppFramework; +use OC\AppFramework\Utility\SimpleContainer; use OC\ServerContainer; use OCP\IConfig; use OCP\Server; @@ -69,6 +70,13 @@ class App { $step['args'][1] === $classNameParts[1]) { $setUpViaQuery = true; break; + } elseif (isset($step['class'], $step['function'], $step['args'][0]) && + $step['class'] === SimpleContainer::class && + preg_match('/{closure:OC\\\\AppFramework\\\\Utility\\\\SimpleContainer::buildClass\\(\\):\\d+}/', $step['function']) && + $step['args'][0] === $this) { + /* We are setup through a lazy ghost, fine */ + $setUpViaQuery = true; + break; } } diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php index 8037243d7a4..bdebb12c00d 100644 --- a/lib/public/AppFramework/Http/Response.php +++ b/lib/public/AppFramework/Http/Response.php @@ -96,7 +96,7 @@ class Response { $time = \OCP\Server::get(ITimeFactory::class); $expires->setTimestamp($time->getTime()); $expires->add(new \DateInterval('PT' . $cacheSeconds . 'S')); - $this->addHeader('Expires', $expires->format(\DateTimeInterface::RFC2822)); + $this->addHeader('Expires', $expires->format(\DateTimeInterface::RFC7231)); } else { $this->addHeader('Cache-Control', 'no-cache, no-store, must-revalidate'); unset($this->headers['Expires']); @@ -238,7 +238,7 @@ class Response { ]; if ($this->lastModified) { - $mergeWith['Last-Modified'] = $this->lastModified->format(\DateTimeInterface::RFC2822); + $mergeWith['Last-Modified'] = $this->lastModified->format(\DateTimeInterface::RFC7231); } if ($this->ETag) { diff --git a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php index ef5d2f67f7e..a620f44e677 100644 --- a/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php +++ b/lib/public/AppFramework/Http/Template/PublicTemplateResponse.php @@ -44,6 +44,7 @@ class PublicTemplateResponse extends TemplateResponse { ) { parent::__construct($appName, $templateName, $params, 'public', $status, $headers); \OCP\Util::addScript('core', 'public-page-menu'); + \OCP\Util::addScript('core', 'public-page-user-menu'); $state = \OCP\Server::get(IInitialStateService::class); $state->provideLazyInitialState('core', 'public-page-menu', function () { diff --git a/lib/public/OCM/ICapabilityAwareOCMProvider.php b/lib/public/OCM/ICapabilityAwareOCMProvider.php new file mode 100644 index 00000000000..d3ad2e29932 --- /dev/null +++ b/lib/public/OCM/ICapabilityAwareOCMProvider.php @@ -0,0 +1,60 @@ +<?php + +declare(strict_types=1); + +/** + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +namespace OCP\OCM; + +/** + * Version 1.1 and 1.2 extensions to the Open Cloud Mesh Discovery API + * @link https://github.com/cs3org/OCM-API/ + * @since 32.0.0 + */ +interface ICapabilityAwareOCMProvider extends IOCMProvider { + /** + * get the capabilities + * + * @return array + * @since 32.0.0 + */ + public function getCapabilities(): array; + + /** + * get the provider name + * + * @return string + * @since 32.0.0 + */ + public function getProvider(): string; + + /** + * returns the invite accept dialog + * + * @return string + * @since 32.0.0 + */ + public function getInviteAcceptDialog(): string; + + /** + * set the capabilities + * + * @param array $capabilities + * + * @return $this + * @since 32.0.0 + */ + public function setCapabilities(array $capabilities): static; + + /** + * set the invite accept dialog + * + * @param string $inviteAcceptDialog + * + * @return $this + * @since 32.0.0 + */ + public function setInviteAcceptDialog(string $inviteAcceptDialog): static; +} diff --git a/lib/public/OCM/IOCMProvider.php b/lib/public/OCM/IOCMProvider.php index a267abc52d2..7141b0a9ab9 100644 --- a/lib/public/OCM/IOCMProvider.php +++ b/lib/public/OCM/IOCMProvider.php @@ -16,6 +16,7 @@ use OCP\OCM\Exceptions\OCMProviderException; * Model based on the Open Cloud Mesh Discovery API * @link https://github.com/cs3org/OCM-API/ * @since 28.0.0 + * @deprecated 32.0.0 Please use {@see \OCP\OCM\ICapabilityAwareOCMProvider} */ interface IOCMProvider extends JsonSerializable { /** |