fixup! Do not create Application instances directly

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2019-10-14 22:59:16 +02:00
parent 543190f8b3
commit 12c13b86d8
No known key found for this signature in database
GPG Key ID: F941078878347C0C
2 changed files with 37 additions and 45 deletions

View File

@ -1,4 +1,5 @@
<?php <?php
declare(strict_types=1);
/** /**
* @copyright Copyright (c) 2016, ownCloud, Inc. * @copyright Copyright (c) 2016, ownCloud, Inc.
* *
@ -21,43 +22,37 @@
* *
*/ */
return [
namespace OCA\Encryption\AppInfo; 'routes' => [
[
/** @var Application $app */ 'name' => 'Recovery#adminRecovery',
$app = \OC::$server->query(Application::class); 'url' => '/ajax/adminRecovery',
$app->registerRoutes($this, array('routes' => array( 'verb' => 'POST'
],
[ [
'name' => 'Recovery#adminRecovery', 'name' => 'Settings#updatePrivateKeyPassword',
'url' => '/ajax/adminRecovery', 'url' => '/ajax/updatePrivateKeyPassword',
'verb' => 'POST' 'verb' => 'POST'
], ],
[ [
'name' => 'Settings#updatePrivateKeyPassword', 'name' => 'Settings#setEncryptHomeStorage',
'url' => '/ajax/updatePrivateKeyPassword', 'url' => '/ajax/setEncryptHomeStorage',
'verb' => 'POST' 'verb' => 'POST'
], ],
[ [
'name' => 'Settings#setEncryptHomeStorage', 'name' => 'Recovery#changeRecoveryPassword',
'url' => '/ajax/setEncryptHomeStorage', 'url' => '/ajax/changeRecoveryPassword',
'verb' => 'POST' 'verb' => 'POST'
], ],
[ [
'name' => 'Recovery#changeRecoveryPassword', 'name' => 'Recovery#userSetRecovery',
'url' => '/ajax/changeRecoveryPassword', 'url' => '/ajax/userSetRecovery',
'verb' => 'POST' 'verb' => 'POST'
], ],
[ [
'name' => 'Recovery#userSetRecovery', 'name' => 'Status#getStatus',
'url' => '/ajax/userSetRecovery', 'url' => '/ajax/getStatus',
'verb' => 'POST' 'verb' => 'GET'
], ],
[
'name' => 'Status#getStatus',
'url' => '/ajax/getStatus',
'verb' => 'GET'
] ]
];
)));

View File

@ -1,4 +1,5 @@
<?php <?php
declare(strict_types=1);
/** /**
* @copyright Copyright (c) 2016, ownCloud, Inc. * @copyright Copyright (c) 2016, ownCloud, Inc.
* @copyright Copyright (c) 2016, Roeland Jago Douma <roeland@famdouma.nl> * @copyright Copyright (c) 2016, Roeland Jago Douma <roeland@famdouma.nl>
@ -22,11 +23,7 @@
* *
*/ */
namespace OCA\Files_Trashbin\AppInfo; return [
/** @var Application $application */
$application = \OC::$server->query(Application::class);
$application->registerRoutes($this, [
'routes' => [ 'routes' => [
[ [
'name' => 'Preview#getPreview', 'name' => 'Preview#getPreview',
@ -34,4 +31,4 @@ $application->registerRoutes($this, [
'verb' => 'GET', 'verb' => 'GET',
], ],
], ],
]); ];