diff --git a/apps/files_external/appinfo/info.xml b/apps/files_external/appinfo/info.xml index ba12d1ff67..39b669fcc9 100644 --- a/apps/files_external/appinfo/info.xml +++ b/apps/files_external/appinfo/info.xml @@ -3,9 +3,9 @@ files_external External storage support - This application enables administrators to configure connections to external storage providers, such as FTP servers, S3 or SWIFT object stores, Google Drive, Dropbox, other ownCloud servers, WebDAV servers, and more. Administrators can choose which types of storage to enable and can mount these storage locations for a user, a group, or the entire system. Users will see a new folder appear in their root ownCloud directory, which they can access and use like any other ownCloud folder. External Storage also allows users to share files stored in these external locations. In these cases, the credentials for the owner of the file are used when the recipient requests the file from external storage, thereby ensuring that the recipient can access the shared file. + This application enables administrators to configure connections to external storage providers, such as FTP servers, S3 or SWIFT object stores, Google Drive, Dropbox, other ownCloud servers, WebDAV servers, and more. Administrators can choose which types of storage to enable and can mount these storage locations for a user, a group, or the entire system. Users will see a new folder appear in their root ownCloud directory, which they can access and use like any other ownCloud folder. External storage also allows users to share files stored in these external locations. In these cases, the credentials for the owner of the file are used when the recipient requests the file from external storage, thereby ensuring that the recipient can access the shared file. - External Storage can be configured using the GUI or at the command line. This second option provides the advanced user with more flexibility for configuring bulk external storage mounts and setting mount priorities. More information is available in the External Storage GUI documentation and the External Storage Configuration File documentation. + External storage can be configured using the GUI or at the command line. This second option provides the advanced user with more flexibility for configuring bulk external storage mounts and setting mount priorities. More information is available in the external storage GUI documentation and the external storage Configuration File documentation. AGPL Robin Appelman, Michael Gapczynski, Vincent Petry diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css index 4d5dc69a4e..38e497eebe 100644 --- a/apps/files_external/css/settings.css +++ b/apps/files_external/css/settings.css @@ -1,3 +1,16 @@ +#global_credentials { + padding: 0 30px; + margin-bottom: 0px; +} + +#files_external { + margin-bottom: 0px; +} + +#externalStorage { + margin: 15px 0 20px 0; +} + #externalStorage td.status { /* overwrite conflicting core styles */ display: table-cell; diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index fc6edefc64..da3e2397b7 100644 --- a/apps/files_external/js/settings.js +++ b/apps/files_external/js/settings.js @@ -945,6 +945,11 @@ MountConfigListView.prototype = _.extend({ $tr.find('.configuration').text(t('files_external', 'Admin defined')); } }); + var mainForm = $('#files_external'); + if (result.length === 0 && mainForm.attr('data-can-create') === 'false') { + mainForm.hide(); + $('a[href="#external-storage"]').parent().hide(); + } onCompletion.resolve(); } }); diff --git a/apps/files_external/lib/AppInfo/Application.php b/apps/files_external/lib/AppInfo/Application.php index 06c163419f..fcf10adb37 100644 --- a/apps/files_external/lib/AppInfo/Application.php +++ b/apps/files_external/lib/AppInfo/Application.php @@ -68,7 +68,18 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide * Register settings templates */ public function registerSettings() { - \OCP\App::registerPersonal('files_external', 'personal'); + $container = $this->getContainer(); + $userSession = $container->getServer()->getUserSession(); + if (!$userSession->isLoggedIn()) { + return; + } + $backendService = $container->query('OCA\\Files_External\\Service\\BackendService'); + + /** @var \OCA\Files_External\Service\UserGlobalStoragesService $userGlobalStoragesService */ + $userGlobalStoragesService = $container->query('OCA\Files_External\Service\UserGlobalStoragesService'); + if (count($userGlobalStoragesService->getStorages()) > 0 || $backendService->isUserMountingAllowed()) { + \OCP\App::registerPersonal('files_external', 'personal'); + } } /** diff --git a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php index 502024be4f..c0ece745aa 100644 --- a/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php +++ b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php @@ -48,7 +48,7 @@ class GlobalAuth extends AuthMechanism { ->setIdentifier('password::global') ->setVisibility(BackendService::VISIBILITY_DEFAULT) ->setScheme(self::SCHEME_PASSWORD) - ->setText($l->t('Global Credentials')); + ->setText($l->t('Global credentials')); } public function getAuth($uid) { diff --git a/apps/files_external/lib/Lib/Backend/OwnCloud.php b/apps/files_external/lib/Lib/Backend/OwnCloud.php index 59d1b2cec5..1304b09c87 100644 --- a/apps/files_external/lib/Lib/Backend/OwnCloud.php +++ b/apps/files_external/lib/Lib/Backend/OwnCloud.php @@ -37,7 +37,7 @@ class OwnCloud extends Backend { ->setIdentifier('owncloud') ->addIdentifierAlias('\OC\Files\Storage\OwnCloud') // legacy compat ->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud') - ->setText($l->t('ownCloud')) + ->setText($l->t('Nextcloud')) ->addParameters([ (new DefinitionParameter('host', $l->t('URL'))), (new DefinitionParameter('root', $l->t('Remote subfolder'))) diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index cd3b4d9f3c..7a10d4bbc2 100644 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -285,7 +285,7 @@ class OC_Mount_Config { foreach ($backends as $backend) { foreach ($backend->checkDependencies() as $dependency) { if ($message = $dependency->getMessage()) { - $message .= '
' . $l->t('Note: ') . $message; + $message .= '

' . $message . '

'; } else { $dependencyGroups[$dependency->getDependency()][] = $backend; } @@ -294,9 +294,9 @@ class OC_Mount_Config { foreach ($dependencyGroups as $module => $dependants) { $backends = implode(', ', array_map(function($backend) { - return '' . $backend->getText() . ''; + return '"' . $backend->getText() . '"'; }, $dependants)); - $message .= '
' . OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends); + $message .= '

' . OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends) . '

'; } return $message; @@ -313,11 +313,11 @@ class OC_Mount_Config { private static function getSingleDependencyMessage(\OCP\IL10N $l, $module, $backend) { switch (strtolower($module)) { case 'curl': - return (string)$l->t('Note: The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', $backend); + return (string)$l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', $backend); case 'ftp': - return (string)$l->t('Note: The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', $backend); + return (string)$l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', $backend); default: - return (string)$l->t('Note: "%s" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it.', array($module, $backend)); + return (string)$l->t('"%s" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it.', array($module, $backend)); } } diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 6fb2a01854..53d2412425 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -4,6 +4,8 @@ use \OCA\Files_External\Lib\DefinitionParameter; use \OCA\Files_External\Service\BackendService; + $canCreateMounts = $_['visibilityType'] === BackendService::VISIBILITY_ADMIN || $_['allowUserMounting']; + $l->t("Enable encryption"); $l->t("Enable previews"); $l->t("Enable sharing"); @@ -84,25 +86,10 @@ } } ?> -
-

t('External Storage')); ?>

-

t('Global Credentials')); ?>

- - - - -
-
- '')) print_unescaped(''.$_['dependencies'].''); ?> + +

t('External storage')); ?>

+ '') and $canCreateMounts) print_unescaped(''.$_['dependencies'].''); ?> '> @@ -118,7 +105,7 @@ + style="display: none;" > @@ -173,10 +160,8 @@
-
-
/> @@ -200,3 +185,21 @@

+ + +
+

t('Global credentials')); ?>

+ + + + +
+