Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2022-05-12 18:08:54 +0300
committerCarl Schwan <carl@carlschwan.eu>2022-08-01 10:46:40 +0300
commit458c2fa2971e6595a18a289b0afeb4a79ea0e0d3 (patch)
treec0bebce50e7d6956045df53f1e51dc44b0ab6c9e /apps
parent952acd4d276b3190d23e0597c5e01b1dfc4d72bc (diff)
Remove OCP\App and OCP\BackgroundJobcleanup/remove-long-deprecated-classes
Both deprecated since NC 23 IAppManager is the replacement for OCP\App unfortunately it can't be dependency injected in classes used by the installed otherwise the database connection is initialised too early Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/lib/Connector/Sabre/File.php2
-rw-r--r--apps/encryption/templates/mail.php2
-rw-r--r--apps/federatedfilesharing/lib/Controller/RequestHandlerController.php3
-rw-r--r--apps/files_trashbin/lib/Trashbin.php7
-rw-r--r--apps/provisioning_api/tests/Controller/AppsControllerTest.php2
-rw-r--r--apps/user_ldap/templates/part.settingcontrols.php2
-rw-r--r--apps/user_ldap/templates/part.wizardcontrols.php2
7 files changed, 11 insertions, 9 deletions
diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php
index ebcfdabc6b3..94632b265db 100644
--- a/apps/dav/lib/Connector/Sabre/File.php
+++ b/apps/dav/lib/Connector/Sabre/File.php
@@ -553,7 +553,7 @@ class File extends Node implements IFile {
* @return array|bool
*/
public function getDirectDownload() {
- if (\OCP\App::isEnabled('encryption')) {
+ if (\OCP\Server::get(\OCP\App\IAppManager::class)->isEnabledForUser('encryption')) {
return [];
}
/** @var \OCP\Files\Storage $storage */
diff --git a/apps/encryption/templates/mail.php b/apps/encryption/templates/mail.php
index 2cfd415b646..0db4b67d08d 100644
--- a/apps/encryption/templates/mail.php
+++ b/apps/encryption/templates/mail.php
@@ -7,7 +7,7 @@
<table cellspacing="0" cellpadding="0" border="0" width="600px">
<tr>
<td colspan="2" bgcolor="<?php p($theme->getColorPrimary());?>">
- <img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('', 'logo-mail.png'))); ?>" alt="<?php p($theme->getName()); ?>"/>
+ <img src="<?php p(\OC::$server->getURLGenerator()->getAbsoluteURL(image_path('core', 'logo-mail.png'))); ?>" alt="<?php p($theme->getName()); ?>"/>
</td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
diff --git a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
index fe0c7a11ab7..c5e1a8b4e7e 100644
--- a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
+++ b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
@@ -35,6 +35,7 @@ use OCP\AppFramework\OCS\OCSBadRequestException;
use OCP\AppFramework\OCS\OCSException;
use OCP\AppFramework\OCS\OCSForbiddenException;
use OCP\AppFramework\OCSController;
+use OCP\App\IAppManager;
use OCP\Constants;
use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\Exceptions\ProviderCouldNotAddShareException;
@@ -366,7 +367,7 @@ class RequestHandlerController extends OCSController {
* @return bool
*/
private function isS2SEnabled($incoming = false) {
- $result = \OCP\App::isEnabled('files_sharing');
+ $result = \OCP\Server::get(IAppManager::class)->isEnabledForUser('files_sharing');
if ($incoming) {
$result = $result && $this->federatedShareProvider->isIncomingServer2serverShareEnabled();
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index d449a136016..975e9fd2557 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -54,6 +54,7 @@ use OC\Files\View;
use OCA\Files_Trashbin\AppInfo\Application;
use OCA\Files_Trashbin\Command\Expire;
use OCP\AppFramework\Utility\ITimeFactory;
+use OCP\App\IAppManager;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\NotFoundException;
@@ -395,7 +396,7 @@ class Trashbin {
* @param integer $timestamp when the file was deleted
*/
private static function retainVersions($filename, $owner, $ownerPath, $timestamp) {
- if (\OCP\App::isEnabled('files_versions') && !empty($ownerPath)) {
+ if (\OCP\Server::get(IAppManager::class)->isEnabledForUser('files_versions') && !empty($ownerPath)) {
$user = OC_User::getUser();
$rootView = new View('/');
@@ -543,7 +544,7 @@ class Trashbin {
* @return false|null
*/
private static function restoreVersions(View $view, $file, $filename, $uniqueFilename, $location, $timestamp) {
- if (\OCP\App::isEnabled('files_versions')) {
+ if (\OCP\Server::get(IAppManager::class)->isEnabledForUser('files_versions')) {
$user = OC_User::getUser();
$rootView = new View('/');
@@ -704,7 +705,7 @@ class Trashbin {
*/
private static function deleteVersions(View $view, $file, $filename, $timestamp, $user) {
$size = 0;
- if (\OCP\App::isEnabled('files_versions')) {
+ if (\OCP\Server::get(IAppManager::class)->isEnabledForUser('files_versions')) {
if ($view->is_dir('files_trashbin/versions/' . $file)) {
$size += self::calculateSize(new View('/' . $user . '/files_trashbin/versions/' . $file));
$view->unlink('files_trashbin/versions/' . $file);
diff --git a/apps/provisioning_api/tests/Controller/AppsControllerTest.php b/apps/provisioning_api/tests/Controller/AppsControllerTest.php
index d4237508a31..187247b9f66 100644
--- a/apps/provisioning_api/tests/Controller/AppsControllerTest.php
+++ b/apps/provisioning_api/tests/Controller/AppsControllerTest.php
@@ -67,7 +67,7 @@ class AppsControllerTest extends \OCA\Provisioning_API\Tests\TestCase {
public function testGetAppInfo() {
$result = $this->api->getAppInfo('provisioning_api');
- $expected = \OC_App::getAppInfo('provisioning_api');
+ $expected = $this->appManager->getAppInfo('provisioning_api');
$this->assertEquals($expected, $result->getData());
}
diff --git a/apps/user_ldap/templates/part.settingcontrols.php b/apps/user_ldap/templates/part.settingcontrols.php
index a418885f47e..97f80bc13f7 100644
--- a/apps/user_ldap/templates/part.settingcontrols.php
+++ b/apps/user_ldap/templates/part.settingcontrols.php
@@ -4,7 +4,7 @@
</button>
<a href="<?php p(link_to_docs('admin-ldap')); ?>"
target="_blank" rel="noreferrer noopener">
- <img src="<?php print_unescaped(image_path('', 'actions/info.svg')); ?>"
+ <img src="<?php print_unescaped(image_path('core', 'actions/info.svg')); ?>"
style="height:1.75ex" />
<?php p($l->t('Help'));?>
</a>
diff --git a/apps/user_ldap/templates/part.wizardcontrols.php b/apps/user_ldap/templates/part.wizardcontrols.php
index bd84b23c76d..d9a6fab60e7 100644
--- a/apps/user_ldap/templates/part.wizardcontrols.php
+++ b/apps/user_ldap/templates/part.wizardcontrols.php
@@ -10,7 +10,7 @@
</button>
<a href="<?php p(link_to_docs('admin-ldap')); ?>"
target="_blank" rel="noreferrer noopener">
- <img src="<?php print_unescaped(image_path('', 'actions/info.svg')); ?>"
+ <img src="<?php print_unescaped(image_path('core', 'actions/info.svg')); ?>"
style="height:1.75ex" />
<span class="ldap_grey"><?php p($l->t('Help'));?></span>
</a>