summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/autoload_classmap.php2
-rw-r--r--lib/composer/composer/autoload_static.php2
-rw-r--r--lib/l10n/br.js8
-rw-r--r--lib/l10n/br.json8
-rw-r--r--lib/l10n/gl.js4
-rw-r--r--lib/l10n/gl.json4
-rw-r--r--lib/l10n/sl.js3
-rw-r--r--lib/l10n/sl.json3
-rw-r--r--lib/private/AppFramework/Bootstrap/RegistrationContext.php24
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php11
-rw-r--r--lib/private/AppFramework/ScopedPsrLogger.php152
-rw-r--r--lib/private/Authentication/WebAuthn/Manager.php9
-rw-r--r--lib/private/Server.php91
-rw-r--r--lib/private/ServerContainer.php3
-rw-r--r--lib/private/TemplateLayout.php13
-rw-r--r--lib/private/legacy/OC_App.php50
-rw-r--r--lib/private/legacy/OC_Template.php5
-rw-r--r--lib/public/AppFramework/Bootstrap/IRegistrationContext.php13
-rw-r--r--lib/public/AppFramework/Http/TemplateResponse.php37
-rw-r--r--lib/public/AppFramework/IAppContainer.php15
-rw-r--r--lib/public/Authentication/IAlternativeLogin.php58
-rw-r--r--lib/public/IServerContainer.php89
22 files changed, 563 insertions, 41 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index 6a53f4e04cf..94e35bf1b13 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -83,6 +83,7 @@ return array(
'OCP\\Authentication\\Events\\LoginFailedEvent' => $baseDir . '/lib/public/Authentication/Events/LoginFailedEvent.php',
'OCP\\Authentication\\Exceptions\\CredentialsUnavailableException' => $baseDir . '/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php',
'OCP\\Authentication\\Exceptions\\PasswordUnavailableException' => $baseDir . '/lib/public/Authentication/Exceptions/PasswordUnavailableException.php',
+ 'OCP\\Authentication\\IAlternativeLogin' => $baseDir . '/lib/public/Authentication/IAlternativeLogin.php',
'OCP\\Authentication\\IApacheBackend' => $baseDir . '/lib/public/Authentication/IApacheBackend.php',
'OCP\\Authentication\\LoginCredentials\\ICredentials' => $baseDir . '/lib/public/Authentication/LoginCredentials/ICredentials.php',
'OCP\\Authentication\\LoginCredentials\\IStore' => $baseDir . '/lib/public/Authentication/LoginCredentials/IStore.php',
@@ -592,6 +593,7 @@ return array(
'OC\\AppFramework\\OCS\\V2Response' => $baseDir . '/lib/private/AppFramework/OCS/V2Response.php',
'OC\\AppFramework\\Routing\\RouteActionHandler' => $baseDir . '/lib/private/AppFramework/Routing/RouteActionHandler.php',
'OC\\AppFramework\\Routing\\RouteConfig' => $baseDir . '/lib/private/AppFramework/Routing/RouteConfig.php',
+ 'OC\\AppFramework\\ScopedPsrLogger' => $baseDir . '/lib/private/AppFramework/ScopedPsrLogger.php',
'OC\\AppFramework\\Services\\AppConfig' => $baseDir . '/lib/private/AppFramework/Services/AppConfig.php',
'OC\\AppFramework\\Services\\InitialState' => $baseDir . '/lib/private/AppFramework/Services/InitialState.php',
'OC\\AppFramework\\Utility\\ControllerMethodReflector' => $baseDir . '/lib/private/AppFramework/Utility/ControllerMethodReflector.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index edb51c1865f..1892c3bc96a 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -112,6 +112,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OCP\\Authentication\\Events\\LoginFailedEvent' => __DIR__ . '/../../..' . '/lib/public/Authentication/Events/LoginFailedEvent.php',
'OCP\\Authentication\\Exceptions\\CredentialsUnavailableException' => __DIR__ . '/../../..' . '/lib/public/Authentication/Exceptions/CredentialsUnavailableException.php',
'OCP\\Authentication\\Exceptions\\PasswordUnavailableException' => __DIR__ . '/../../..' . '/lib/public/Authentication/Exceptions/PasswordUnavailableException.php',
+ 'OCP\\Authentication\\IAlternativeLogin' => __DIR__ . '/../../..' . '/lib/public/Authentication/IAlternativeLogin.php',
'OCP\\Authentication\\IApacheBackend' => __DIR__ . '/../../..' . '/lib/public/Authentication/IApacheBackend.php',
'OCP\\Authentication\\LoginCredentials\\ICredentials' => __DIR__ . '/../../..' . '/lib/public/Authentication/LoginCredentials/ICredentials.php',
'OCP\\Authentication\\LoginCredentials\\IStore' => __DIR__ . '/../../..' . '/lib/public/Authentication/LoginCredentials/IStore.php',
@@ -621,6 +622,7 @@ class ComposerStaticInit53792487c5a8370acc0b06b1a864ff4c
'OC\\AppFramework\\OCS\\V2Response' => __DIR__ . '/../../..' . '/lib/private/AppFramework/OCS/V2Response.php',
'OC\\AppFramework\\Routing\\RouteActionHandler' => __DIR__ . '/../../..' . '/lib/private/AppFramework/Routing/RouteActionHandler.php',
'OC\\AppFramework\\Routing\\RouteConfig' => __DIR__ . '/../../..' . '/lib/private/AppFramework/Routing/RouteConfig.php',
+ 'OC\\AppFramework\\ScopedPsrLogger' => __DIR__ . '/../../..' . '/lib/private/AppFramework/ScopedPsrLogger.php',
'OC\\AppFramework\\Services\\AppConfig' => __DIR__ . '/../../..' . '/lib/private/AppFramework/Services/AppConfig.php',
'OC\\AppFramework\\Services\\InitialState' => __DIR__ . '/../../..' . '/lib/private/AppFramework/Services/InitialState.php',
'OC\\AppFramework\\Utility\\ControllerMethodReflector' => __DIR__ . '/../../..' . '/lib/private/AppFramework/Utility/ControllerMethodReflector.php',
diff --git a/lib/l10n/br.js b/lib/l10n/br.js
index 940a6828531..6848372df9c 100644
--- a/lib/l10n/br.js
+++ b/lib/l10n/br.js
@@ -21,12 +21,18 @@ OC.L10N.register(
"Log out" : "Kuitat",
"Users" : "Implijer",
"Unknown user" : "Implijer dianv",
+ "Additional settings" : "Stummoù ouzhpenn",
"Open »%s«" : "Digeriñ »%s«",
"User disabled" : "Implijer disaotreet",
"Can't read file" : "N'eo ket posupl lenn ar restr",
"Authentication error" : "Fazi dilesa",
"Storage is temporarily not available" : "N'haller ket tizhout ar skor roadennoù evit ar poent",
+ "Overview" : "Taol-lagad",
+ "Basic settings" : "Stummoù diazez",
"Sharing" : "Rannan",
- "Security" : "Surentez"
+ "Security" : "Surentez",
+ "Groupware" : "Labour a stroll",
+ "Personal info" : "Titouroù personel",
+ "Mobile & desktop" : "Ezouk ha burev"
},
"nplurals=5; plural=((n%10 == 1) && (n%100 != 11) && (n%100 !=71) && (n%100 !=91) ? 0 :(n%10 == 2) && (n%100 != 12) && (n%100 !=72) && (n%100 !=92) ? 1 :(n%10 ==3 || n%10==4 || n%10==9) && (n%100 < 10 || n% 100 > 19) && (n%100 < 70 || n%100 > 79) && (n%100 < 90 || n%100 > 99) ? 2 :(n != 0 && n % 1000000 == 0) ? 3 : 4);");
diff --git a/lib/l10n/br.json b/lib/l10n/br.json
index 9b297212193..a30e7b28c74 100644
--- a/lib/l10n/br.json
+++ b/lib/l10n/br.json
@@ -19,12 +19,18 @@
"Log out" : "Kuitat",
"Users" : "Implijer",
"Unknown user" : "Implijer dianv",
+ "Additional settings" : "Stummoù ouzhpenn",
"Open »%s«" : "Digeriñ »%s«",
"User disabled" : "Implijer disaotreet",
"Can't read file" : "N'eo ket posupl lenn ar restr",
"Authentication error" : "Fazi dilesa",
"Storage is temporarily not available" : "N'haller ket tizhout ar skor roadennoù evit ar poent",
+ "Overview" : "Taol-lagad",
+ "Basic settings" : "Stummoù diazez",
"Sharing" : "Rannan",
- "Security" : "Surentez"
+ "Security" : "Surentez",
+ "Groupware" : "Labour a stroll",
+ "Personal info" : "Titouroù personel",
+ "Mobile & desktop" : "Ezouk ha burev"
},"pluralForm" :"nplurals=5; plural=((n%10 == 1) && (n%100 != 11) && (n%100 !=71) && (n%100 !=91) ? 0 :(n%10 == 2) && (n%100 != 12) && (n%100 !=72) && (n%100 !=92) ? 1 :(n%10 ==3 || n%10==4 || n%10==9) && (n%100 < 10 || n% 100 > 19) && (n%100 < 70 || n%100 > 79) && (n%100 < 90 || n%100 > 99) ? 2 :(n != 0 && n % 1000000 == 0) ? 3 : 4);"
} \ No newline at end of file
diff --git a/lib/l10n/gl.js b/lib/l10n/gl.js
index 137ec353958..f99c7aa5c6c 100644
--- a/lib/l10n/gl.js
+++ b/lib/l10n/gl.js
@@ -182,7 +182,7 @@ OC.L10N.register(
"Can't read file" : "Non é posíbel ler o ficheiro",
"Application is not enabled" : "A aplicación non está activada",
"Authentication error" : "Produciuse un erro de autenticación",
- "Token expired. Please reload page." : "Testemuña caducada. Recargue a páxina.",
+ "Token expired. Please reload page." : "Testemuño caducado. Recargue a páxina.",
"No database drivers (sqlite, mysql, or postgresql) installed." : "Non hai controladores de base de datos (sqlite, mysql, ou postgresql) instalados.",
"Cannot write into \"config\" directory" : "Non é posíbel escribir no directorio «config»",
"This can usually be fixed by giving the webserver write access to the config directory. See %s" : "Polo xeral, isto pode ser fixado para permitirlle ao servidor web acceso de escritura ao directorio «config». Vexa %s",
@@ -214,7 +214,7 @@ OC.L10N.register(
"Your data directory is invalid" : "O seu directorio de datos non é correcto",
"Ensure there is a file called \".ocdata\" in the root of the data directory." : "Asegúrese de que existe un ficheiro chamado «.ocdata» na raíz do directorio de datos.",
"Action \"%s\" not supported or implemented." : "A acción «%s» non está admitida ou implementada.",
- "Authentication failed, wrong token or provider ID given" : "Produciuse un fallo de autenticación. Deuse unha testemuña ou un ID de provedor erróneos.",
+ "Authentication failed, wrong token or provider ID given" : "Produciuse un fallo de autenticación. Deuse un testemuño ou un ID de provedor erróneos.",
"Parameters missing in order to complete the request. Missing Parameters: \"%s\"" : "Faltan parámetros para completar a solicitude. Parámetros que faltan: «%s»",
"ID \"%1$s\" already used by cloud federation provider \"%2$s\"" : "O ID «%1$s» xa está a ser usado polo provedor da nube federada «%2$s»",
"Cloud Federation Provider with ID: \"%s\" does not exist." : "O provedor de nube federada co ID «%s» non existe.",
diff --git a/lib/l10n/gl.json b/lib/l10n/gl.json
index 81bf2ef53cd..5e32ad0b821 100644
--- a/lib/l10n/gl.json
+++ b/lib/l10n/gl.json
@@ -180,7 +180,7 @@
"Can't read file" : "Non é posíbel ler o ficheiro",
"Application is not enabled" : "A aplicación non está activada",
"Authentication error" : "Produciuse un erro de autenticación",
- "Token expired. Please reload page." : "Testemuña caducada. Recargue a páxina.",
+ "Token expired. Please reload page." : "Testemuño caducado. Recargue a páxina.",
"No database drivers (sqlite, mysql, or postgresql) installed." : "Non hai controladores de base de datos (sqlite, mysql, ou postgresql) instalados.",
"Cannot write into \"config\" directory" : "Non é posíbel escribir no directorio «config»",
"This can usually be fixed by giving the webserver write access to the config directory. See %s" : "Polo xeral, isto pode ser fixado para permitirlle ao servidor web acceso de escritura ao directorio «config». Vexa %s",
@@ -212,7 +212,7 @@
"Your data directory is invalid" : "O seu directorio de datos non é correcto",
"Ensure there is a file called \".ocdata\" in the root of the data directory." : "Asegúrese de que existe un ficheiro chamado «.ocdata» na raíz do directorio de datos.",
"Action \"%s\" not supported or implemented." : "A acción «%s» non está admitida ou implementada.",
- "Authentication failed, wrong token or provider ID given" : "Produciuse un fallo de autenticación. Deuse unha testemuña ou un ID de provedor erróneos.",
+ "Authentication failed, wrong token or provider ID given" : "Produciuse un fallo de autenticación. Deuse un testemuño ou un ID de provedor erróneos.",
"Parameters missing in order to complete the request. Missing Parameters: \"%s\"" : "Faltan parámetros para completar a solicitude. Parámetros que faltan: «%s»",
"ID \"%1$s\" already used by cloud federation provider \"%2$s\"" : "O ID «%1$s» xa está a ser usado polo provedor da nube federada «%2$s»",
"Cloud Federation Provider with ID: \"%s\" does not exist." : "O provedor de nube federada co ID «%s» non existe.",
diff --git a/lib/l10n/sl.js b/lib/l10n/sl.js
index 81fe8c9c581..29ad8137fc4 100644
--- a/lib/l10n/sl.js
+++ b/lib/l10n/sl.js
@@ -22,6 +22,9 @@ OC.L10N.register(
"Server version %s or higher is required." : "Zahtevana je različica strežnika %s ali višja.",
"Server version %s or lower is required." : "Zahtevana je različica strežnika %s ali nižja.",
"Logged in user must be an admin" : "Prijavljen uporabnik mora biti tudi skrbnik",
+ "Remote wipe started" : "Začeto je oddaljeno varnostno brisanje",
+ "Remote wipe finished" : "Oddaljeno varnostno brisanje je končano",
+ "The remote wipe on %s has finished" : "Oddaljeno varnostno brisanje na %s je končano",
"Authentication" : "Overitev",
"Unknown filetype" : "Neznana vrsta datoteke",
"Invalid image" : "Neveljavna slika",
diff --git a/lib/l10n/sl.json b/lib/l10n/sl.json
index 5b78063f91b..97e69fb28b4 100644
--- a/lib/l10n/sl.json
+++ b/lib/l10n/sl.json
@@ -20,6 +20,9 @@
"Server version %s or higher is required." : "Zahtevana je različica strežnika %s ali višja.",
"Server version %s or lower is required." : "Zahtevana je različica strežnika %s ali nižja.",
"Logged in user must be an admin" : "Prijavljen uporabnik mora biti tudi skrbnik",
+ "Remote wipe started" : "Začeto je oddaljeno varnostno brisanje",
+ "Remote wipe finished" : "Oddaljeno varnostno brisanje je končano",
+ "The remote wipe on %s has finished" : "Oddaljeno varnostno brisanje na %s je končano",
"Authentication" : "Overitev",
"Unknown filetype" : "Neznana vrsta datoteke",
"Invalid image" : "Neveljavna slika",
diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
index 270035a2908..efcf9175b97 100644
--- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php
+++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php
@@ -63,6 +63,9 @@ class RegistrationContext {
/** @var array[] */
private $searchProviders = [];
+ /** @var array[] */
+ private $alternativeLogins = [];
+
/** @var ILogger */
private $logger;
@@ -151,6 +154,13 @@ class RegistrationContext {
$class
);
}
+
+ public function registerAlternativeLogin(string $class): void {
+ $this->context->registerAlternativeLogin(
+ $this->appId,
+ $class
+ );
+ }
};
}
@@ -223,6 +233,13 @@ class RegistrationContext {
];
}
+ public function registerAlternativeLogin(string $appId, string $class): void {
+ $this->alternativeLogins[] = [
+ 'appId' => $appId,
+ 'class' => $class,
+ ];
+ }
+
/**
* @param App[] $apps
*/
@@ -386,4 +403,11 @@ class RegistrationContext {
public function getSearchProviders(): array {
return $this->searchProviders;
}
+
+ /**
+ * @return array[]
+ */
+ public function getAlternativeLogins(): array {
+ return $this->alternativeLogins;
+ }
}
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php
index d45c90a7205..cd426d64699 100644
--- a/lib/private/AppFramework/DependencyInjection/DIContainer.php
+++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php
@@ -45,8 +45,10 @@ use OC\AppFramework\Middleware\Security\CORSMiddleware;
use OC\AppFramework\Middleware\Security\RateLimitingMiddleware;
use OC\AppFramework\Middleware\Security\SecurityMiddleware;
use OC\AppFramework\Middleware\SessionMiddleware;
+use OC\AppFramework\ScopedPsrLogger;
use OC\AppFramework\Utility\SimpleContainer;
use OC\Core\Middleware\TwoFactorMiddleware;
+use OC\Log\PsrLoggerAdapter;
use OC\ServerContainer;
use OCA\WorkflowEngine\Manager;
use OCP\AppFramework\Http\IOutput;
@@ -70,6 +72,7 @@ use OCP\ISession;
use OCP\IURLGenerator;
use OCP\IUserSession;
use Psr\Container\ContainerInterface;
+use Psr\Log\LoggerInterface;
/**
* @deprecated 20.0.0
@@ -128,7 +131,13 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return $this->getServer()->getL10N($c->get('AppName'));
});
- // Log wrapper
+ // Log wrappers
+ $this->registerService(LoggerInterface::class, function (ContainerInterface $c) {
+ return new ScopedPsrLogger(
+ $c->get(PsrLoggerAdapter::class),
+ $c->get('AppName')
+ );
+ });
$this->registerService(ILogger::class, function (ContainerInterface $c) {
return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->get('AppName'));
});
diff --git a/lib/private/AppFramework/ScopedPsrLogger.php b/lib/private/AppFramework/ScopedPsrLogger.php
new file mode 100644
index 00000000000..d0ace1790c9
--- /dev/null
+++ b/lib/private/AppFramework/ScopedPsrLogger.php
@@ -0,0 +1,152 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @author 2020 Christoph Wurst <christoph@winzerhof-wurst.at>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+namespace OC\AppFramework;
+
+use Psr\Log\LoggerInterface;
+use function array_merge;
+
+class ScopedPsrLogger implements LoggerInterface {
+
+ /** @var LoggerInterface */
+ private $inner;
+
+ /** @var string */
+ private $appId;
+
+ public function __construct(LoggerInterface $inner,
+ string $appId) {
+ $this->inner = $inner;
+ $this->appId = $appId;
+ }
+
+ public function emergency($message, array $context = []) {
+ $this->inner->emergency(
+ $message,
+ array_merge(
+ [
+ 'app' => $this->appId,
+ ],
+ $context
+ )
+ );
+ }
+
+ public function alert($message, array $context = []) {
+ $this->inner->alert(
+ $message,
+ array_merge(
+ [
+ 'app' => $this->appId,
+ ],
+ $context
+ )
+ );
+ }
+
+ public function critical($message, array $context = []) {
+ $this->inner->critical(
+ $message,
+ array_merge(
+ [
+ 'app' => $this->appId,
+ ],
+ $context
+ )
+ );
+ }
+
+ public function error($message, array $context = []) {
+ $this->inner->error(
+ $message,
+ array_merge(
+ [
+ 'app' => $this->appId,
+ ],
+ $context
+ )
+ );
+ }
+
+ public function warning($message, array $context = []) {
+ $this->inner->warning(
+ $message,
+ array_merge(
+ [
+ 'app' => $this->appId,
+ ],
+ $context
+ )
+ );
+ }
+
+ public function notice($message, array $context = []) {
+ $this->inner->notice(
+ $message,
+ array_merge(
+ [
+ 'app' => $this->appId,
+ ],
+ $context
+ )
+ );
+ }
+
+ public function info($message, array $context = []) {
+ $this->inner->info(
+ $message,
+ array_merge(
+ [
+ 'app' => $this->appId,
+ ],
+ $context
+ )
+ );
+ }
+
+ public function debug($message, array $context = []) {
+ $this->inner->debug(
+ $message,
+ array_merge(
+ [
+ 'app' => $this->appId,
+ ],
+ $context
+ )
+ );
+ }
+
+ public function log($level, $message, array $context = []) {
+ $this->inner->log(
+ $message,
+ array_merge(
+ [
+ 'app' => $this->appId,
+ ],
+ $context
+ )
+ );
+ }
+}
diff --git a/lib/private/Authentication/WebAuthn/Manager.php b/lib/private/Authentication/WebAuthn/Manager.php
index cc3e9aba1cc..4415badc9b0 100644
--- a/lib/private/Authentication/WebAuthn/Manager.php
+++ b/lib/private/Authentication/WebAuthn/Manager.php
@@ -107,7 +107,11 @@ class Manager {
$excludedPublicKeyDescriptors = [
];
- $authenticatorSelectionCriteria = new AuthenticatorSelectionCriteria();
+ $authenticatorSelectionCriteria = new AuthenticatorSelectionCriteria(
+ null,
+ false,
+ AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_DISCOURAGED
+ );
return new PublicKeyCredentialCreationOptions(
$rpEntity,
@@ -186,7 +190,8 @@ class Manager {
random_bytes(32), // Challenge
60000, // Timeout
$this->stripPort($serverHost), // Relying Party ID
- $registeredPublicKeyCredentialDescriptors // Registered PublicKeyCredentialDescriptor classes
+ $registeredPublicKeyCredentialDescriptors, // Registered PublicKeyCredentialDescriptor classes
+ AuthenticatorSelectionCriteria::USER_VERIFICATION_REQUIREMENT_DISCOURAGED
);
}
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 5769953a9e0..78bed4e6e38 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -1379,6 +1379,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Calendar\IManager
+ * @deprecated
*/
public function getCalendarManager() {
return $this->query(\OC\Calendar\Manager::class);
@@ -1386,6 +1387,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Calendar\Resource\IManager
+ * @deprecated
*/
public function getCalendarResourceBackendManager() {
return $this->query(\OC\Calendar\Resource\Manager::class);
@@ -1393,6 +1395,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Calendar\Room\IManager
+ * @deprecated
*/
public function getCalendarRoomBackendManager() {
return $this->query(\OC\Calendar\Room\Manager::class);
@@ -1447,6 +1450,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Contacts\IManager
+ * @deprecated
*/
public function getContactsManager() {
return $this->query(\OCP\Contacts\IManager::class);
@@ -1454,6 +1458,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OC\Encryption\Manager
+ * @deprecated
*/
public function getEncryptionManager() {
return $this->query(\OCP\Encryption\IManager::class);
@@ -1461,6 +1466,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OC\Encryption\File
+ * @deprecated
*/
public function getEncryptionFilesHelper() {
return $this->query('EncryptionFileHelper');
@@ -1468,6 +1474,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Encryption\Keys\IStorage
+ * @deprecated
*/
public function getEncryptionKeyStorage() {
return $this->query('EncryptionKeyStorage');
@@ -1479,6 +1486,7 @@ class Server extends ServerContainer implements IServerContainer {
* In case the current execution was not initiated by a web request null is returned
*
* @return \OCP\IRequest
+ * @deprecated
*/
public function getRequest() {
return $this->query(IRequest::class);
@@ -1488,6 +1496,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns the preview manager which can create preview images for a given file
*
* @return IPreview
+ * @deprecated
*/
public function getPreviewManager() {
return $this->query(IPreview::class);
@@ -1498,6 +1507,7 @@ class Server extends ServerContainer implements IServerContainer {
*
* @see \OCP\ITagManager::load()
* @return ITagManager
+ * @deprecated
*/
public function getTagManager() {
return $this->query(ITagManager::class);
@@ -1509,6 +1519,7 @@ class Server extends ServerContainer implements IServerContainer {
* @return ISystemTagManager
*
* @since 9.0.0
+ * @deprecated
*/
public function getSystemTagManager() {
return $this->query(ISystemTagManager::class);
@@ -1520,6 +1531,7 @@ class Server extends ServerContainer implements IServerContainer {
* @return ISystemTagObjectMapper
*
* @since 9.0.0
+ * @deprecated
*/
public function getSystemTagObjectMapper() {
return $this->query(ISystemTagObjectMapper::class);
@@ -1529,6 +1541,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns the avatar manager, used for avatar functionality
*
* @return IAvatarManager
+ * @deprecated
*/
public function getAvatarManager() {
return $this->query(IAvatarManager::class);
@@ -1538,6 +1551,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns the root folder of ownCloud's data directory
*
* @return IRootFolder
+ * @deprecated
*/
public function getRootFolder() {
return $this->query(IRootFolder::class);
@@ -1559,6 +1573,7 @@ class Server extends ServerContainer implements IServerContainer {
*
* @param string $userId user ID
* @return \OCP\Files\Folder|null
+ * @deprecated
*/
public function getUserFolder($userId = null) {
if ($userId === null) {
@@ -1574,6 +1589,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OC\User\Manager
+ * @deprecated
*/
public function getUserManager() {
return $this->query(IUserManager::class);
@@ -1581,6 +1597,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OC\Group\Manager
+ * @deprecated
*/
public function getGroupManager() {
return $this->query(IGroupManager::class);
@@ -1588,6 +1605,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OC\User\Session
+ * @deprecated
*/
public function getUserSession() {
return $this->query(IUserSession::class);
@@ -1595,6 +1613,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\ISession
+ * @deprecated
*/
public function getSession() {
return $this->getUserSession()->getSession();
@@ -1611,6 +1630,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OC\Authentication\TwoFactorAuth\Manager
+ * @deprecated
*/
public function getTwoFactorAuthManager() {
return $this->query(\OC\Authentication\TwoFactorAuth\Manager::class);
@@ -1618,6 +1638,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OC\NavigationManager
+ * @deprecated
*/
public function getNavigationManager() {
return $this->query(INavigationManager::class);
@@ -1625,6 +1646,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\IConfig
+ * @deprecated
*/
public function getConfig() {
return $this->query(AllConfig::class);
@@ -1632,6 +1654,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OC\SystemConfig
+ * @deprecated
*/
public function getSystemConfig() {
return $this->query(SystemConfig::class);
@@ -1641,6 +1664,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns the app config manager
*
* @return IAppConfig
+ * @deprecated
*/
public function getAppConfig() {
return $this->query(IAppConfig::class);
@@ -1648,6 +1672,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return IFactory
+ * @deprecated
*/
public function getL10NFactory() {
return $this->query(IFactory::class);
@@ -1659,6 +1684,7 @@ class Server extends ServerContainer implements IServerContainer {
* @param string $app appid
* @param string $lang
* @return IL10N
+ * @deprecated
*/
public function getL10N($app, $lang = null) {
return $this->getL10NFactory()->get($app, $lang);
@@ -1666,6 +1692,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return IURLGenerator
+ * @deprecated
*/
public function getURLGenerator() {
return $this->query(IURLGenerator::class);
@@ -1673,6 +1700,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return AppFetcher
+ * @deprecated
*/
public function getAppFetcher() {
return $this->query(AppFetcher::class);
@@ -1693,6 +1721,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns an \OCP\CacheFactory instance
*
* @return \OCP\ICacheFactory
+ * @deprecated
*/
public function getMemCacheFactory() {
return $this->query(Factory::class);
@@ -1702,6 +1731,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns an \OC\RedisFactory instance
*
* @return \OC\RedisFactory
+ * @deprecated
*/
public function getGetRedisFactory() {
return $this->query('RedisFactory');
@@ -1712,6 +1742,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns the current session
*
* @return \OCP\IDBConnection
+ * @deprecated
*/
public function getDatabaseConnection() {
return $this->query(IDBConnection::class);
@@ -1721,6 +1752,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns the activity manager
*
* @return \OCP\Activity\IManager
+ * @deprecated
*/
public function getActivityManager() {
return $this->query(\OCP\Activity\IManager::class);
@@ -1730,6 +1762,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns an job list for controlling background jobs
*
* @return IJobList
+ * @deprecated
*/
public function getJobList() {
return $this->query(IJobList::class);
@@ -1739,6 +1772,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns a logger instance
*
* @return ILogger
+ * @deprecated
*/
public function getLogger() {
return $this->query(ILogger::class);
@@ -1747,6 +1781,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return ILogFactory
* @throws \OCP\AppFramework\QueryException
+ * @deprecated
*/
public function getLogFactory() {
return $this->query(ILogFactory::class);
@@ -1756,6 +1791,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns a router for generating and matching urls
*
* @return IRouter
+ * @deprecated
*/
public function getRouter() {
return $this->query(IRouter::class);
@@ -1765,6 +1801,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns a search instance
*
* @return ISearch
+ * @deprecated
*/
public function getSearch() {
return $this->query(ISearch::class);
@@ -1774,6 +1811,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns a SecureRandom instance
*
* @return \OCP\Security\ISecureRandom
+ * @deprecated
*/
public function getSecureRandom() {
return $this->query(ISecureRandom::class);
@@ -1783,6 +1821,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns a Crypto instance
*
* @return ICrypto
+ * @deprecated
*/
public function getCrypto() {
return $this->query(ICrypto::class);
@@ -1792,6 +1831,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns a Hasher instance
*
* @return IHasher
+ * @deprecated
*/
public function getHasher() {
return $this->query(IHasher::class);
@@ -1801,6 +1841,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns a CredentialsManager instance
*
* @return ICredentialsManager
+ * @deprecated
*/
public function getCredentialsManager() {
return $this->query(ICredentialsManager::class);
@@ -1811,6 +1852,7 @@ class Server extends ServerContainer implements IServerContainer {
*
* @param string $userId (optional) if not specified the current loggedin user is used, use null to get the system certificate manager
* @return \OCP\ICertificateManager | null if $uid is null and no user is logged in
+ * @deprecated
*/
public function getCertificateManager($userId = '') {
if ($userId === '') {
@@ -1834,6 +1876,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns an instance of the HTTP client service
*
* @return IClientService
+ * @deprecated
*/
public function getHTTPClientService() {
return $this->query(IClientService::class);
@@ -1843,6 +1886,7 @@ class Server extends ServerContainer implements IServerContainer {
* Create a new event source
*
* @return \OCP\IEventSource
+ * @deprecated
*/
public function createEventSource() {
return new \OC_EventSource();
@@ -1854,6 +1898,7 @@ class Server extends ServerContainer implements IServerContainer {
* The returned logger only logs data when debug mode is enabled
*
* @return IEventLogger
+ * @deprecated
*/
public function getEventLogger() {
return $this->query(IEventLogger::class);
@@ -1865,6 +1910,7 @@ class Server extends ServerContainer implements IServerContainer {
* The returned logger only logs data when debug mode is enabled
*
* @return IQueryLogger
+ * @deprecated
*/
public function getQueryLogger() {
return $this->query(IQueryLogger::class);
@@ -1874,6 +1920,7 @@ class Server extends ServerContainer implements IServerContainer {
* Get the manager for temporary files and folders
*
* @return \OCP\ITempManager
+ * @deprecated
*/
public function getTempManager() {
return $this->query(ITempManager::class);
@@ -1883,6 +1930,7 @@ class Server extends ServerContainer implements IServerContainer {
* Get the app manager
*
* @return \OCP\App\IAppManager
+ * @deprecated
*/
public function getAppManager() {
return $this->query(IAppManager::class);
@@ -1892,6 +1940,7 @@ class Server extends ServerContainer implements IServerContainer {
* Creates a new mailer
*
* @return IMailer
+ * @deprecated
*/
public function getMailer() {
return $this->query(IMailer::class);
@@ -1901,6 +1950,7 @@ class Server extends ServerContainer implements IServerContainer {
* Get the webroot
*
* @return string
+ * @deprecated
*/
public function getWebRoot() {
return $this->webRoot;
@@ -1908,6 +1958,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OC\OCSClient
+ * @deprecated
*/
public function getOcsClient() {
return $this->query('OcsClient');
@@ -1915,6 +1966,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return IDateTimeZone
+ * @deprecated
*/
public function getDateTimeZone() {
return $this->query(IDateTimeZone::class);
@@ -1922,6 +1974,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return IDateTimeFormatter
+ * @deprecated
*/
public function getDateTimeFormatter() {
return $this->query(IDateTimeFormatter::class);
@@ -1929,6 +1982,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return IMountProviderCollection
+ * @deprecated
*/
public function getMountProviderCollection() {
return $this->query(IMountProviderCollection::class);
@@ -1938,6 +1992,7 @@ class Server extends ServerContainer implements IServerContainer {
* Get the IniWrapper
*
* @return IniGetWrapper
+ * @deprecated
*/
public function getIniWrapper() {
return $this->query('IniWrapper');
@@ -1945,6 +2000,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Command\IBus
+ * @deprecated
*/
public function getCommandBus() {
return $this->query('AsyncCommandBus');
@@ -1954,6 +2010,7 @@ class Server extends ServerContainer implements IServerContainer {
* Get the trusted domain helper
*
* @return TrustedDomainHelper
+ * @deprecated
*/
public function getTrustedDomainHelper() {
return $this->query('TrustedDomainHelper');
@@ -1964,6 +2021,7 @@ class Server extends ServerContainer implements IServerContainer {
*
* @return ILockingProvider
* @since 8.1.0
+ * @deprecated
*/
public function getLockingProvider() {
return $this->query(ILockingProvider::class);
@@ -1971,6 +2029,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return IMountManager
+ * @deprecated
**/
public function getMountManager() {
return $this->query(IMountManager::class);
@@ -1978,6 +2037,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return IUserMountCache
+ * @deprecated
*/
public function getUserMountCache() {
return $this->query(IUserMountCache::class);
@@ -1987,6 +2047,7 @@ class Server extends ServerContainer implements IServerContainer {
* Get the MimeTypeDetector
*
* @return IMimeTypeDetector
+ * @deprecated
*/
public function getMimeTypeDetector() {
return $this->query(IMimeTypeDetector::class);
@@ -1996,6 +2057,7 @@ class Server extends ServerContainer implements IServerContainer {
* Get the MimeTypeLoader
*
* @return IMimeTypeLoader
+ * @deprecated
*/
public function getMimeTypeLoader() {
return $this->query(IMimeTypeLoader::class);
@@ -2005,6 +2067,7 @@ class Server extends ServerContainer implements IServerContainer {
* Get the manager of all the capabilities
*
* @return CapabilitiesManager
+ * @deprecated
*/
public function getCapabilitiesManager() {
return $this->query(CapabilitiesManager::class);
@@ -2026,6 +2089,7 @@ class Server extends ServerContainer implements IServerContainer {
*
* @return \OCP\Notification\IManager
* @since 8.2.0
+ * @deprecated
*/
public function getNotificationManager() {
return $this->query(\OCP\Notification\IManager::class);
@@ -2033,6 +2097,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return ICommentsManager
+ * @deprecated
*/
public function getCommentsManager() {
return $this->query(ICommentsManager::class);
@@ -2040,6 +2105,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCA\Theming\ThemingDefaults
+ * @deprecated
*/
public function getThemingDefaults() {
return $this->query('ThemingDefaults');
@@ -2047,6 +2113,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OC\IntegrityCheck\Checker
+ * @deprecated
*/
public function getIntegrityCodeChecker() {
return $this->query('IntegrityCodeChecker');
@@ -2054,6 +2121,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OC\Session\CryptoWrapper
+ * @deprecated
*/
public function getSessionCryptoWrapper() {
return $this->query('CryptoWrapper');
@@ -2061,6 +2129,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return CsrfTokenManager
+ * @deprecated
*/
public function getCsrfTokenManager() {
return $this->query(CsrfTokenManager::class);
@@ -2068,6 +2137,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return Throttler
+ * @deprecated
*/
public function getBruteForceThrottler() {
return $this->query(Throttler::class);
@@ -2075,6 +2145,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return IContentSecurityPolicyManager
+ * @deprecated
*/
public function getContentSecurityPolicyManager() {
return $this->query(ContentSecurityPolicyManager::class);
@@ -2082,6 +2153,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return ContentSecurityPolicyNonceManager
+ * @deprecated
*/
public function getContentSecurityPolicyNonceManager() {
return $this->query('ContentSecurityPolicyNonceManager');
@@ -2091,6 +2163,7 @@ class Server extends ServerContainer implements IServerContainer {
* Not a public API as of 8.2, wait for 9.0
*
* @return \OCA\Files_External\Service\BackendService
+ * @deprecated
*/
public function getStoragesBackendService() {
return $this->query(BackendService::class);
@@ -2100,6 +2173,7 @@ class Server extends ServerContainer implements IServerContainer {
* Not a public API as of 8.2, wait for 9.0
*
* @return \OCA\Files_External\Service\GlobalStoragesService
+ * @deprecated
*/
public function getGlobalStoragesService() {
return $this->query(GlobalStoragesService::class);
@@ -2109,6 +2183,7 @@ class Server extends ServerContainer implements IServerContainer {
* Not a public API as of 8.2, wait for 9.0
*
* @return \OCA\Files_External\Service\UserGlobalStoragesService
+ * @deprecated
*/
public function getUserGlobalStoragesService() {
return $this->query(UserGlobalStoragesService::class);
@@ -2118,6 +2193,7 @@ class Server extends ServerContainer implements IServerContainer {
* Not a public API as of 8.2, wait for 9.0
*
* @return \OCA\Files_External\Service\UserStoragesService
+ * @deprecated
*/
public function getUserStoragesService() {
return $this->query(UserStoragesService::class);
@@ -2125,6 +2201,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Share\IManager
+ * @deprecated
*/
public function getShareManager() {
return $this->query(\OCP\Share\IManager::class);
@@ -2132,6 +2209,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Collaboration\Collaborators\ISearch
+ * @deprecated
*/
public function getCollaboratorSearch() {
return $this->query(\OCP\Collaboration\Collaborators\ISearch::class);
@@ -2139,6 +2217,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Collaboration\AutoComplete\IManager
+ * @deprecated
*/
public function getAutoCompleteManager() {
return $this->query(IManager::class);
@@ -2148,6 +2227,7 @@ class Server extends ServerContainer implements IServerContainer {
* Returns the LDAP Provider
*
* @return \OCP\LDAP\ILDAPProvider
+ * @deprecated
*/
public function getLDAPProvider() {
return $this->query('LDAPProvider');
@@ -2155,6 +2235,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Settings\IManager
+ * @deprecated
*/
public function getSettingsManager() {
return $this->query('SettingsManager');
@@ -2162,6 +2243,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Files\IAppData
+ * @deprecated
*/
public function getAppDataDir($app) {
/** @var \OC\Files\AppData\Factory $factory */
@@ -2171,6 +2253,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Lockdown\ILockdownManager
+ * @deprecated
*/
public function getLockdownManager() {
return $this->query('LockdownManager');
@@ -2178,6 +2261,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Federation\ICloudIdManager
+ * @deprecated
*/
public function getCloudIdManager() {
return $this->query(ICloudIdManager::class);
@@ -2185,6 +2269,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\GlobalScale\IConfig
+ * @deprecated
*/
public function getGlobalScaleConfig() {
return $this->query(IConfig::class);
@@ -2192,6 +2277,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Federation\ICloudFederationProviderManager
+ * @deprecated
*/
public function getCloudFederationProviderManager() {
return $this->query(ICloudFederationProviderManager::class);
@@ -2199,6 +2285,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Remote\Api\IApiFactory
+ * @deprecated
*/
public function getRemoteApiFactory() {
return $this->query(IApiFactory::class);
@@ -2206,6 +2293,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Federation\ICloudFederationFactory
+ * @deprecated
*/
public function getCloudFederationFactory() {
return $this->query(ICloudFederationFactory::class);
@@ -2213,6 +2301,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return \OCP\Remote\IInstanceFactory
+ * @deprecated
*/
public function getRemoteInstanceFactory() {
return $this->query(IInstanceFactory::class);
@@ -2220,6 +2309,7 @@ class Server extends ServerContainer implements IServerContainer {
/**
* @return IStorageFactory
+ * @deprecated
*/
public function getStorageFactory() {
return $this->query(IStorageFactory::class);
@@ -2230,6 +2320,7 @@ class Server extends ServerContainer implements IServerContainer {
*
* @return GeneratorHelper
* @since 17.0.0
+ * @deprecated
*/
public function getGeneratorHelper() {
return $this->query(\OC\Preview\GeneratorHelper::class);
diff --git a/lib/private/ServerContainer.php b/lib/private/ServerContainer.php
index eb6bda1e27b..b1bf38265b8 100644
--- a/lib/private/ServerContainer.php
+++ b/lib/private/ServerContainer.php
@@ -127,6 +127,9 @@ class ServerContainer extends SimpleContainer {
return parent::has($id);
}
+ /**
+ * @deprecated 20.0.0 use \Psr\Container\ContainerInterface::get
+ */
public function query(string $name, bool $autoload = true) {
$name = $this->sanitizeName($name);
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index 1fbf0acb99c..69eb26ab8b2 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -48,6 +48,7 @@ use OC\AppFramework\Http\Request;
use OC\Template\JSCombiner;
use OC\Template\JSConfigHelper;
use OC\Template\SCSSCacher;
+use OCP\AppFramework\Http\TemplateResponse;
use OCP\Defaults;
use OCP\IInitialStateService;
use OCP\Support\Subscription\IRegistry;
@@ -74,7 +75,7 @@ class TemplateLayout extends \OC_Template {
}
// Decide which page we show
- if ($renderAs === 'user') {
+ if ($renderAs === TemplateResponse::RENDER_AS_USER) {
parent::__construct('core', 'layout.user');
if (in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) {
$this->assign('bodyid', 'body-settings');
@@ -123,12 +124,12 @@ class TemplateLayout extends \OC_Template {
} catch (\OCP\AutoloadNotAllowedException $e) {
$this->assign('themingInvertMenu', false);
}
- } elseif ($renderAs === 'error') {
+ } elseif ($renderAs === TemplateResponse::RENDER_AS_ERROR) {
parent::__construct('core', 'layout.guest', '', false);
$this->assign('bodyid', 'body-login');
$this->assign('user_displayname', '');
$this->assign('user_uid', '');
- } elseif ($renderAs === 'guest') {
+ } elseif ($renderAs === TemplateResponse::RENDER_AS_GUEST) {
parent::__construct('core', 'layout.guest');
\OC_Util::addStyle('guest');
$this->assign('bodyid', 'body-login');
@@ -136,7 +137,7 @@ class TemplateLayout extends \OC_Template {
$userDisplayName = \OC_User::getDisplayName();
$this->assign('user_displayname', $userDisplayName);
$this->assign('user_uid', \OC_User::getUser());
- } elseif ($renderAs === 'public') {
+ } elseif ($renderAs === TemplateResponse::RENDER_AS_PUBLIC) {
parent::__construct('core', 'layout.public');
$this->assign('appid', $appId);
$this->assign('bodyid', 'body-public');
@@ -172,7 +173,7 @@ class TemplateLayout extends \OC_Template {
// Add the js files
$jsFiles = self::findJavascriptFiles(\OC_Util::$scripts);
$this->assign('jsfiles', []);
- if ($this->config->getSystemValue('installed', false) && $renderAs != 'error') {
+ if ($this->config->getSystemValue('installed', false) && $renderAs != TemplateResponse::RENDER_AS_ERROR) {
if (\OC::$server->getContentSecurityPolicyNonceManager()->browserSupportsCspV3()) {
$jsConfigHelper = new JSConfigHelper(
\OC::$server->getL10N('lib'),
@@ -210,7 +211,7 @@ class TemplateLayout extends \OC_Template {
&& !\OCP\Util::needUpgrade()
&& $pathInfo !== ''
&& !preg_match('/^\/login/', $pathInfo)
- && $renderAs !== 'error'
+ && $renderAs !== TemplateResponse::RENDER_AS_ERROR
) {
$cssFiles = self::findStylesheetFiles(\OC_Util::$styles);
} else {
diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php
index 4110bee114d..5851fc01379 100644
--- a/lib/private/legacy/OC_App.php
+++ b/lib/private/legacy/OC_App.php
@@ -52,11 +52,14 @@ declare(strict_types=1);
*/
use OC\App\DependencyAnalyzer;
use OC\App\Platform;
+use OC\AppFramework\Bootstrap\Coordinator;
use OC\DB\MigrationService;
use OC\Installer;
use OC\Repair;
use OC\ServerNotAvailableException;
use OCP\App\ManagerEvent;
+use OCP\AppFramework\QueryException;
+use OCP\Authentication\IAlternativeLogin;
use OCP\ILogger;
/**
@@ -149,8 +152,8 @@ class OC_App {
// in case someone calls loadApp() directly
self::registerAutoloading($app, $appPath);
- /** @var \OC\AppFramework\Bootstrap\Coordinator $coordinator */
- $coordinator = \OC::$server->query(\OC\AppFramework\Bootstrap\Coordinator::class);
+ /** @var Coordinator $coordinator */
+ $coordinator = \OC::$server->query(Coordinator::class);
$isBootable = $coordinator->isBootable($app);
$hasAppPhpFile = is_file($appPath . '/appinfo/app.php');
@@ -672,8 +675,10 @@ class OC_App {
/**
* @param array $entry
+ * @deprecated 20.0.0 Please register your alternative login option using the registerAlternativeLogin() on the RegistrationContext in your Application class implementing the OCP\Authentication\IAlternativeLogin interface
*/
public static function registerLogIn(array $entry) {
+ \OC::$server->getLogger()->debug('OC_App::registerLogIn() is deprecated, please register your alternative login option using the registerAlternativeLogin() on the RegistrationContext in your Application class implementing the OCP\Authentication\IAlternativeLogin interface');
self::$altLogin[] = $entry;
}
@@ -681,6 +686,47 @@ class OC_App {
* @return array
*/
public static function getAlternativeLogIns(): array {
+ /** @var Coordinator $bootstrapCoordinator */
+ $bootstrapCoordinator = \OC::$server->query(Coordinator::class);
+
+ foreach ($bootstrapCoordinator->getRegistrationContext()->getAlternativeLogins() as $registration) {
+ if (!in_array(IAlternativeLogin::class, class_implements($registration['class']), true)) {
+ \OC::$server->getLogger()->error('Alternative login option {option} does not implement {interface} and is therefore ignored.', [
+ 'option' => $registration['class'],
+ 'interface' => IAlternativeLogin::class,
+ 'app' => $registration['app'],
+ ]);
+ continue;
+ }
+
+ try {
+ /** @var IAlternativeLogin $provider */
+ $provider = \OC::$server->query($registration['class']);
+ } catch (QueryException $e) {
+ \OC::$server->getLogger()->logException($e, [
+ 'message' => 'Alternative login option {option} can not be initialised.',
+ 'option' => $registration['class'],
+ 'app' => $registration['app'],
+ ]);
+ }
+
+ try {
+ $provider->load();
+
+ self::$altLogin[] = [
+ 'name' => $provider->getLabel(),
+ 'href' => $provider->getLink(),
+ 'style' => $provider->getClass(),
+ ];
+ } catch (Throwable $e) {
+ \OC::$server->getLogger()->logException($e, [
+ 'message' => 'Alternative login option {option} had an error while loading.',
+ 'option' => $registration['class'],
+ 'app' => $registration['app'],
+ ]);
+ }
+ }
+
return self::$altLogin;
}
diff --git a/lib/private/legacy/OC_Template.php b/lib/private/legacy/OC_Template.php
index 856d5491090..32d185d25fd 100644
--- a/lib/private/legacy/OC_Template.php
+++ b/lib/private/legacy/OC_Template.php
@@ -39,6 +39,7 @@
*/
use OC\TemplateLayout;
+use OCP\AppFramework\Http\TemplateResponse;
require_once __DIR__.'/template/functions.php';
@@ -72,7 +73,7 @@ class OC_Template extends \OC\Template\Base {
* "admin".
* @param bool $registerCall = true
*/
- public function __construct($app, $name, $renderAs = "", $registerCall = true) {
+ public function __construct($app, $name, $renderAs = TemplateResponse::RENDER_AS_BLANK, $registerCall = true) {
// Read the selected theme from the config file
self::initTemplateEngine($renderAs);
@@ -104,7 +105,7 @@ class OC_Template extends \OC\Template\Base {
//apps that started before the template initialization can load their own scripts/styles
//so to make sure this scripts/styles here are loaded first we use OC_Util::addScript() with $prepend=true
//meaning the last script/style in this list will be loaded first
- if (\OC::$server->getSystemConfig()->getValue('installed', false) && $renderAs !== 'error' && !\OCP\Util::needUpgrade()) {
+ if (\OC::$server->getSystemConfig()->getValue('installed', false) && $renderAs !== TemplateResponse::RENDER_AS_ERROR && !\OCP\Util::needUpgrade()) {
if (\OC::$server->getConfig()->getAppValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') {
OC_Util::addScript('backgroundjobs', null, true);
}
diff --git a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
index 8ce140996b7..94e3aed17e2 100644
--- a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
+++ b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php
@@ -139,4 +139,17 @@ interface IRegistrationContext {
* @since 20.0.0
*/
public function registerSearchProvider(string $class): void;
+
+ /**
+ * Register an alternative login option
+ *
+ * It is allowed to register more than one option per app.
+ *
+ * @param string $class
+ *
+ * @return void
+ *
+ * @since 20.0.0
+ */
+ public function registerAlternativeLogin(string $class): void;
}
diff --git a/lib/public/AppFramework/Http/TemplateResponse.php b/lib/public/AppFramework/Http/TemplateResponse.php
index 48e6c43411f..9622d9696dc 100644
--- a/lib/public/AppFramework/Http/TemplateResponse.php
+++ b/lib/public/AppFramework/Http/TemplateResponse.php
@@ -39,6 +39,27 @@ namespace OCP\AppFramework\Http;
*/
class TemplateResponse extends Response {
/**
+ * @since 20.0.0
+ */
+ public const RENDER_AS_GUEST = 'guest';
+ /**
+ * @since 20.0.0
+ */
+ public const RENDER_AS_BLANK = '';
+ /**
+ * @since 20.0.0
+ */
+ public const RENDER_AS_USER = 'user';
+ /**
+ * @since 20.0.0
+ */
+ public const RENDER_AS_ERROR = 'error';
+ /**
+ * @since 20.0.0
+ */
+ public const RENDER_AS_PUBLIC = 'public';
+
+ /**
* @deprecated 20.0.0 use OCP\AppFramework\Http\Events\BeforeTemplateRenderedEvent
*/
public const EVENT_LOAD_ADDITIONAL_SCRIPTS = self::class . '::loadAdditionalScripts';
@@ -81,7 +102,7 @@ class TemplateResponse extends Response {
* @since 6.0.0 - parameters $params and $renderAs were added in 7.0.0
*/
public function __construct($appName, $templateName, array $params=[],
- $renderAs='user') {
+ $renderAs = self::RENDER_AS_USER) {
parent::__construct();
$this->templateName = $templateName;
@@ -160,8 +181,18 @@ class TemplateResponse extends Response {
* @since 6.0.0
*/
public function render() {
- // \OCP\Template needs an empty string instead of 'blank' for an unwrapped response
- $renderAs = $this->renderAs === 'blank' ? '' : $this->renderAs;
+ $renderAs = self::RENDER_AS_USER;
+ if ($this->renderAs === 'blank') {
+ // Legacy fallback as \OCP\Template needs an empty string instead of 'blank' for an unwrapped response
+ $renderAs = self::RENDER_AS_BLANK;
+ } elseif (in_array($this->renderAs, [
+ self::RENDER_AS_GUEST,
+ self::RENDER_AS_BLANK,
+ self::RENDER_AS_ERROR,
+ self::RENDER_AS_PUBLIC,
+ self::RENDER_AS_USER], true)) {
+ $renderAs = $this->renderAs;
+ }
\OCP\Util::addHeader('meta', ['name' => 'robots', 'content' => 'noindex, nofollow']);
$template = new \OCP\Template($this->appName, $this->templateName, $renderAs);
diff --git a/lib/public/AppFramework/IAppContainer.php b/lib/public/AppFramework/IAppContainer.php
index 2a3689e7063..f3497a6e0e1 100644
--- a/lib/public/AppFramework/IAppContainer.php
+++ b/lib/public/AppFramework/IAppContainer.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -27,16 +30,18 @@
namespace OCP\AppFramework;
use OCP\IContainer;
+use Psr\Container\ContainerInterface;
/**
- * Class IAppContainer
- * @package OCP\AppFramework
+ * This is a tagging interface for a container that belongs to an app
+ *
+ * The interface currently extends IContainer, but this interface is deprecated as of Nextcloud 20,
+ * thus this interface won't extend it anymore once that was removed. So migrate to the ContainerInterface
+ * only.
*
- * This container interface provides short cuts for app developers to access predefined app service.
* @since 6.0.0
- * @deprecated 20.0.0 use \Psr\Container\ContainerInterface
*/
-interface IAppContainer extends IContainer {
+interface IAppContainer extends ContainerInterface, IContainer {
/**
* used to return the appname of the set application
diff --git a/lib/public/Authentication/IAlternativeLogin.php b/lib/public/Authentication/IAlternativeLogin.php
new file mode 100644
index 00000000000..2b584a86066
--- /dev/null
+++ b/lib/public/Authentication/IAlternativeLogin.php
@@ -0,0 +1,58 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Authentication;
+
+/**
+ * @since 20.0.0
+ */
+interface IAlternativeLogin {
+
+ /**
+ * Label shown on the login option
+ * @return string
+ * @since 20.0.0
+ */
+ public function getLabel(): string;
+
+ /**
+ * Relative link to the login option
+ * @return string
+ * @since 20.0.0
+ */
+ public function getLink(): string;
+
+ /**
+ * CSS classes added to the alternative login option on the login screen
+ * @return string
+ * @since 20.0.0
+ */
+ public function getClass(): string;
+
+ /**
+ * Load necessary resources to present the login option, e.g. style-file to style the getClass()
+ * @since 20.0.0
+ */
+ public function load(): void;
+}
diff --git a/lib/public/IServerContainer.php b/lib/public/IServerContainer.php
index 084c161b47c..215cfab84fd 100644
--- a/lib/public/IServerContainer.php
+++ b/lib/public/IServerContainer.php
@@ -1,4 +1,7 @@
<?php
+
+declare(strict_types=1);
+
/**
* @copyright Copyright (c) 2016, ownCloud, Inc.
*
@@ -37,32 +40,25 @@
*
*/
-/**
- * Public interface of ownCloud for apps to use.
- * Server container interface
- *
- */
-
-// use OCP namespace for all classes that are considered public.
-// This means that they should be used by apps instead of the internal ownCloud classes
-
namespace OCP;
use OCP\Federation\ICloudFederationFactory;
use OCP\Federation\ICloudFederationProviderManager;
use OCP\Log\ILogFactory;
use OCP\Security\IContentSecurityPolicyManager;
+use Psr\Container\ContainerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
- * Class IServerContainer
- * @package OCP
+ * This is a tagging interface for the server container
+ *
+ * The interface currently extends IContainer, but this interface is deprecated as of Nextcloud 20,
+ * thus this interface won't extend it anymore once that was removed. So migrate to the ContainerInterface
+ * only.
*
- * This container holds all ownCloud services
* @since 6.0.0
- * @deprecated 20.0.0 use \Psr\Container\ContainerInterface
*/
-interface IServerContainer extends IContainer {
+interface IServerContainer extends ContainerInterface, IContainer {
/**
* The calendar manager will act as a broker between consumers for calendar information and
@@ -70,6 +66,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Calendar\IManager
* @since 13.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCalendarManager();
@@ -79,6 +76,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Calendar\Resource\IBackend
* @since 14.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCalendarResourceBackendManager();
@@ -88,6 +86,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Calendar\Room\IBackend
* @since 14.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCalendarRoomBackendManager();
@@ -97,6 +96,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Contacts\IManager
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getContactsManager();
@@ -107,6 +107,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\IRequest
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getRequest();
@@ -115,6 +116,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\IPreview
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getPreviewManager();
@@ -124,6 +126,7 @@ interface IServerContainer extends IContainer {
* @see \OCP\ITagManager::load()
* @return \OCP\ITagManager
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getTagManager();
@@ -132,6 +135,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Files\IRootFolder
* @since 6.0.0 - between 6.0.0 and 8.0.0 this returned \OCP\Files\Folder
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getRootFolder();
@@ -142,6 +146,7 @@ interface IServerContainer extends IContainer {
* @return \OCP\Files\Folder
* @since 6.0.0 - parameter $userId was added in 8.0.0
* @see getUserFolder in \OCP\Files\IRootFolder
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getUserFolder($userId = null);
@@ -150,6 +155,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\IUserManager
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getUserManager();
@@ -158,6 +164,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\IGroupManager
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getGroupManager();
@@ -166,6 +173,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\IUserSession
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getUserSession();
@@ -174,6 +182,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\INavigationManager
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getNavigationManager();
@@ -182,6 +191,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\IConfig
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getConfig();
@@ -190,6 +200,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Security\ICrypto
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCrypto();
@@ -198,6 +209,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Security\IHasher
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getHasher();
@@ -206,6 +218,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Security\ISecureRandom
* @since 8.1.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getSecureRandom();
@@ -214,6 +227,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Security\ICredentialsManager
* @since 9.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCredentialsManager();
@@ -222,12 +236,14 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\IAppConfig
* @since 7.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getAppConfig();
/**
* @return \OCP\L10N\IFactory
* @since 8.2.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getL10NFactory();
@@ -237,24 +253,28 @@ interface IServerContainer extends IContainer {
* @param string $lang
* @return \OCP\IL10N
* @since 6.0.0 - parameter $lang was added in 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getL10N($app, $lang = null);
/**
* @return \OC\Encryption\Manager
* @since 8.1.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getEncryptionManager();
/**
* @return \OC\Encryption\File
* @since 8.1.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getEncryptionFilesHelper();
/**
* @return \OCP\Encryption\Keys\IStorage
* @since 8.1.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getEncryptionKeyStorage();
@@ -263,6 +283,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\IURLGenerator
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getURLGenerator();
@@ -271,6 +292,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\ICache
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCache();
@@ -279,6 +301,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\ICacheFactory
* @since 7.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getMemCacheFactory();
@@ -287,6 +310,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\ISession
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getSession();
@@ -295,6 +319,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Activity\IManager
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getActivityManager();
@@ -303,6 +328,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\IDBConnection
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getDatabaseConnection();
@@ -311,6 +337,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\IAvatarManager
* @since 6.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getAvatarManager();
@@ -319,6 +346,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\BackgroundJob\IJobList
* @since 7.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getJobList();
@@ -327,6 +355,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\ILogger
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getLogger();
@@ -335,6 +364,7 @@ interface IServerContainer extends IContainer {
*
* @return ILogFactory
* @since 14.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getLogFactory();
@@ -343,6 +373,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Route\IRouter
* @since 7.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getRouter();
@@ -361,6 +392,7 @@ interface IServerContainer extends IContainer {
* @param string $userId (optional) if not specified the current loggedin user is used, use null to get the system certificate manager
* @return \OCP\ICertificateManager | null if $userId is null and no user is logged in
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCertificateManager($userId = null);
@@ -369,6 +401,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\IEventSource
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function createEventSource();
@@ -377,6 +410,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Http\Client\IClientService
* @since 8.1.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getHTTPClientService();
@@ -385,6 +419,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Diagnostics\IEventLogger
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getEventLogger();
@@ -395,6 +430,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Diagnostics\IQueryLogger
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getQueryLogger();
@@ -403,6 +439,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\ITempManager
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getTempManager();
@@ -411,6 +448,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\App\IAppManager
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getAppManager();
@@ -419,12 +457,14 @@ interface IServerContainer extends IContainer {
*
* @return string
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getWebRoot();
/**
* @return \OCP\Files\Config\IMountProviderCollection
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getMountProviderCollection();
@@ -433,11 +473,13 @@ interface IServerContainer extends IContainer {
*
* @return \bantu\IniGetWrapper\IniGetWrapper
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getIniWrapper();
/**
* @return \OCP\Command\IBus
* @since 8.1.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCommandBus();
@@ -446,6 +488,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Mail\IMailer
* @since 8.1.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getMailer();
@@ -454,12 +497,14 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Lock\ILockingProvider
* @since 8.1.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getLockingProvider();
/**
* @return \OCP\Files\Mount\IMountManager
* @since 8.2.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getMountManager();
@@ -468,6 +513,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Files\IMimeTypeDetector
* @since 8.2.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getMimeTypeDetector();
@@ -476,6 +522,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Files\IMimeTypeLoader
* @since 8.2.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getMimeTypeLoader();
@@ -493,12 +540,14 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Notification\IManager
* @since 9.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getNotificationManager();
/**
* @return \OCP\Comments\ICommentsManager
* @since 9.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCommentsManager();
@@ -508,6 +557,7 @@ interface IServerContainer extends IContainer {
* @return \OCP\SystemTag\ISystemTagManager
*
* @since 9.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getSystemTagManager();
@@ -517,6 +567,7 @@ interface IServerContainer extends IContainer {
* @return \OCP\SystemTag\ISystemTagObjectMapper
*
* @since 9.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getSystemTagObjectMapper();
@@ -525,6 +576,7 @@ interface IServerContainer extends IContainer {
*
* @return \OCP\Share\IManager
* @since 9.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getShareManager();
@@ -538,54 +590,63 @@ interface IServerContainer extends IContainer {
/**
* @return \OCP\IDateTimeZone
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getDateTimeZone();
/**
* @return \OCP\IDateTimeFormatter
* @since 8.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getDateTimeFormatter();
/**
* @return \OCP\Federation\ICloudIdManager
* @since 12.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCloudIdManager();
/**
* @return \OCP\GlobalScale\IConfig
* @since 14.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getGlobalScaleConfig();
/**
* @return ICloudFederationFactory
* @since 14.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCloudFederationFactory();
/**
* @return ICloudFederationProviderManager
* @since 14.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getCloudFederationProviderManager();
/**
* @return \OCP\Remote\Api\IApiFactory
* @since 13.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getRemoteApiFactory();
/**
* @return \OCP\Remote\IInstanceFactory
* @since 13.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getRemoteInstanceFactory();
/**
* @return \OCP\Files\Storage\IStorageFactory
* @since 15.0.0
+ * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
*/
public function getStorageFactory();
}