diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base.php | 3 | ||||
-rw-r--r-- | lib/l10n/cs.js | 1 | ||||
-rw-r--r-- | lib/l10n/cs.json | 1 | ||||
-rw-r--r-- | lib/l10n/pt_BR.js | 14 | ||||
-rw-r--r-- | lib/l10n/pt_BR.json | 14 | ||||
-rw-r--r-- | lib/l10n/ru.js | 2 | ||||
-rw-r--r-- | lib/l10n/ru.json | 2 | ||||
-rw-r--r-- | lib/l10n/sw.js | 14 | ||||
-rw-r--r-- | lib/l10n/sw.json | 12 | ||||
-rw-r--r-- | lib/private/AppFramework/Middleware/NotModifiedMiddleware.php | 2 | ||||
-rw-r--r-- | lib/private/AppFramework/Utility/SimpleContainer.php | 35 | ||||
-rw-r--r-- | lib/private/Group/Group.php | 2 | ||||
-rw-r--r-- | lib/private/Preview/Movie.php | 2 | ||||
-rw-r--r-- | lib/private/Setup.php | 81 | ||||
-rw-r--r-- | lib/private/Setup/AbstractDatabase.php | 5 | ||||
-rw-r--r-- | lib/private/Setup/MySQL.php | 4 | ||||
-rw-r--r-- | lib/private/Setup/OCI.php | 2 | ||||
-rw-r--r-- | lib/private/Setup/PostgreSQL.php | 5 | ||||
-rw-r--r-- | lib/private/Setup/Sqlite.php | 2 | ||||
-rw-r--r-- | lib/public/AppFramework/App.php | 6 | ||||
-rw-r--r-- | lib/public/AppFramework/Http/Response.php | 4 |
21 files changed, 136 insertions, 77 deletions
diff --git a/lib/base.php b/lib/base.php index 2b08137aff2..55856889489 100644 --- a/lib/base.php +++ b/lib/base.php @@ -618,6 +618,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/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/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..22acfb0791e 100644 --- a/lib/l10n/ru.js +++ b/lib/l10n/ru.js @@ -87,6 +87,8 @@ OC.L10N.register( "Could not convert file" : "Не удалось преобразовать файл", "Destination does not exist" : "Пункт назначения не существует", "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..bd43a906cc1 100644 --- a/lib/l10n/ru.json +++ b/lib/l10n/ru.json @@ -85,6 +85,8 @@ "Could not convert file" : "Не удалось преобразовать файл", "Destination does not exist" : "Пункт назначения не существует", "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..d7aa3d3fa0f --- /dev/null +++ b/lib/l10n/sw.js @@ -0,0 +1,14 @@ +OC.L10N.register( + "lib", + { + "Email" : "Barua pepe", + "Sunday" : "Jumapili", + "Monday" : "Jumatatu", + "Tuesday" : "Jumanne", + "Wednesday" : "Jumatano", + "Thursday" : "Alhamisi", + "Friday" : "Ijumaa", + "Saturday" : "Jumamosi", + "Confirmation" : "Uthibitisho" +}, +"nplurals=2; plural=(n != 1);"); diff --git a/lib/l10n/sw.json b/lib/l10n/sw.json new file mode 100644 index 00000000000..d278422fa57 --- /dev/null +++ b/lib/l10n/sw.json @@ -0,0 +1,12 @@ +{ "translations": { + "Email" : "Barua pepe", + "Sunday" : "Jumapili", + "Monday" : "Jumatatu", + "Tuesday" : "Jumanne", + "Wednesday" : "Jumatano", + "Thursday" : "Alhamisi", + "Friday" : "Ijumaa", + "Saturday" : "Jumamosi", + "Confirmation" : "Uthibitisho" +},"pluralForm" :"nplurals=2; plural=(n != 1);" +}
\ No newline at end of file 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/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/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/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/public/AppFramework/App.php b/lib/public/AppFramework/App.php index 6860de7c324..eec5c6e83e9 100644 --- a/lib/public/AppFramework/App.php +++ b/lib/public/AppFramework/App.php @@ -69,6 +69,12 @@ class App { $step['args'][1] === $classNameParts[1]) { $setUpViaQuery = true; break; + } elseif (isset($step['class'], $step['function'], $step['args'][0]) && + $step['class'] === \ReflectionClass::class && + $step['function'] === 'initializeLazyObject' && + $step['args'][0] === $this) { + $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) { |