diff --git a/lib/ACL/ACLManagerFactory.php b/lib/ACL/ACLManagerFactory.php index 7a2e571eb..cd5915d3a 100644 --- a/lib/ACL/ACLManagerFactory.php +++ b/lib/ACL/ACLManagerFactory.php @@ -9,7 +9,7 @@ namespace OCA\GroupFolders\ACL; use OCA\GroupFolders\Trash\TrashManager; -use OCP\IConfig; +use OCP\IAppConfig; use OCP\IUser; use Psr\Log\LoggerInterface; @@ -17,7 +17,7 @@ class ACLManagerFactory { public function __construct( private RuleManager $ruleManager, private TrashManager $trashManager, - private IConfig $config, + private IAppConfig $config, private LoggerInterface $logger, private \Closure $rootFolderProvider, ) { @@ -31,7 +31,7 @@ public function getACLManager(IUser $user, ?int $rootStorageId = null): ACLManag $user, $this->rootFolderProvider, $rootStorageId, - $this->config->getAppValue('groupfolders', 'acl-inherit-per-user', 'false') === 'true', + $this->config->getValueString('groupfolders', 'acl-inherit-per-user', 'false') === 'true', ); } } diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 929d955a3..26724ebdf 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -51,7 +51,6 @@ use OCP\Files\NotFoundException; use OCP\IAppConfig; use OCP\ICacheFactory; -use OCP\IConfig; use OCP\IDBConnection; use OCP\IGroup; use OCP\IRequest; @@ -105,9 +104,10 @@ public function register(IRegistrationContext $context): void { $rootProvider = function () use ($c): Folder { return $c->get('GroupAppFolder'); }; - $config = $c->get(IConfig::class); - $allowRootShare = $config->getAppValue('groupfolders', 'allow_root_share', 'true') === 'true'; - $enableEncryption = $config->getAppValue('groupfolders', 'enable_encryption', 'false') === 'true'; + /** @var IAppConfig $config */ + $config = $c->get(IAppConfig::class); + $allowRootShare = $config->getValueString('groupfolders', 'allow_root_share', 'true') === 'true'; + $enableEncryption = $config->getValueString('groupfolders', 'enable_encryption', 'false') === 'true'; return new MountProvider( $c->get(FolderManager::class), @@ -208,7 +208,7 @@ public function register(IRegistrationContext $context): void { return new ExpireGroupTrashJob( $c->get(TrashBackend::class), $c->get(Expiration::class), - $c->get(IConfig::class), + $c->get(IAppConfig::class), $c->get(ITimeFactory::class) ); } @@ -224,7 +224,7 @@ public function register(IRegistrationContext $context): void { return new ACLManagerFactory( $c->get(RuleManager::class), $c->get(TrashManager::class), - $c->get(IConfig::class), + $c->get(IAppConfig::class), $c->get(LoggerInterface::class), $rootFolderProvider ); diff --git a/lib/BackgroundJob/ExpireGroupTrash.php b/lib/BackgroundJob/ExpireGroupTrash.php index 4e538b31c..f42b06e2b 100644 --- a/lib/BackgroundJob/ExpireGroupTrash.php +++ b/lib/BackgroundJob/ExpireGroupTrash.php @@ -12,13 +12,13 @@ use OCA\GroupFolders\Trash\TrashBackend; use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\TimedJob; -use OCP\IConfig; +use OCP\IAppConfig; class ExpireGroupTrash extends TimedJob { public function __construct( private TrashBackend $trashBackend, private Expiration $expiration, - private IConfig $config, + private IAppConfig $config, ITimeFactory $timeFactory, ) { parent::__construct($timeFactory); @@ -27,7 +27,7 @@ public function __construct( } protected function run(mixed $argument): void { - $backgroundJob = $this->config->getAppValue('files_trashbin', 'background_job_expire_trash', 'yes'); + $backgroundJob = $this->config->getValueString('files_trashbin', 'background_job_expire_trash', 'yes'); if ($backgroundJob === 'no') { return; }