summaryrefslogtreecommitdiffstats
path: root/apps/provisioning_api/lib/AppInfo/Application.php
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2021-03-09 20:17:44 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2021-03-10 09:39:47 +0100
commite5b1d59dfd7bbc723586ae0ffeec9628fb6281be (patch)
tree62e272fa6bc8c7e299016d7450954209ce87f0dc /apps/provisioning_api/lib/AppInfo/Application.php
parent45cfeefd1be33b50805151b10d58647c51d80244 (diff)
downloadnextcloud-server-e5b1d59dfd7bbc723586ae0ffeec9628fb6281be.tar.gz
nextcloud-server-e5b1d59dfd7bbc723586ae0ffeec9628fb6281be.zip
Provisioning API to IBootstrap
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/provisioning_api/lib/AppInfo/Application.php')
-rw-r--r--apps/provisioning_api/lib/AppInfo/Application.php19
1 files changed, 13 insertions, 6 deletions
diff --git a/apps/provisioning_api/lib/AppInfo/Application.php b/apps/provisioning_api/lib/AppInfo/Application.php
index 9e386e99064..de9d91e0b6b 100644
--- a/apps/provisioning_api/lib/AppInfo/Application.php
+++ b/apps/provisioning_api/lib/AppInfo/Application.php
@@ -34,20 +34,24 @@ use OC\Group\Manager as GroupManager;
use OCA\Provisioning_API\Middleware\ProvisioningApiMiddleware;
use OCA\Settings\Mailer\NewUserMailHelper;
use OCP\AppFramework\App;
+use OCP\AppFramework\Bootstrap\IBootContext;
+use OCP\AppFramework\Bootstrap\IBootstrap;
+use OCP\AppFramework\Bootstrap\IRegistrationContext;
use OCP\AppFramework\Utility\IControllerMethodReflector;
use OCP\Defaults;
use OCP\IGroupManager;
use OCP\IUser;
use OCP\Util;
-class Application extends App {
+class Application extends App implements IBootstrap {
public function __construct(array $urlParams = []) {
parent::__construct('provisioning_api', $urlParams);
+ }
- $container = $this->getContainer();
- $server = $container->getServer();
+ public function register(IRegistrationContext $context): void {
+ $server = $this->getContainer()->getServer();
- $container->registerService(NewUserMailHelper::class, function (SimpleContainer $c) use ($server) {
+ $context->registerService(NewUserMailHelper::class, function (SimpleContainer $c) use ($server) {
return new NewUserMailHelper(
$server->query(Defaults::class),
$server->getURLGenerator(),
@@ -60,7 +64,7 @@ class Application extends App {
Util::getDefaultEmailAddress('no-reply')
);
});
- $container->registerService('ProvisioningApiMiddleware', function (SimpleContainer $c) use ($server) {
+ $context->registerService(ProvisioningApiMiddleware::class, function (SimpleContainer $c) use ($server) {
$user = $server->getUserManager()->get($c['UserId']);
$isAdmin = false;
$isSubAdmin = false;
@@ -78,6 +82,9 @@ class Application extends App {
$isSubAdmin
);
});
- $container->registerMiddleWare('ProvisioningApiMiddleware');
+ $context->registerMiddleware(ProvisioningApiMiddleware::class);
+ }
+
+ public function boot(IBootContext $context): void {
}
}