aboutsummaryrefslogtreecommitdiff
path: root/appinfo/application.php
diff options
context:
space:
mode:
Diffstat (limited to 'appinfo/application.php')
-rw-r--r--appinfo/application.php25
1 files changed, 20 insertions, 5 deletions
diff --git a/appinfo/application.php b/appinfo/application.php
index ecee129..7a1691d 100644
--- a/appinfo/application.php
+++ b/appinfo/application.php
@@ -1,6 +1,7 @@
<?php
namespace OCA\Grauphel\AppInfo;
use \OCP\AppFramework\App;
+use \OCA\Grauphel\Lib\Dependencies;
class Application extends App
{
@@ -10,12 +11,21 @@ class Application extends App
$container = $this->getContainer();
+ $container->registerService(
+ 'Session',
+ function($c) {
+ return $c->query('ServerContainer')->getUserSession();
+ }
+ );
+
/**
* Controllers
*/
$container->registerService(
- 'ApiController',
+ 'ApiController',
function($c) {
+ Dependencies::get()->urlGen
+ = $c->query('ServerContainer')->getURLGenerator();
return new \OCA\Grauphel\Controller\ApiController(
$c->query('AppName'),
$c->query('Request')
@@ -23,8 +33,10 @@ class Application extends App
}
);
$container->registerService(
- 'AccessController',
+ 'AccessController',
function($c) {
+ Dependencies::get()->urlGen
+ = $c->query('ServerContainer')->getURLGenerator();
return new \OCA\Grauphel\Controller\AccessController(
$c->query('AppName'),
$c->query('Request')
@@ -32,11 +44,14 @@ class Application extends App
}
);
$container->registerService(
- 'OAuthController',
+ 'OauthController',
function($c) {
- return new \OCA\Grauphel\Controller\OAuthController(
+ Dependencies::get()->urlGen
+ = $c->query('ServerContainer')->getURLGenerator();
+ return new \OCA\Grauphel\Controller\OauthController(
$c->query('AppName'),
- $c->query('Request')
+ $c->query('Request'),
+ $c->query('Session')->getUser()
);
}
);