aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/lib/Settings/Personal/ServerDevNotice.php13
-rw-r--r--apps/settings/tests/Controller/AdminSettingsControllerTest.php4
2 files changed, 16 insertions, 1 deletions
diff --git a/apps/settings/lib/Settings/Personal/ServerDevNotice.php b/apps/settings/lib/Settings/Personal/ServerDevNotice.php
index f69863fe35e..578211dcc00 100644
--- a/apps/settings/lib/Settings/Personal/ServerDevNotice.php
+++ b/apps/settings/lib/Settings/Personal/ServerDevNotice.php
@@ -27,8 +27,17 @@ namespace OCA\Settings\Settings\Personal;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Settings\ISettings;
+use OCP\Support\Subscription\IRegistry;
class ServerDevNotice implements ISettings {
+
+ /** @var IRegistry */
+ private $registry;
+
+ public function __construct(IRegistry $registry) {
+ $this->registry = $registry;
+ }
+
/**
* @return TemplateResponse
*/
@@ -40,6 +49,10 @@ class ServerDevNotice implements ISettings {
* @return string the section ID, e.g. 'sharing'
*/
public function getSection() {
+ if ($this->registry->delegateHasValidSubscription()) {
+ return null;
+ }
+
return 'personal-info';
}
diff --git a/apps/settings/tests/Controller/AdminSettingsControllerTest.php b/apps/settings/tests/Controller/AdminSettingsControllerTest.php
index 9a82fd97854..c20067ddfc3 100644
--- a/apps/settings/tests/Controller/AdminSettingsControllerTest.php
+++ b/apps/settings/tests/Controller/AdminSettingsControllerTest.php
@@ -37,6 +37,7 @@ use OCP\IRequest;
use OCP\IUser;
use OCP\IUserSession;
use OCP\Settings\IManager;
+use OCP\Support\Subscription\IRegistry;
use PHPUnit\Framework\MockObject\MockObject;
use Test\TestCase;
@@ -99,6 +100,7 @@ class AdminSettingsControllerTest extends TestCase {
public function testIndex() {
$user = $this->createMock(IUser::class);
+ $registry = $this->createMock(IRegistry::class);
$this->userSession
->method('getUser')
->willReturn($user);
@@ -123,7 +125,7 @@ class AdminSettingsControllerTest extends TestCase {
->expects($this->once())
->method('getAdminSettings')
->with('test')
- ->willReturn([5 => new ServerDevNotice()]);
+ ->willReturn([5 => new ServerDevNotice($registry)]);
$idx = $this->adminSettingsController->index('test');