aboutsummaryrefslogtreecommitdiffstats
path: root/apps/encryption/appinfo
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-03-30 11:49:03 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:28 +0200
commita85e2e0bfdb86de029f7b5fde42ead60498aed82 (patch)
treedfd3ef5d49e3be52e533e2ecd95547f8a08f41ec /apps/encryption/appinfo
parent4aa125cc0a2b5a129c4f97d807f7a225a7620199 (diff)
downloadnextcloud-server-a85e2e0bfdb86de029f7b5fde42ead60498aed82.tar.gz
nextcloud-server-a85e2e0bfdb86de029f7b5fde42ead60498aed82.zip
make recovery settings work
Diffstat (limited to 'apps/encryption/appinfo')
-rw-r--r--apps/encryption/appinfo/app.php11
-rw-r--r--apps/encryption/appinfo/application.php (renamed from apps/encryption/appinfo/encryption.php)28
-rw-r--r--apps/encryption/appinfo/routes.php8
3 files changed, 22 insertions, 25 deletions
diff --git a/apps/encryption/appinfo/app.php b/apps/encryption/appinfo/app.php
index 72e7fc42ca0..38f9ff2f040 100644
--- a/apps/encryption/appinfo/app.php
+++ b/apps/encryption/appinfo/app.php
@@ -19,15 +19,10 @@
*
*/
-use OCA\Encryption\AppInfo\Encryption;
+namespace OCA\Encryption\AppInfo;
-if (!OC::$CLI) {
+if (!\OC::$CLI) {
$di = \OC::$server;
- $app = new Encryption('encryption',
- [],
- $di->getEncryptionManager(),
- $di->getConfig());
-
- $app->boot();
+ $app = new Application();
}
diff --git a/apps/encryption/appinfo/encryption.php b/apps/encryption/appinfo/application.php
index 6aad9219025..606c0cc5c49 100644
--- a/apps/encryption/appinfo/encryption.php
+++ b/apps/encryption/appinfo/application.php
@@ -36,7 +36,7 @@ use OCP\Encryption\IManager;
use OCP\IConfig;
-class Encryption extends \OCP\AppFramework\App {
+class Application extends \OCP\AppFramework\App {
/**
* @var IManager
*/
@@ -49,19 +49,11 @@ class Encryption extends \OCP\AppFramework\App {
/**
* @param $appName
* @param array $urlParams
- * @param IManager $encryptionManager
- * @param IConfig $config
*/
- public function __construct($appName, $urlParams = array(), IManager $encryptionManager, IConfig $config) {
- parent::__construct($appName, $urlParams);
- $this->encryptionManager = $encryptionManager;
- $this->config = $config;
- }
-
- /**
- *
- */
- public function boot() {
+ public function __construct($urlParams = array()) {
+ parent::__construct('encryption', $urlParams);
+ $this->encryptionManager = \OC::$server->getEncryptionManager();
+ $this->config = \OC::$server->getConfig();
$this->registerServices();
$this->registerEncryptionModule();
$this->registerHooks();
@@ -153,6 +145,16 @@ class Encryption extends \OCP\AppFramework\App {
$server->getEncryptionKeyStorage(\OCA\Encryption\Crypto\Encryption::ID));
});
+ $container->registerService('RecoveryController', function (IAppContainer $c) {
+ $server = $c->getServer();
+ return new \OCA\Encryption\Controller\RecoveryController(
+ $c->getAppName(),
+ $server->getRequest(),
+ $server->getConfig(),
+ $server->getL10N($c->getAppName()),
+ $c->query('Recovery'));
+ });
+
$container->registerService('UserSetup',
function (IAppContainer $c) {
$server = $c->getServer();
diff --git a/apps/encryption/appinfo/routes.php b/apps/encryption/appinfo/routes.php
index a86f3717ce9..b2c00c83349 100644
--- a/apps/encryption/appinfo/routes.php
+++ b/apps/encryption/appinfo/routes.php
@@ -20,17 +20,17 @@
*/
-use OCP\AppFramework\App;
+namespace OCA\Encryption\AppInfo;
-(new App('encryption'))->registerRoutes($this, array('routes' => array(
+(new Application())->registerRoutes($this, array('routes' => array(
[
- 'name' => 'recovery#adminRecovery',
+ 'name' => 'Recovery#adminRecovery',
'url' => '/ajax/adminRecovery',
'verb' => 'POST'
],
[
- 'name' => 'recovery#userRecovery',
+ 'name' => 'Recovery#userRecovery',
'url' => '/ajax/userRecovery',
'verb' => 'POST'
]