From c62e512989e720f3ffc02cf5d17801438bb95bdc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 9 Aug 2016 14:05:02 +0200 Subject: [PATCH 1/5] hide global credentials in personal when a user cant add mounts --- apps/files_external/css/settings.css | 5 ++++ apps/files_external/templates/settings.php | 35 ++++++++++++---------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css index 4d5dc69a4e789..d09ab3ed427be 100644 --- a/apps/files_external/css/settings.css +++ b/apps/files_external/css/settings.css @@ -1,3 +1,8 @@ +#files_external { + margin-bottom: 0; + padding-bottom: 0; +} + #externalStorage td.status { /* overwrite conflicting core styles */ display: table-cell; diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 6fb2a0185479e..640604c14c580 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -84,24 +84,9 @@ function writeParameterInput($parameter, $options, $classes = []) { } } ?> -
-

t('External Storage')); ?>

-

t('Global Credentials')); ?>

- - - - -
+

t('External Storage')); ?>

'')) print_unescaped(''.$_['dependencies'].''); ?> '> @@ -200,3 +185,21 @@ function writeParameterInput($parameter, $options, $classes = []) {

+ + + +

t('Global Credentials')); ?>

+ + + + + + From ff89354588252340cd76a0b135e30fcb4fab7b30 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 9 Aug 2016 14:09:53 +0200 Subject: [PATCH 2/5] don't show dependency info if we cant create new mounts --- apps/files_external/css/settings.css | 5 ++--- apps/files_external/templates/settings.php | 8 +++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css index d09ab3ed427be..43bbb080d7e07 100644 --- a/apps/files_external/css/settings.css +++ b/apps/files_external/css/settings.css @@ -1,6 +1,5 @@ -#files_external { - margin-bottom: 0; - padding-bottom: 0; +#global_credentials { + padding-top: 0; } #externalStorage td.status { diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php index 640604c14c580..47230f98bd36a 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"); @@ -87,7 +89,7 @@ function writeParameterInput($parameter, $options, $classes = []) {

t('External Storage')); ?>

- '')) print_unescaped(''.$_['dependencies'].''); ?> + '') and $canCreateMounts) print_unescaped(''.$_['dependencies'].''); ?>
'> @@ -103,7 +105,7 @@ function writeParameterInput($parameter, $options, $classes = []) { + style="display: none;" > @@ -186,7 +188,7 @@ function writeParameterInput($parameter, $options, $classes = []) { - +

t('Global Credentials')); ?>

From 644770c950c73bf23b818a9e7ba71d3a739aad0b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 9 Aug 2016 14:19:15 +0200 Subject: [PATCH 3/5] hide files external in personal settings if it's empty --- apps/files_external/js/settings.js | 5 +++++ apps/files_external/templates/settings.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js index fc6edefc64808..da3e2397b7ea9 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/templates/settings.php b/apps/files_external/templates/settings.php index 47230f98bd36a..2581259c4caab 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -87,7 +87,7 @@ function writeParameterInput($parameter, $options, $classes = []) { } ?> - +

t('External Storage')); ?>

'') and $canCreateMounts) print_unescaped(''.$_['dependencies'].''); ?>
'> From 27796a4077065f9b75fc8331c87f399fadc2c851 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 10 Aug 2016 01:01:39 +0200 Subject: [PATCH 4/5] layout refinements --- apps/files_external/css/settings.css | 11 ++++++++++- apps/files_external/lib/config.php | 12 ++++++------ apps/files_external/templates/settings.php | 2 -- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css index 43bbb080d7e07..38e497eebe69c 100644 --- a/apps/files_external/css/settings.css +++ b/apps/files_external/css/settings.css @@ -1,5 +1,14 @@ #global_credentials { - padding-top: 0; + padding: 0 30px; + margin-bottom: 0px; +} + +#files_external { + margin-bottom: 0px; +} + +#externalStorage { + margin: 15px 0 20px 0; } #externalStorage td.status { diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index cd3b4d9f3cb43..7a10d4bbc242a 100644 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -285,7 +285,7 @@ public static function dependencyMessage($backends) { 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 @@ public static function dependencyMessage($backends) { 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 @@ public static function dependencyMessage($backends) { 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 2581259c4caab..636877e1fa07e 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -160,10 +160,8 @@ function writeParameterInput($parameter, $options, $classes = []) {
-
-
/> From 9a7193ce83da60f15b0244266913c5fe534cc403 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Wed, 10 Aug 2016 01:04:35 +0200 Subject: [PATCH 5/5] Fix casing of external storage app --- apps/files_external/appinfo/info.xml | 4 ++-- apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php | 2 +- apps/files_external/templates/settings.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/files_external/appinfo/info.xml b/apps/files_external/appinfo/info.xml index 6013175988026..f99ef3b6c49e1 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/lib/Lib/Auth/Password/GlobalAuth.php b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php index 502024be4f201..c0ece745aa4bf 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 @@ public function __construct(IL10N $l, ICredentialsManager $credentialsManager) { ->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/templates/settings.php b/apps/files_external/templates/settings.php index 636877e1fa07e..53d2412425c22 100644 --- a/apps/files_external/templates/settings.php +++ b/apps/files_external/templates/settings.php @@ -88,7 +88,7 @@ function writeParameterInput($parameter, $options, $classes = []) { ?> -

t('External Storage')); ?>

+

t('External storage')); ?>

'') and $canCreateMounts) print_unescaped(''.$_['dependencies'].''); ?> '> @@ -189,7 +189,7 @@ function writeParameterInput($parameter, $options, $classes = []) { -

t('Global Credentials')); ?>

+

t('Global credentials')); ?>