summaryrefslogtreecommitdiffstats
path: root/apps/settings/lib
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2021-09-14 19:30:21 +0200
committerThomas Citharel <tcit@tcit.fr>2021-09-15 16:33:03 +0200
commitb3c79272609c8cd6d8245f6653b2645180635214 (patch)
tree87883a2185ac0621be1ba188735ef6b76b2a3ac5 /apps/settings/lib
parent58891a965537bc2865cf710c2c33655124b12940 (diff)
downloadnextcloud-server-b3c79272609c8cd6d8245f6653b2645180635214.tar.gz
nextcloud-server-b3c79272609c8cd6d8245f6653b2645180635214.zip
Show warning on the share settings when the File Shares app is disabled
Closes #3706 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'apps/settings/lib')
-rw-r--r--apps/settings/lib/Settings/Admin/Sharing.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/settings/lib/Settings/Admin/Sharing.php b/apps/settings/lib/Settings/Admin/Sharing.php
index 85d3e4d8d40..24be9f1426a 100644
--- a/apps/settings/lib/Settings/Admin/Sharing.php
+++ b/apps/settings/lib/Settings/Admin/Sharing.php
@@ -12,6 +12,7 @@
* @author Roeland Jago Douma <roeland@famdouma.nl>
* @author Sascha Wiswedel <sascha.wiswedel@nextcloud.com>
* @author Vincent Petry <vincent@nextcloud.com>
+ * @author Thomas Citharel <nextcloud@tcit.fr>
*
* @license GNU AGPL version 3 or any later version
*
@@ -31,7 +32,7 @@
*/
namespace OCA\Settings\Settings\Admin;
-use OC\Share\Share;
+use OCP\App\IAppManager;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\Constants;
use OCP\IConfig;
@@ -50,13 +51,14 @@ class Sharing implements ISettings {
/** @var IManager */
private $shareManager;
- /**
- * @param IConfig $config
- */
- public function __construct(IConfig $config, IL10N $l, IManager $shareManager) {
+ /** @var IAppManager */
+ private $appManager;
+
+ public function __construct(IConfig $config, IL10N $l, IManager $shareManager, IAppManager $appManager) {
$this->config = $config;
$this->l = $l;
$this->shareManager = $shareManager;
+ $this->appManager = $appManager;
}
/**
@@ -72,6 +74,7 @@ class Sharing implements ISettings {
$parameters = [
// Built-In Sharing
+ 'sharingAppEnabled' => $this->appManager->isEnabledForUser('files_sharing'),
'allowGroupSharing' => $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes'),
'allowLinks' => $this->config->getAppValue('core', 'shareapi_allow_links', 'yes'),
'allowLinksExcludeGroups' => $linksExcludeGroupsList,