aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMarius Blüm <marius@lineone.io>2016-08-17 12:32:33 +0200
committerGitHub <noreply@github.com>2016-08-17 12:32:33 +0200
commitbaaf1521ce582102dcdb19b9692a95530ef9d1da (patch)
treec9867a6b3b2d90e5c3bca03aad79883f19168553 /apps
parente32d6d80a17ecd7367f40c0b31a2ff90c09dd794 (diff)
parent9a7193ce83da60f15b0244266913c5fe534cc403 (diff)
downloadnextcloud-server-baaf1521ce582102dcdb19b9692a95530ef9d1da.tar.gz
nextcloud-server-baaf1521ce582102dcdb19b9692a95530ef9d1da.zip
Merge pull request #787 from nextcloud/files_external-settings-polish
Files external settings polish
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/appinfo/info.xml4
-rw-r--r--apps/files_external/css/settings.css13
-rw-r--r--apps/files_external/js/settings.js5
-rw-r--r--apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php2
-rw-r--r--apps/files_external/lib/config.php12
-rw-r--r--apps/files_external/templates/settings.php45
6 files changed, 51 insertions, 30 deletions
diff --git a/apps/files_external/appinfo/info.xml b/apps/files_external/appinfo/info.xml
index 60131759880..f99ef3b6c49 100644
--- a/apps/files_external/appinfo/info.xml
+++ b/apps/files_external/appinfo/info.xml
@@ -3,9 +3,9 @@
<id>files_external</id>
<name>External storage support</name>
<description>
- 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.
</description>
<licence>AGPL</licence>
<author>Robin Appelman, Michael Gapczynski, Vincent Petry</author>
diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css
index 4d5dc69a4e7..38e497eebe6 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 fc6edefc648..da3e2397b7e 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/Lib/Auth/Password/GlobalAuth.php b/apps/files_external/lib/Lib/Auth/Password/GlobalAuth.php
index 502024be4f2..c0ece745aa4 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/config.php b/apps/files_external/lib/config.php
index cd3b4d9f3cb..7a10d4bbc24 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 .= '<br />' . $l->t('<b>Note:</b> ') . $message;
+ $message .= '<p>' . $message . '</p>';
} 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 '<i>' . $backend->getText() . '</i>';
+ return '"' . $backend->getText() . '"';
}, $dependants));
- $message .= '<br />' . OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends);
+ $message .= '<p>' . OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends) . '</p>';
}
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('<b>Note:</b> 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('<b>Note:</b> 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('<b>Note:</b> "%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 6fb2a018547..53d2412425c 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 @@
}
}
?>
-<form autocomplete="false" class="section" action="#"
- id="global_credentials">
- <h2><?php p($l->t('External Storage')); ?></h2>
- <p><?php p($l->t('Global Credentials')); ?></p>
- <input type="text" name="username"
- autocomplete="false"
- value="<?php p($_['globalCredentials']['user']); ?>"
- placeholder="<?php p($l->t('Username')) ?>"/>
- <input type="password" name="password"
- autocomplete="false"
- value="<?php p($_['globalCredentials']['password']); ?>"
- placeholder="<?php p($l->t('Password')) ?>"/>
- <input type="hidden" name="uid"
- value="<?php p($_['globalCredentialsUid']); ?>"/>
- <input type="submit" value="<?php p($l->t('Save')) ?>"/>
-</form>
-<form id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>">
- <?php if (isset($_['dependencies']) and ($_['dependencies']<>'')) print_unescaped(''.$_['dependencies'].''); ?>
+<form data-can-create="<?php echo $canCreateMounts?'true':'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>">
+ <h2><?php p($l->t('External storage')); ?></h2>
+ <?php if (isset($_['dependencies']) and ($_['dependencies']<>'') and $canCreateMounts) print_unescaped(''.$_['dependencies'].''); ?>
<table id="externalStorage" class="grid" data-admin='<?php print_unescaped(json_encode($_['visibilityType'] === BackendService::VISIBILITY_ADMIN)); ?>'>
<thead>
<tr>
@@ -118,7 +105,7 @@
</thead>
<tbody>
<tr id="addMountPoint"
- <?php if ($_['visibilityType'] === BackendService::VISIBILITY_PERSONAL && $_['allowUserMounting'] === false): ?>
+ <?php if (!$canCreateMounts): ?>
style="display: none;"
<?php endif; ?>
>
@@ -173,10 +160,8 @@
</tr>
</tbody>
</table>
- <br />
<?php if ($_['visibilityType'] === BackendService::VISIBILITY_ADMIN): ?>
- <br />
<input type="checkbox" name="allowUserMounting" id="allowUserMounting" class="checkbox"
value="1" <?php if ($_['allowUserMounting'] == 'yes') print_unescaped(' checked="checked"'); ?> />
<label for="allowUserMounting"><?php p($l->t('Allow users to mount external storage')); ?></label> <span id="userMountingMsg" class="msg"></span>
@@ -200,3 +185,21 @@
</p>
<?php endif; ?>
</form>
+
+<?php if ($canCreateMounts): ?>
+ <form autocomplete="false" class="section" action="#"
+ id="global_credentials">
+ <p><?php p($l->t('Global credentials')); ?></p>
+ <input type="text" name="username"
+ autocomplete="false"
+ value="<?php p($_['globalCredentials']['user']); ?>"
+ placeholder="<?php p($l->t('Username')) ?>"/>
+ <input type="password" name="password"
+ autocomplete="false"
+ value="<?php p($_['globalCredentials']['password']); ?>"
+ placeholder="<?php p($l->t('Password')) ?>"/>
+ <input type="hidden" name="uid"
+ value="<?php p($_['globalCredentialsUid']); ?>"/>
+ <input type="submit" value="<?php p($l->t('Save')) ?>"/>
+ </form>
+<?php endif; ?>