summaryrefslogtreecommitdiffstats
path: root/apps/encryption/appinfo
diff options
context:
space:
mode:
authorClark Tomlinson <fallen013@gmail.com>2015-04-16 09:45:09 -0400
committerClark Tomlinson <fallen013@gmail.com>2015-04-16 09:45:09 -0400
commitac133e9faa0a3568716596e83c5ff0993c8dcf89 (patch)
treefa97f4a1d7d633050c23338407ad35e01865f551 /apps/encryption/appinfo
parent1174ad0681bb82252a26b5ee44d5b2990171932b (diff)
parente93f262eac858bc149872966c85e8019a1970d0a (diff)
downloadnextcloud-server-ac133e9faa0a3568716596e83c5ff0993c8dcf89.tar.gz
nextcloud-server-ac133e9faa0a3568716596e83c5ff0993c8dcf89.zip
Merge pull request #15675 from owncloud/enc_error_messages
[encryption] display warning if password changed or if the keys are not initialized
Diffstat (limited to 'apps/encryption/appinfo')
-rw-r--r--apps/encryption/appinfo/app.php2
-rw-r--r--apps/encryption/appinfo/application.php22
-rw-r--r--apps/encryption/appinfo/routes.php7
3 files changed, 28 insertions, 3 deletions
diff --git a/apps/encryption/appinfo/app.php b/apps/encryption/appinfo/app.php
index 0e8ce56227b..0c7c231aef7 100644
--- a/apps/encryption/appinfo/app.php
+++ b/apps/encryption/appinfo/app.php
@@ -23,6 +23,8 @@
namespace OCA\Encryption\AppInfo;
+\OCP\Util::addscript('encryption', 'encryption');
+
$app = new Application();
if (\OC::$server->getEncryptionManager()->isReady()) {
$app->registerEncryptionModule();
diff --git a/apps/encryption/appinfo/application.php b/apps/encryption/appinfo/application.php
index 6b67b6d95bc..dbeb1171bd8 100644
--- a/apps/encryption/appinfo/application.php
+++ b/apps/encryption/appinfo/application.php
@@ -31,6 +31,7 @@ use OCA\Encryption\HookManager;
use OCA\Encryption\Hooks\UserHooks;
use OCA\Encryption\KeyManager;
use OCA\Encryption\Recovery;
+use OCA\Encryption\Session;
use OCA\Encryption\Users\Setup;
use OCA\Encryption\Util;
use OCP\App;
@@ -74,7 +75,7 @@ class Application extends \OCP\AppFramework\App {
$container->query('UserSetup'),
$server->getUserSession(),
$container->query('Util'),
- new \OCA\Encryption\Session($server->getSession()),
+ $container->query('Session'),
$container->query('Crypt'),
$container->query('Recovery'))
]);
@@ -110,6 +111,13 @@ class Application extends \OCP\AppFramework\App {
$server->getConfig());
});
+ $container->registerService('Session',
+ function (IAppContainer $c) {
+ $server = $c->getServer();
+ return new Session($server->getSession());
+ }
+ );
+
$container->registerService('KeyManager',
function (IAppContainer $c) {
$server = $c->getServer();
@@ -139,7 +147,7 @@ class Application extends \OCP\AppFramework\App {
new \OC\Files\View());
});
- $container->registerService('RecoveryController', function (IAppContainer $c) {
+ $container->registerService('RecoveryController', function (IAppContainer $c) {
$server = $c->getServer();
return new \OCA\Encryption\Controller\RecoveryController(
$c->getAppName(),
@@ -149,6 +157,16 @@ class Application extends \OCP\AppFramework\App {
$c->query('Recovery'));
});
+ $container->registerService('StatusController', function (IAppContainer $c) {
+ $server = $c->getServer();
+ return new \OCA\Encryption\Controller\StatusController(
+ $c->getAppName(),
+ $server->getRequest(),
+ $server->getL10N($c->getAppName()),
+ $c->query('Session')
+ );
+ });
+
$container->registerService('UserSetup',
function (IAppContainer $c) {
$server = $c->getServer();
diff --git a/apps/encryption/appinfo/routes.php b/apps/encryption/appinfo/routes.php
index 0dab4a01b97..4194308a0ce 100644
--- a/apps/encryption/appinfo/routes.php
+++ b/apps/encryption/appinfo/routes.php
@@ -35,10 +35,15 @@ namespace OCA\Encryption\AppInfo;
'url' => '/ajax/changeRecoveryPassword',
'verb' => 'POST'
],
- [
+ [
'name' => 'Recovery#userSetRecovery',
'url' => '/ajax/userSetRecovery',
'verb' => 'POST'
+ ],
+ [
+ 'name' => 'Status#getStatus',
+ 'url' => '/ajax/getStatus',
+ 'verb' => 'GET'
]