aboutsummaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/lib/Settings/Admin.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/updatenotification/lib/Settings/Admin.php')
-rw-r--r--apps/updatenotification/lib/Settings/Admin.php41
1 files changed, 12 insertions, 29 deletions
diff --git a/apps/updatenotification/lib/Settings/Admin.php b/apps/updatenotification/lib/Settings/Admin.php
index 730be5601a2..b95f3dec196 100644
--- a/apps/updatenotification/lib/Settings/Admin.php
+++ b/apps/updatenotification/lib/Settings/Admin.php
@@ -33,6 +33,7 @@ use OC\User\Backend;
use OCA\UpdateNotification\UpdateChecker;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
+use OCP\IAppConfig;
use OCP\IConfig;
use OCP\IDateTimeFormatter;
use OCP\IGroupManager;
@@ -45,40 +46,22 @@ use OCP\Util;
use Psr\Log\LoggerInterface;
class Admin implements ISettings {
- private IConfig $config;
- private UpdateChecker $updateChecker;
- private IGroupManager $groupManager;
- private IDateTimeFormatter $dateTimeFormatter;
- private IFactory $l10nFactory;
- private IRegistry $subscriptionRegistry;
- private IUserManager $userManager;
- private LoggerInterface $logger;
- private IInitialState $initialState;
-
public function __construct(
- IConfig $config,
- UpdateChecker $updateChecker,
- IGroupManager $groupManager,
- IDateTimeFormatter $dateTimeFormatter,
- IFactory $l10nFactory,
- IRegistry $subscriptionRegistry,
- IUserManager $userManager,
- LoggerInterface $logger,
- IInitialState $initialState
+ private IConfig $config,
+ private IAppConfig $appConfig,
+ private UpdateChecker $updateChecker,
+ private IGroupManager $groupManager,
+ private IDateTimeFormatter $dateTimeFormatter,
+ private IFactory $l10nFactory,
+ private IRegistry $subscriptionRegistry,
+ private IUserManager $userManager,
+ private LoggerInterface $logger,
+ private IInitialState $initialState
) {
- $this->config = $config;
- $this->updateChecker = $updateChecker;
- $this->groupManager = $groupManager;
- $this->dateTimeFormatter = $dateTimeFormatter;
- $this->l10nFactory = $l10nFactory;
- $this->subscriptionRegistry = $subscriptionRegistry;
- $this->userManager = $userManager;
- $this->logger = $logger;
- $this->initialState = $initialState;
}
public function getForm(): TemplateResponse {
- $lastUpdateCheckTimestamp = (int)$this->config->getAppValue('core', 'lastupdatedat');
+ $lastUpdateCheckTimestamp = $this->appConfig->getValueInt('core', 'lastupdatedat');
$lastUpdateCheck = $this->dateTimeFormatter->formatDateTime($lastUpdateCheckTimestamp);
$channels = [