Merge pull request #902 from nextcloud/stable10-787
[stable10] Files external settings polish
This commit is contained in:
commit
25ed51743a
|
@ -3,9 +3,9 @@
|
||||||
<id>files_external</id>
|
<id>files_external</id>
|
||||||
<name>External storage support</name>
|
<name>External storage support</name>
|
||||||
<description>
|
<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>
|
</description>
|
||||||
<licence>AGPL</licence>
|
<licence>AGPL</licence>
|
||||||
<author>Robin Appelman, Michael Gapczynski, Vincent Petry</author>
|
<author>Robin Appelman, Michael Gapczynski, Vincent Petry</author>
|
||||||
|
|
|
@ -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 {
|
#externalStorage td.status {
|
||||||
/* overwrite conflicting core styles */
|
/* overwrite conflicting core styles */
|
||||||
display: table-cell;
|
display: table-cell;
|
||||||
|
|
|
@ -945,6 +945,11 @@ MountConfigListView.prototype = _.extend({
|
||||||
$tr.find('.configuration').text(t('files_external', 'Admin defined'));
|
$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();
|
onCompletion.resolve();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -68,7 +68,18 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide
|
||||||
* Register settings templates
|
* Register settings templates
|
||||||
*/
|
*/
|
||||||
public function registerSettings() {
|
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');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -48,7 +48,7 @@ class GlobalAuth extends AuthMechanism {
|
||||||
->setIdentifier('password::global')
|
->setIdentifier('password::global')
|
||||||
->setVisibility(BackendService::VISIBILITY_DEFAULT)
|
->setVisibility(BackendService::VISIBILITY_DEFAULT)
|
||||||
->setScheme(self::SCHEME_PASSWORD)
|
->setScheme(self::SCHEME_PASSWORD)
|
||||||
->setText($l->t('Global Credentials'));
|
->setText($l->t('Global credentials'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAuth($uid) {
|
public function getAuth($uid) {
|
||||||
|
|
|
@ -37,7 +37,7 @@ class OwnCloud extends Backend {
|
||||||
->setIdentifier('owncloud')
|
->setIdentifier('owncloud')
|
||||||
->addIdentifierAlias('\OC\Files\Storage\OwnCloud') // legacy compat
|
->addIdentifierAlias('\OC\Files\Storage\OwnCloud') // legacy compat
|
||||||
->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
|
->setStorageClass('\OCA\Files_External\Lib\Storage\OwnCloud')
|
||||||
->setText($l->t('ownCloud'))
|
->setText($l->t('Nextcloud'))
|
||||||
->addParameters([
|
->addParameters([
|
||||||
(new DefinitionParameter('host', $l->t('URL'))),
|
(new DefinitionParameter('host', $l->t('URL'))),
|
||||||
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
(new DefinitionParameter('root', $l->t('Remote subfolder')))
|
||||||
|
|
|
@ -285,7 +285,7 @@ class OC_Mount_Config {
|
||||||
foreach ($backends as $backend) {
|
foreach ($backends as $backend) {
|
||||||
foreach ($backend->checkDependencies() as $dependency) {
|
foreach ($backend->checkDependencies() as $dependency) {
|
||||||
if ($message = $dependency->getMessage()) {
|
if ($message = $dependency->getMessage()) {
|
||||||
$message .= '<br />' . $l->t('<b>Note:</b> ') . $message;
|
$message .= '<p>' . $message . '</p>';
|
||||||
} else {
|
} else {
|
||||||
$dependencyGroups[$dependency->getDependency()][] = $backend;
|
$dependencyGroups[$dependency->getDependency()][] = $backend;
|
||||||
}
|
}
|
||||||
|
@ -294,9 +294,9 @@ class OC_Mount_Config {
|
||||||
|
|
||||||
foreach ($dependencyGroups as $module => $dependants) {
|
foreach ($dependencyGroups as $module => $dependants) {
|
||||||
$backends = implode(', ', array_map(function($backend) {
|
$backends = implode(', ', array_map(function($backend) {
|
||||||
return '<i>' . $backend->getText() . '</i>';
|
return '"' . $backend->getText() . '"';
|
||||||
}, $dependants));
|
}, $dependants));
|
||||||
$message .= '<br />' . OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends);
|
$message .= '<p>' . OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends) . '</p>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $message;
|
return $message;
|
||||||
|
@ -313,11 +313,11 @@ class OC_Mount_Config {
|
||||||
private static function getSingleDependencyMessage(\OCP\IL10N $l, $module, $backend) {
|
private static function getSingleDependencyMessage(\OCP\IL10N $l, $module, $backend) {
|
||||||
switch (strtolower($module)) {
|
switch (strtolower($module)) {
|
||||||
case 'curl':
|
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':
|
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:
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
use \OCA\Files_External\Lib\DefinitionParameter;
|
use \OCA\Files_External\Lib\DefinitionParameter;
|
||||||
use \OCA\Files_External\Service\BackendService;
|
use \OCA\Files_External\Service\BackendService;
|
||||||
|
|
||||||
|
$canCreateMounts = $_['visibilityType'] === BackendService::VISIBILITY_ADMIN || $_['allowUserMounting'];
|
||||||
|
|
||||||
$l->t("Enable encryption");
|
$l->t("Enable encryption");
|
||||||
$l->t("Enable previews");
|
$l->t("Enable previews");
|
||||||
$l->t("Enable sharing");
|
$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'; ?>">
|
<form data-can-create="<?php echo $canCreateMounts?'true':'false' ?>" id="files_external" class="section" data-encryption-enabled="<?php echo $_['encryptionEnabled']?'true': 'false'; ?>">
|
||||||
<?php if (isset($_['dependencies']) and ($_['dependencies']<>'')) print_unescaped(''.$_['dependencies'].''); ?>
|
<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)); ?>'>
|
<table id="externalStorage" class="grid" data-admin='<?php print_unescaped(json_encode($_['visibilityType'] === BackendService::VISIBILITY_ADMIN)); ?>'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -118,7 +105,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr id="addMountPoint"
|
<tr id="addMountPoint"
|
||||||
<?php if ($_['visibilityType'] === BackendService::VISIBILITY_PERSONAL && $_['allowUserMounting'] === false): ?>
|
<?php if (!$canCreateMounts): ?>
|
||||||
style="display: none;"
|
style="display: none;"
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
>
|
>
|
||||||
|
@ -173,10 +160,8 @@
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<br />
|
|
||||||
|
|
||||||
<?php if ($_['visibilityType'] === BackendService::VISIBILITY_ADMIN): ?>
|
<?php if ($_['visibilityType'] === BackendService::VISIBILITY_ADMIN): ?>
|
||||||
<br />
|
|
||||||
<input type="checkbox" name="allowUserMounting" id="allowUserMounting" class="checkbox"
|
<input type="checkbox" name="allowUserMounting" id="allowUserMounting" class="checkbox"
|
||||||
value="1" <?php if ($_['allowUserMounting'] == 'yes') print_unescaped(' checked="checked"'); ?> />
|
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>
|
<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>
|
</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</form>
|
</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; ?>
|
||||||
|
|
Loading…
Reference in New Issue