aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/3rdparty/smb4php/smb.php94
-rw-r--r--apps/files_external/appinfo/app.php6
-rw-r--r--apps/files_external/css/settings.css7
-rw-r--r--apps/files_external/js/settings.js31
-rw-r--r--apps/files_external/l10n/ar.php1
-rw-r--r--apps/files_external/l10n/bg_BG.php1
-rw-r--r--apps/files_external/l10n/bn_BD.php1
-rw-r--r--apps/files_external/l10n/ca.php3
-rw-r--r--apps/files_external/l10n/cs_CZ.php3
-rw-r--r--apps/files_external/l10n/da.php3
-rw-r--r--apps/files_external/l10n/de.php3
-rw-r--r--apps/files_external/l10n/de_AT.php5
-rw-r--r--apps/files_external/l10n/de_CH.php1
-rw-r--r--apps/files_external/l10n/de_DE.php3
-rw-r--r--apps/files_external/l10n/el.php2
-rw-r--r--apps/files_external/l10n/en_GB.php3
-rw-r--r--apps/files_external/l10n/eo.php1
-rw-r--r--apps/files_external/l10n/es.php3
-rw-r--r--apps/files_external/l10n/es_AR.php1
-rw-r--r--apps/files_external/l10n/es_MX.php1
-rw-r--r--apps/files_external/l10n/et_EE.php1
-rw-r--r--apps/files_external/l10n/eu.php1
-rw-r--r--apps/files_external/l10n/eu_ES.php5
-rw-r--r--apps/files_external/l10n/fa.php1
-rw-r--r--apps/files_external/l10n/fi_FI.php3
-rw-r--r--apps/files_external/l10n/fr.php3
-rw-r--r--apps/files_external/l10n/gl.php3
-rw-r--r--apps/files_external/l10n/he.php1
-rw-r--r--apps/files_external/l10n/hu_HU.php1
-rw-r--r--apps/files_external/l10n/id.php1
-rw-r--r--apps/files_external/l10n/is.php1
-rw-r--r--apps/files_external/l10n/it.php3
-rw-r--r--apps/files_external/l10n/ja.php29
-rw-r--r--apps/files_external/l10n/ja_JP.php19
-rw-r--r--apps/files_external/l10n/ka_GE.php1
-rw-r--r--apps/files_external/l10n/km.php3
-rw-r--r--apps/files_external/l10n/ko.php1
-rw-r--r--apps/files_external/l10n/lt_LT.php1
-rw-r--r--apps/files_external/l10n/lv.php1
-rw-r--r--apps/files_external/l10n/mk.php1
-rw-r--r--apps/files_external/l10n/nb_NO.php1
-rw-r--r--apps/files_external/l10n/nl.php3
-rw-r--r--apps/files_external/l10n/pl.php3
-rw-r--r--apps/files_external/l10n/pt_BR.php3
-rw-r--r--apps/files_external/l10n/pt_PT.php3
-rw-r--r--apps/files_external/l10n/ro.php3
-rw-r--r--apps/files_external/l10n/ru.php3
-rw-r--r--apps/files_external/l10n/si_LK.php1
-rw-r--r--apps/files_external/l10n/sk_SK.php1
-rw-r--r--apps/files_external/l10n/sl.php3
-rw-r--r--apps/files_external/l10n/sv.php1
-rw-r--r--apps/files_external/l10n/ta_LK.php1
-rw-r--r--apps/files_external/l10n/th_TH.php1
-rw-r--r--apps/files_external/l10n/tr.php3
-rw-r--r--apps/files_external/l10n/uk.php1
-rw-r--r--apps/files_external/l10n/vi.php1
-rw-r--r--apps/files_external/l10n/zh_CN.php1
-rw-r--r--apps/files_external/l10n/zh_TW.php1
-rwxr-xr-xapps/files_external/lib/config.php339
-rw-r--r--apps/files_external/lib/smb.php2
-rw-r--r--apps/files_external/lib/smb_oc.php93
-rw-r--r--apps/files_external/lib/swift.php6
-rw-r--r--apps/files_external/lib/webdav.php193
-rwxr-xr-xapps/files_external/personal.php5
-rw-r--r--apps/files_external/settings.php18
-rw-r--r--apps/files_external/templates/settings.php55
-rw-r--r--apps/files_external/tests/mountconfig.php601
67 files changed, 1292 insertions, 307 deletions
diff --git a/apps/files_external/3rdparty/smb4php/smb.php b/apps/files_external/3rdparty/smb4php/smb.php
index 622942b052a..e325506fa14 100644
--- a/apps/files_external/3rdparty/smb4php/smb.php
+++ b/apps/files_external/3rdparty/smb4php/smb.php
@@ -8,6 +8,8 @@
# Homepage: http://www.phpclasses.org/smb4php
#
# Copyright (c) 2007 Victor M. Varela <vmvarela@gmail.com>
+# Copyright (c) 2012 Frank Karlitschek <frank@owncloud.org>
+# Copyright (c) 2014 Robin McCorkell <rmccorkell@karoshi.org.uk>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -19,7 +21,6 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
-# Addition 17/12/2012 Frank Karlitschek (frank@owncloud.org)
# On the official website http://www.phpclasses.org/smb4php the
# license is listed as LGPL so we assume that this is
# dual-licensed GPL/LGPL
@@ -43,6 +44,42 @@ $GLOBALS['__smb_cache'] = array ('stat' => array (), 'dir' => array ());
class smb {
+ private static $regexp = array (
+ '^added interface ip=(.*) bcast=(.*) nmask=(.*)$' => 'skip',
+ 'Anonymous login successful' => 'skip',
+ '^Domain=\[(.*)\] OS=\[(.*)\] Server=\[(.*)\]$' => 'skip',
+ '^\tSharename[ ]+Type[ ]+Comment$' => 'shares',
+ '^\t---------[ ]+----[ ]+-------$' => 'skip',
+ '^\tServer [ ]+Comment$' => 'servers',
+ '^\t---------[ ]+-------$' => 'skip',
+ '^\tWorkgroup[ ]+Master$' => 'workg',
+ '^\t(.*)[ ]+(Disk|IPC)[ ]+IPC.*$' => 'skip',
+ '^\tIPC\\\$(.*)[ ]+IPC' => 'skip',
+ '^\t(.*)[ ]+(Disk)[ ]+(.*)$' => 'share',
+ '^\t(.*)[ ]+(Printer)[ ]+(.*)$' => 'skip',
+ '([0-9]+) blocks of size ([0-9]+)\. ([0-9]+) blocks available' => 'skip',
+ 'Got a positive name query response from ' => 'skip',
+ '^(session setup failed): (.*)$' => 'error',
+ '^(.*): ERRSRV - ERRbadpw' => 'error',
+ '^Error returning browse list: (.*)$' => 'error',
+ '^tree connect failed: (.*)$' => 'error',
+ '^(Connection to .* failed)(.*)$' => 'error-connect',
+ '^NT_STATUS_(.*) ' => 'error',
+ '^NT_STATUS_(.*)\$' => 'error',
+ 'ERRDOS - ERRbadpath \((.*).\)' => 'error',
+ 'cd (.*): (.*)$' => 'error',
+ '^cd (.*): NT_STATUS_(.*)' => 'error',
+ '^\t(.*)$' => 'srvorwg',
+ '^([0-9]+)[ ]+([0-9]+)[ ]+(.*)$' => 'skip',
+ '^Job ([0-9]+) cancelled' => 'skip',
+ '^[ ]+(.*)[ ]+([0-9]+)[ ]+(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[ ](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[ ]+([0-9]+)[ ]+([0-9]{2}:[0-9]{2}:[0-9]{2})[ ]([0-9]{4})$' => 'files',
+ '^message start: ERRSRV - (ERRmsgoff)' => 'error'
+ );
+
+ function getRegexp() {
+ return self::$regexp;
+ }
+
function parse_url ($url) {
$pu = parse_url (trim($url));
foreach (array ('domain', 'user', 'pass', 'host', 'port', 'path') as $i) {
@@ -74,46 +111,16 @@ class smb {
}
- function execute ($command, $purl) {
+ function execute ($command, $purl, $regexp = NULL) {
return smb::client ('-d 0 '
. escapeshellarg ('//' . $purl['host'] . '/' . $purl['share'])
- . ' -c ' . escapeshellarg ($command), $purl
+ . ' -c ' . escapeshellarg ($command), $purl, $regexp
);
}
- function client ($params, $purl) {
-
- static $regexp = array (
- '^added interface ip=(.*) bcast=(.*) nmask=(.*)$' => 'skip',
- 'Anonymous login successful' => 'skip',
- '^Domain=\[(.*)\] OS=\[(.*)\] Server=\[(.*)\]$' => 'skip',
- '^\tSharename[ ]+Type[ ]+Comment$' => 'shares',
- '^\t---------[ ]+----[ ]+-------$' => 'skip',
- '^\tServer [ ]+Comment$' => 'servers',
- '^\t---------[ ]+-------$' => 'skip',
- '^\tWorkgroup[ ]+Master$' => 'workg',
- '^\t(.*)[ ]+(Disk|IPC)[ ]+IPC.*$' => 'skip',
- '^\tIPC\\\$(.*)[ ]+IPC' => 'skip',
- '^\t(.*)[ ]+(Disk)[ ]+(.*)$' => 'share',
- '^\t(.*)[ ]+(Printer)[ ]+(.*)$' => 'skip',
- '([0-9]+) blocks of size ([0-9]+)\. ([0-9]+) blocks available' => 'skip',
- 'Got a positive name query response from ' => 'skip',
- '^(session setup failed): (.*)$' => 'error',
- '^(.*): ERRSRV - ERRbadpw' => 'error',
- '^Error returning browse list: (.*)$' => 'error',
- '^tree connect failed: (.*)$' => 'error',
- '^(Connection to .* failed)(.*)$' => 'error-connect',
- '^NT_STATUS_(.*) ' => 'error',
- '^NT_STATUS_(.*)\$' => 'error',
- 'ERRDOS - ERRbadpath \((.*).\)' => 'error',
- 'cd (.*): (.*)$' => 'error',
- '^cd (.*): NT_STATUS_(.*)' => 'error',
- '^\t(.*)$' => 'srvorwg',
- '^([0-9]+)[ ]+([0-9]+)[ ]+(.*)$' => 'skip',
- '^Job ([0-9]+) cancelled' => 'skip',
- '^[ ]+(.*)[ ]+([0-9]+)[ ]+(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[ ](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[ ]+([0-9]+)[ ]+([0-9]{2}:[0-9]{2}:[0-9]{2})[ ]([0-9]{4})$' => 'files',
- '^message start: ERRSRV - (ERRmsgoff)' => 'error'
- );
+ function client ($params, $purl, $regexp = NULL) {
+
+ if ($regexp === NULL) $regexp = smb::$regexp;
if (SMB4PHP_AUTHMODE == 'env') {
putenv("USER={$purl['user']}%{$purl['pass']}");
@@ -238,17 +245,10 @@ class smb {
trigger_error ("url_stat(): list failed for host '{$pu['host']}'", E_USER_WARNING);
break;
case 'share':
- if ($o = smb::look ($pu)) {
- $found = FALSE;
- $lshare = strtolower ($pu['share']); # fix by Eric Leung
- foreach ($o['disk'] as $s) if ($lshare == strtolower($s)) {
- $found = TRUE;
- $stat = stat ("/tmp");
- break;
- }
- if (! $found)
- trigger_error ("url_stat(): disk resource '{$lshare}' not found in '{$pu['host']}'", E_USER_WARNING);
- }
+ if (smb::execute("ls", $pu))
+ $stat = stat ("/tmp");
+ else
+ trigger_error ("url_stat(): disk resource '{$pu['share']}' not found in '{$pu['host']}'", E_USER_WARNING);
break;
case 'path':
if ($o = smb::execute ('dir "'.$pu['path'].'"', $pu)) {
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php
index 5b1cd86a170..aeb7a2cb23a 100644
--- a/apps/files_external/appinfo/app.php
+++ b/apps/files_external/appinfo/app.php
@@ -1,6 +1,7 @@
<?php
/**
* Copyright (c) 2012 Robin Appelman <icewind@owncloud.com>
+ * Copyright (c) 2014 Robin McCorkell <rmccorkell@karoshi.org.uk>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
@@ -13,6 +14,7 @@ OC::$CLASSPATH['OC\Files\Storage\OwnCloud'] = 'files_external/lib/owncloud.php';
OC::$CLASSPATH['OC\Files\Storage\Google'] = 'files_external/lib/google.php';
OC::$CLASSPATH['OC\Files\Storage\Swift'] = 'files_external/lib/swift.php';
OC::$CLASSPATH['OC\Files\Storage\SMB'] = 'files_external/lib/smb.php';
+OC::$CLASSPATH['OC\Files\Storage\SMB_OC'] = 'files_external/lib/smb_oc.php';
OC::$CLASSPATH['OC\Files\Storage\AmazonS3'] = 'files_external/lib/amazons3.php';
OC::$CLASSPATH['OC\Files\Storage\Dropbox'] = 'files_external/lib/dropbox.php';
OC::$CLASSPATH['OC\Files\Storage\SFTP'] = 'files_external/lib/sftp.php';
@@ -25,5 +27,7 @@ if (OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes') == '
}
// connecting hooks
-OCP\Util::connectHook( 'OC_User', 'post_login', 'OC\Files\Storage\iRODS', 'login' );
+OCP\Util::connectHook('OC_Filesystem', 'post_initMountPoints', '\OC_Mount_Config', 'initMountPointsHook');
+OCP\Util::connectHook('OC_User', 'post_login', 'OC\Files\Storage\iRODS', 'login');
+OCP\Util::connectHook('OC_User', 'post_login', 'OC\Files\Storage\SMB_OC', 'login');
diff --git a/apps/files_external/css/settings.css b/apps/files_external/css/settings.css
index 11aeb10184b..1d3489f7f57 100644
--- a/apps/files_external/css/settings.css
+++ b/apps/files_external/css/settings.css
@@ -4,13 +4,6 @@ td.status > span {
width: 16px;
vertical-align: text-bottom;
}
-span.success {
- background: #37ce02;
- border-radius: 8px;
-}
-span.error {
- background: #ce3702;
-}
td.mountPoint, td.backend { width:160px; }
td.remove>img { visibility:hidden; padding-top:13px; }
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 895f97bd2c3..00793a614c2 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -181,16 +181,21 @@ $(document).ready(function() {
$.each(configurations, function(backend, parameters) {
if (backend == backendClass) {
$.each(parameters['configuration'], function(parameter, placeholder) {
- if (placeholder.indexOf('*') != -1) {
- td.append('<input type="password" data-parameter="'+parameter+'" placeholder="'+placeholder.substring(1)+'" />');
- } else if (placeholder.indexOf('!') != -1) {
+ var is_optional = false;
+ if (placeholder.indexOf('&') === 0) {
+ is_optional = true;
+ placeholder = placeholder.substring(1);
+ }
+ if (placeholder.indexOf('*') === 0) {
+ var class_string = is_optional ? ' class="optional"' : '';
+ td.append('<input type="password"' + class_string + ' data-parameter="'+parameter+'" placeholder="'+placeholder.substring(1)+'" />');
+ } else if (placeholder.indexOf('!') === 0) {
td.append('<label><input type="checkbox" data-parameter="'+parameter+'" />'+placeholder.substring(1)+'</label>');
- } else if (placeholder.indexOf('&') != -1) {
- td.append('<input type="text" class="optional" data-parameter="'+parameter+'" placeholder="'+placeholder.substring(1)+'" />');
- } else if (placeholder.indexOf('#') != -1) {
+ } else if (placeholder.indexOf('#') === 0) {
td.append('<input type="hidden" data-parameter="'+parameter+'" />');
} else {
- td.append('<input type="text" data-parameter="'+parameter+'" placeholder="'+placeholder+'" />');
+ var class_string = is_optional ? ' class="optional"' : '';
+ td.append('<input type="text"' + class_string + ' data-parameter="'+parameter+'" placeholder="'+placeholder+'" />');
}
});
if (parameters['custom'] && $('#externalStorage tbody tr.'+backendClass.replace(/\\/g, '\\\\')).length == 1) {
@@ -264,7 +269,7 @@ $(document).ready(function() {
OC.MountConfig.saveStorage($(this).parent().parent());
});
- $('#sslCertificate').on('click', 'td.remove>img', function() {
+ $('#sslCertificate').on('click', 'td.remove>img', function() {
var $tr = $(this).parent().parent();
var row = this.parentNode.parentNode;
$.post(OC.filePath('files_external', 'ajax', 'removeRootCertificate.php'), {cert: row.id});
@@ -302,13 +307,23 @@ $(document).ready(function() {
});
$('#allowUserMounting').bind('change', function() {
+ OC.msg.startSaving('#userMountingMsg');
if (this.checked) {
OC.AppConfig.setValue('files_external', 'allow_user_mounting', 'yes');
+ $('#userMountingBackups').removeClass('hidden');
} else {
OC.AppConfig.setValue('files_external', 'allow_user_mounting', 'no');
+ $('#userMountingBackups').addClass('hidden');
}
+ OC.msg.finishedSaving('#userMountingMsg', {status: 'success', data: {message: t('settings', 'Saved')}});
});
+ $('input[name="allowUserMountingBackends\\[\\]"]').bind('change', function() {
+ OC.msg.startSaving('#userMountingMsg');
+ var user_mounting_backends = $('input[name="allowUserMountingBackends\\[\\]"]:checked').map(function(){return $(this).val();}).get();
+ OC.AppConfig.setValue('files_external', 'user_mounting_backends', user_mounting_backends.join());
+ OC.msg.finishedSaving('#userMountingMsg', {status: 'success', data: {message: t('settings', 'Saved')}});
+ });
});
})();
diff --git a/apps/files_external/l10n/ar.php b/apps/files_external/l10n/ar.php
index 338526d2afd..5fd4e4c398c 100644
--- a/apps/files_external/l10n/ar.php
+++ b/apps/files_external/l10n/ar.php
@@ -1,5 +1,6 @@
<?php
$TRANSLATIONS = array(
+"Saved" => "حفظ",
"Folder name" => "اسم المجلد",
"Options" => "خيارات",
"All Users" => "كل المستخدمين",
diff --git a/apps/files_external/l10n/bg_BG.php b/apps/files_external/l10n/bg_BG.php
index 17665d22286..d59a4b8c80b 100644
--- a/apps/files_external/l10n/bg_BG.php
+++ b/apps/files_external/l10n/bg_BG.php
@@ -13,7 +13,6 @@ $TRANSLATIONS = array(
"Users" => "Потребители",
"Delete" => "Изтриване",
"Enable User External Storage" => "Вкл. на поддръжка за външно потр. хранилище",
-"Allow users to mount their own external storage" => "Позволено е на потребителите да ползват тяхно лично външно хранилище",
"SSL root certificates" => "SSL основни сертификати",
"Import Root Certificate" => "Импортиране на основен сертификат"
);
diff --git a/apps/files_external/l10n/bn_BD.php b/apps/files_external/l10n/bn_BD.php
index 0591dbba55c..065d61acfca 100644
--- a/apps/files_external/l10n/bn_BD.php
+++ b/apps/files_external/l10n/bn_BD.php
@@ -15,7 +15,6 @@ $TRANSLATIONS = array(
"Users" => "ব্যবহারকারী",
"Delete" => "মুছে",
"Enable User External Storage" => "ব্যবহারকারীর বাহ্যিক সংরক্ষণাগার সক্রিয় কর",
-"Allow users to mount their own external storage" => "ব্যবহারকারীদেরকে তাদের নিজস্ব বাহ্যিক সংরক্ষনাগার সাউন্ট করতে অনুমোদন দাও",
"SSL root certificates" => "SSL রুট সনদপত্র",
"Import Root Certificate" => "রুট সনদপত্রটি আমদানি করুন"
);
diff --git a/apps/files_external/l10n/ca.php b/apps/files_external/l10n/ca.php
index c1d6ec077b4..3e722046296 100644
--- a/apps/files_external/l10n/ca.php
+++ b/apps/files_external/l10n/ca.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Concedeix accés",
"Please provide a valid Dropbox app key and secret." => "Proporcioneu una clau d'aplicació i secret vàlids per a Dropbox",
"Error configuring Google Drive storage" => "Error en configurar l'emmagatzemament Google Drive",
+"Saved" => "Desat",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Avís:</b> \"smbclient\" no està instal·lat. No es pot muntar la compartició CIFS/SMB. Demaneu a l'administrador del sistema que l'instal·li.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Avís:</b> El suport FTP per PHP no està activat o no està instal·lat. No es pot muntar la compartició FTP. Demaneu a l'administrador del sistema que l'instal·li.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Avís:</b>El suport Curl de PHP no està activat o instal·lat. No es pot muntar ownCloud / WebDAV o GoogleDrive. Demaneu a l'administrador que l'instal·li.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Usuaris",
"Delete" => "Esborra",
"Enable User External Storage" => "Habilita l'emmagatzemament extern d'usuari",
-"Allow users to mount their own external storage" => "Permet als usuaris muntar el seu emmagatzemament extern propi",
+"Allow users to mount the following external storage" => "Permet als usuaris muntar els dispositius externs següents",
"SSL root certificates" => "Certificats SSL root",
"Import Root Certificate" => "Importa certificat root"
);
diff --git a/apps/files_external/l10n/cs_CZ.php b/apps/files_external/l10n/cs_CZ.php
index a574e0506cf..1b92e35c456 100644
--- a/apps/files_external/l10n/cs_CZ.php
+++ b/apps/files_external/l10n/cs_CZ.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Povolit přístup",
"Please provide a valid Dropbox app key and secret." => "Zadejte, prosím, platný klíč a bezpečnostní frázi aplikace Dropbox.",
"Error configuring Google Drive storage" => "Chyba při nastavení úložiště Google Drive",
+"Saved" => "Uloženo",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Varování:</b> není nainstalován program \"smbclient\". Není možné připojení oddílů CIFS/SMB. Prosím požádejte svého správce systému ať jej nainstaluje.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Varování:</b> podpora FTP v PHP není povolena nebo není nainstalována. Není možné připojení oddílů FTP. Prosím požádejte svého správce systému ať ji nainstaluje.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Varování:</b> podpora CURL v PHP není povolena nebo není nainstalována. Není možné připojení oddílů ownCloud, WebDAV, či GoogleDrive. Prosím požádejte svého správce systému ať ji nainstaluje.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Uživatelé",
"Delete" => "Smazat",
"Enable User External Storage" => "Zapnout externí uživatelské úložiště",
-"Allow users to mount their own external storage" => "Povolit uživatelům připojení jejich vlastních externích úložišť",
+"Allow users to mount the following external storage" => "Povolit uživatelů připojit následující externí úložiště",
"SSL root certificates" => "Kořenové certifikáty SSL",
"Import Root Certificate" => "Importovat kořenového certifikátu"
);
diff --git a/apps/files_external/l10n/da.php b/apps/files_external/l10n/da.php
index 3a25142b36d..f3ac35e42e0 100644
--- a/apps/files_external/l10n/da.php
+++ b/apps/files_external/l10n/da.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Godkend adgang",
"Please provide a valid Dropbox app key and secret." => "Angiv venligst en valid Dropbox app nøgle og hemmelighed",
"Error configuring Google Drive storage" => "Fejl ved konfiguration af Google Drive plads",
+"Saved" => "Gemt",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b> Advarsel: </ b> \"smbclient\" ikke er installeret. Montering af CIFS / SMB delinger er ikke muligt. Spørg din systemadministrator om at installere det.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b> Advarsel: </ b> FTP-understøttelse i PHP ikke er aktiveret eller installeret. Montering af FTP delinger er ikke muligt. Spørg din systemadministrator om at installere det.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Advarsel:</b> Understøttelsen for Curl i PHP er enten ikke aktiveret eller ikke installeret. Det er ikke muligt, at montere ownCloud / WebDAV eller GoogleDrive. Spørg din system administrator om at installere det. ",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Brugere",
"Delete" => "Slet",
"Enable User External Storage" => "Aktiver ekstern opbevaring for brugere",
-"Allow users to mount their own external storage" => "Tillad brugere at montere deres egne eksterne opbevaring",
+"Allow users to mount the following external storage" => "Tillad brugere at montere følgende som eksternt lager",
"SSL root certificates" => "SSL-rodcertifikater",
"Import Root Certificate" => "Importer rodcertifikat"
);
diff --git a/apps/files_external/l10n/de.php b/apps/files_external/l10n/de.php
index b2c72f76889..a78728b4c20 100644
--- a/apps/files_external/l10n/de.php
+++ b/apps/files_external/l10n/de.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Zugriff gestatten",
"Please provide a valid Dropbox app key and secret." => "Bitte trage einen gültigen Dropbox-App-Key mit Secret ein.",
"Error configuring Google Drive storage" => "Fehler beim Einrichten von Google Drive",
+"Saved" => "Gespeichert",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Warnung:</b> \"smbclient\" ist nicht installiert. Das Einhängen von CIFS/SMB-Freigaben ist nicht möglich. Bitte Deinen System-Administrator, dies zu installieren.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Warnung::</b> Die FTP Unterstützung von PHP ist nicht aktiviert oder installiert. Bitte wende Dich an Deinen Systemadministrator.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Warnung:</b> Die Curl-Unterstützung in PHP ist nicht aktiviert oder installiert. Das Einbinden von ownCloud / WebDav der GoogleDrive-Freigaben ist nicht möglich. Bitte Deinen Systemadminstrator um die Installation. ",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Benutzer",
"Delete" => "Löschen",
"Enable User External Storage" => "Externen Speicher für Benutzer aktivieren",
-"Allow users to mount their own external storage" => "Erlaubt Benutzern ihre eigenen externen Speicher einzubinden",
+"Allow users to mount the following external storage" => "Erlaube es Benutzern, den folgenden externen Speicher einzubinden",
"SSL root certificates" => "SSL-Root-Zertifikate",
"Import Root Certificate" => "Root-Zertifikate importieren"
);
diff --git a/apps/files_external/l10n/de_AT.php b/apps/files_external/l10n/de_AT.php
new file mode 100644
index 00000000000..afa3eff001c
--- /dev/null
+++ b/apps/files_external/l10n/de_AT.php
@@ -0,0 +1,5 @@
+<?php
+$TRANSLATIONS = array(
+"Delete" => "Löschen"
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files_external/l10n/de_CH.php b/apps/files_external/l10n/de_CH.php
index 85e2f2d91fd..8a13c7cdd57 100644
--- a/apps/files_external/l10n/de_CH.php
+++ b/apps/files_external/l10n/de_CH.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Benutzer",
"Delete" => "Löschen",
"Enable User External Storage" => "Externen Speicher für Benutzer aktivieren",
-"Allow users to mount their own external storage" => "Erlaubt Benutzern, ihre eigenen externen Speicher einzubinden",
"SSL root certificates" => "SSL-Root-Zertifikate",
"Import Root Certificate" => "Root-Zertifikate importieren"
);
diff --git a/apps/files_external/l10n/de_DE.php b/apps/files_external/l10n/de_DE.php
index 8f6a25cb522..5ffe946c699 100644
--- a/apps/files_external/l10n/de_DE.php
+++ b/apps/files_external/l10n/de_DE.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Zugriff gestatten",
"Please provide a valid Dropbox app key and secret." => "Bitte tragen Sie einen gültigen Dropbox-App-Key mit Secret ein.",
"Error configuring Google Drive storage" => "Fehler beim Einrichten von Google Drive",
+"Saved" => "Gespeichert",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Warnung:</b> \"smbclient\" ist nicht installiert. Das Einhängen von CIFS/SMB-Freigaben ist nicht möglich. Bitten Sie Ihren Systemadministrator, dies zu installieren.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Warnung::</b> Die FTP Unterstützung von PHP ist nicht aktiviert oder installiert. Bitte wenden Sie sich an Ihren Systemadministrator.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Achtung:</b> Die Curl-Unterstützung von PHP ist nicht aktiviert oder installiert. Das Laden von ownCloud / WebDAV oder GoogleDrive Freigaben ist nicht möglich. Bitte Sie Ihren Systemadministrator, das Modul zu installieren.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Benutzer",
"Delete" => "Löschen",
"Enable User External Storage" => "Externen Speicher für Benutzer aktivieren",
-"Allow users to mount their own external storage" => "Erlaubt Benutzern, ihre eigenen externen Speicher einzubinden",
+"Allow users to mount the following external storage" => "Erlauben Sie Benutzern, folgende externe Speicher einzubinden",
"SSL root certificates" => "SSL-Root-Zertifikate",
"Import Root Certificate" => "Root-Zertifikate importieren"
);
diff --git a/apps/files_external/l10n/el.php b/apps/files_external/l10n/el.php
index 0161c0901d6..4dcd93d7ac8 100644
--- a/apps/files_external/l10n/el.php
+++ b/apps/files_external/l10n/el.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Παροχή πρόσβασης",
"Please provide a valid Dropbox app key and secret." => "Παρακαλούμε δώστε έγκυρο κλειδί Dropbox και μυστικό.",
"Error configuring Google Drive storage" => "Σφάλμα ρυθμίζωντας αποθήκευση Google Drive ",
+"Saved" => "Αποθηκεύτηκαν",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Προσοχή:</b> Ο \"smbclient\" δεν εγκαταστάθηκε. Δεν είναι δυνατή η προσάρτηση CIFS/SMB. Παρακαλώ ενημερώστε τον διαχειριστή συστήματος να το εγκαταστήσει.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Προσοχή:</b> Η υποστήριξη FTP στην PHP δεν ενεργοποιήθηκε ή εγκαταστάθηκε. Δεν είναι δυνατή η προσάρτηση FTP. Παρακαλώ ενημερώστε τον διαχειριστή συστήματος να το εγκαταστήσει.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<Προειδοποίηση </b> Η υποστήριξη του συστήματος Curl στο PHP δεν είναι ενεργοποιημένη ή εγκαταστημένη. Η αναπαραγωγή του ownCloud/WebDAV ή GoogleDrive δεν είναι δυνατή. Παρακαλώ ρωτήστε τον διαχειριστλη του συστήματος για την εγκατάσταση. ",
@@ -21,7 +22,6 @@ $TRANSLATIONS = array(
"Users" => "Χρήστες",
"Delete" => "Διαγραφή",
"Enable User External Storage" => "Ενεργοποίηση Εξωτερικού Αποθηκευτικού Χώρου Χρήστη",
-"Allow users to mount their own external storage" => "Να επιτρέπεται στους χρήστες να προσαρτούν δικό τους εξωτερικό αποθηκευτικό χώρο",
"SSL root certificates" => "Πιστοποιητικά SSL root",
"Import Root Certificate" => "Εισαγωγή Πιστοποιητικού Root"
);
diff --git a/apps/files_external/l10n/en_GB.php b/apps/files_external/l10n/en_GB.php
index 8adca794dda..f7fdbf2f0d1 100644
--- a/apps/files_external/l10n/en_GB.php
+++ b/apps/files_external/l10n/en_GB.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Grant access",
"Please provide a valid Dropbox app key and secret." => "Please provide a valid Dropbox app key and secret.",
"Error configuring Google Drive storage" => "Error configuring Google Drive storage",
+"Saved" => "Saved",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Users",
"Delete" => "Delete",
"Enable User External Storage" => "Enable User External Storage",
-"Allow users to mount their own external storage" => "Allow users to mount their own external storage",
+"Allow users to mount the following external storage" => "Allow users to mount the following external storage",
"SSL root certificates" => "SSL root certificates",
"Import Root Certificate" => "Import Root Certificate"
);
diff --git a/apps/files_external/l10n/eo.php b/apps/files_external/l10n/eo.php
index 5697221cac0..aba16e2efa8 100644
--- a/apps/files_external/l10n/eo.php
+++ b/apps/files_external/l10n/eo.php
@@ -16,7 +16,6 @@ $TRANSLATIONS = array(
"Users" => "Uzantoj",
"Delete" => "Forigi",
"Enable User External Storage" => "Kapabligi malenan memorilon de uzanto",
-"Allow users to mount their own external storage" => "Permesi al uzantoj surmeti siajn proprajn malenajn memorilojn",
"SSL root certificates" => "Radikaj SSL-atestoj",
"Import Root Certificate" => "Enporti radikan ateston"
);
diff --git a/apps/files_external/l10n/es.php b/apps/files_external/l10n/es.php
index 5179d9329a5..ea831c947f4 100644
--- a/apps/files_external/l10n/es.php
+++ b/apps/files_external/l10n/es.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Conceder acceso",
"Please provide a valid Dropbox app key and secret." => "Por favor, proporcione un una clave válida de la app Dropbox y una clave secreta.",
"Error configuring Google Drive storage" => "Error configurando el almacenamiento de Google Drive",
+"Saved" => "Guardado",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Advertencia:</b> El cliente smb (smbclient) no se encuentra instalado. El montado de archivos o ficheros CIFS/SMB no es posible. Por favor pida al administrador de su sistema que lo instale.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Advertencia:</b> El soporte de FTP en PHP no se encuentra instalado. El montado de archivos o ficheros FTP no es posible. Por favor pida al administrador de su sistema que lo instale.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Advertencia:</b> El soporte de Curl en PHP no está activado ni instalado. El montado de ownCloud, WebDAV o GoogleDrive no es posible. Pida al administrador de su sistema que lo instale.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Usuarios",
"Delete" => "Eliminar",
"Enable User External Storage" => "Habilitar almacenamiento externo de usuario",
-"Allow users to mount their own external storage" => "Permitir a los usuarios montar su propio almacenamiento externo",
+"Allow users to mount the following external storage" => "Permitir a los usuarios montar el siguiente almacenamiento externo",
"SSL root certificates" => "Certificados raíz SSL",
"Import Root Certificate" => "Importar certificado raíz"
);
diff --git a/apps/files_external/l10n/es_AR.php b/apps/files_external/l10n/es_AR.php
index a0bb3a8dfea..05204b748c4 100644
--- a/apps/files_external/l10n/es_AR.php
+++ b/apps/files_external/l10n/es_AR.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Usuarios",
"Delete" => "Borrar",
"Enable User External Storage" => "Habilitar almacenamiento de usuario externo",
-"Allow users to mount their own external storage" => "Permitir a los usuarios montar su propio almacenamiento externo",
"SSL root certificates" => "certificados SSL raíz",
"Import Root Certificate" => "Importar certificado raíz"
);
diff --git a/apps/files_external/l10n/es_MX.php b/apps/files_external/l10n/es_MX.php
index b508df8476a..5d3fd44bec6 100644
--- a/apps/files_external/l10n/es_MX.php
+++ b/apps/files_external/l10n/es_MX.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Usuarios",
"Delete" => "Eliminar",
"Enable User External Storage" => "Habilitar almacenamiento externo de usuario",
-"Allow users to mount their own external storage" => "Permitir a los usuarios montar su propio almacenamiento externo",
"SSL root certificates" => "Certificados raíz SSL",
"Import Root Certificate" => "Importar certificado raíz"
);
diff --git a/apps/files_external/l10n/et_EE.php b/apps/files_external/l10n/et_EE.php
index a7e623eb7da..c6450f95e18 100644
--- a/apps/files_external/l10n/et_EE.php
+++ b/apps/files_external/l10n/et_EE.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Kasutajad",
"Delete" => "Kustuta",
"Enable User External Storage" => "Luba kasutajatele väline salvestamine",
-"Allow users to mount their own external storage" => "Luba kasutajatel ühendada külge nende enda välised salvestusseadmed",
"SSL root certificates" => "SSL root sertifikaadid",
"Import Root Certificate" => "Impordi root sertifikaadid"
);
diff --git a/apps/files_external/l10n/eu.php b/apps/files_external/l10n/eu.php
index db92e2f001c..bdc5cf56760 100644
--- a/apps/files_external/l10n/eu.php
+++ b/apps/files_external/l10n/eu.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Erabiltzaileak",
"Delete" => "Ezabatu",
"Enable User External Storage" => "Gaitu erabiltzaileentzako Kanpo Biltegiratzea",
-"Allow users to mount their own external storage" => "Baimendu erabiltzaileak bere kanpo biltegiratzeak muntatzen",
"SSL root certificates" => "SSL erro ziurtagiriak",
"Import Root Certificate" => "Inportatu Erro Ziurtagiria"
);
diff --git a/apps/files_external/l10n/eu_ES.php b/apps/files_external/l10n/eu_ES.php
new file mode 100644
index 00000000000..8612c8609bb
--- /dev/null
+++ b/apps/files_external/l10n/eu_ES.php
@@ -0,0 +1,5 @@
+<?php
+$TRANSLATIONS = array(
+"Delete" => "Ezabatu"
+);
+$PLURAL_FORMS = "nplurals=2; plural=(n != 1);";
diff --git a/apps/files_external/l10n/fa.php b/apps/files_external/l10n/fa.php
index 216893811cb..544b8a14d5c 100644
--- a/apps/files_external/l10n/fa.php
+++ b/apps/files_external/l10n/fa.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "کاربران",
"Delete" => "حذف",
"Enable User External Storage" => "فعال سازی حافظه خارجی کاربر",
-"Allow users to mount their own external storage" => "اجازه به کاربران برای متصل کردن منابع ذخیره ی خارجی خودشان",
"SSL root certificates" => "گواهی های اصلی SSL ",
"Import Root Certificate" => "وارد کردن گواهی اصلی"
);
diff --git a/apps/files_external/l10n/fi_FI.php b/apps/files_external/l10n/fi_FI.php
index 9632aa255ea..d2f9d1a73a5 100644
--- a/apps/files_external/l10n/fi_FI.php
+++ b/apps/files_external/l10n/fi_FI.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Salli pääsy",
"Please provide a valid Dropbox app key and secret." => "Anna kelvollinen Dropbox-sovellusavain ja salainen vastaus.",
"Error configuring Google Drive storage" => "Virhe Google Drive levyn asetuksia tehtäessä",
+"Saved" => "Tallennettu",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Varoitus:</b> \"smbclient\" ei ole asennettuna. CIFS-/SMB-jakojen liittäminen ei ole mahdollista. Pyydä järjestelmän ylläpitäjää asentamaan smbclient.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Varoitus:</b> PHP:n FTP-tuki ei ole käytössä tai sitä ei ole asennettu. FTP-jakojen liittäminen ei ole mahdollista. Pyydä järjestelmän ylläpitäjää ottamaan FTP-tuki käyttöön.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Varoitus:</b> PHP:n Curl-tuki ei ole käytössä tai sitä ei ole lainkaan asennettu. ownCloudin, WebDAV:in tai Google Driven liittäminen ei ole mahdollista. Pyydä järjestelmän ylläpitäjää ottamaan Curl-tuki käyttöön.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Käyttäjät",
"Delete" => "Poista",
"Enable User External Storage" => "Ota käyttöön ulkopuoliset tallennuspaikat",
-"Allow users to mount their own external storage" => "Salli käyttäjien liittää omia erillisiä tallennusvälineitä",
+"Allow users to mount the following external storage" => "Salli käyttäjien liittää seuraavat erilliset tallennusvälineet",
"SSL root certificates" => "SSL-juurivarmenteet",
"Import Root Certificate" => "Tuo juurivarmenne"
);
diff --git a/apps/files_external/l10n/fr.php b/apps/files_external/l10n/fr.php
index f6b1a75200c..4b8e2b905b6 100644
--- a/apps/files_external/l10n/fr.php
+++ b/apps/files_external/l10n/fr.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Autoriser l'accès",
"Please provide a valid Dropbox app key and secret." => "Veuillez fournir une clé d'application (app key) ainsi qu'un mot de passe valides.",
"Error configuring Google Drive storage" => "Erreur lors de la configuration du support de stockage Google Drive",
+"Saved" => "Sauvegarder",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Attention : </b> \"smbclient\" n'est pas installé. Le montage des partages CIFS/SMB n'est pas disponible. Contactez votre administrateur système pour l'installer.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Attention : </b> Le support FTP de PHP n'est pas activé ou installé. Le montage des partages FTP n'est pas disponible. Contactez votre administrateur système pour l'installer.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Attention :</b> Le support de Curl n'est pas activé ou installé dans PHP. Le montage de ownCloud / WebDAV ou GoogleDrive n'est pas possible. Contactez votre administrateur système pour l'installer.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Utilisateurs",
"Delete" => "Supprimer",
"Enable User External Storage" => "Activer le stockage externe pour les utilisateurs",
-"Allow users to mount their own external storage" => "Autoriser les utilisateurs à monter leur propre stockage externe",
+"Allow users to mount the following external storage" => "Autorise les utilisateurs à monter les stockage externes suivants",
"SSL root certificates" => "Certificats racine SSL",
"Import Root Certificate" => "Importer un certificat racine"
);
diff --git a/apps/files_external/l10n/gl.php b/apps/files_external/l10n/gl.php
index 3dda999dd18..ec13fe241f6 100644
--- a/apps/files_external/l10n/gl.php
+++ b/apps/files_external/l10n/gl.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Permitir o acceso",
"Please provide a valid Dropbox app key and secret." => "Forneza unha chave correcta e segreda do Dropbox.",
"Error configuring Google Drive storage" => "Produciuse un erro ao configurar o almacenamento en Google Drive",
+"Saved" => "Gardado",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Aviso:</b> «smbclient» non está instalado. Non é posibel a montaxe de comparticións CIFS/SMB. Consulte co administrador do sistema para instalalo.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Aviso:</b> A compatibilidade de FTP en PHP non está activada ou instalada. Non é posibel a montaxe de comparticións FTP. Consulte co administrador do sistema para instalalo.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Aviso:</ b> A compatibilidade de Curl en PHP non está activada ou instalada. Non é posíbel a montaxe de ownCloud / WebDAV ou GoogleDrive. Consulte co administrador do sistema para instalala.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Usuarios",
"Delete" => "Eliminar",
"Enable User External Storage" => "Activar o almacenamento externo do usuario",
-"Allow users to mount their own external storage" => "Permitir aos usuarios montar os seus propios almacenamentos externos",
+"Allow users to mount the following external storage" => "Permitirlle aos usuarios montar o seguinte almacenamento externo",
"SSL root certificates" => "Certificados SSL root",
"Import Root Certificate" => "Importar o certificado root"
);
diff --git a/apps/files_external/l10n/he.php b/apps/files_external/l10n/he.php
index e99c9f5193d..6aec07e78cf 100644
--- a/apps/files_external/l10n/he.php
+++ b/apps/files_external/l10n/he.php
@@ -16,7 +16,6 @@ $TRANSLATIONS = array(
"Users" => "משתמשים",
"Delete" => "מחיקה",
"Enable User External Storage" => "הפעלת אחסון חיצוני למשתמשים",
-"Allow users to mount their own external storage" => "יאפשר למשתמשים לעגן את האחסון החיצוני שלהם",
"SSL root certificates" => "שורש אישורי אבטחת SSL ",
"Import Root Certificate" => "ייבוא אישור אבטחת שורש"
);
diff --git a/apps/files_external/l10n/hu_HU.php b/apps/files_external/l10n/hu_HU.php
index 23fe916eba6..60661380433 100644
--- a/apps/files_external/l10n/hu_HU.php
+++ b/apps/files_external/l10n/hu_HU.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Felhasználók",
"Delete" => "Törlés",
"Enable User External Storage" => "Külső tárolók engedélyezése a felhasználók részére",
-"Allow users to mount their own external storage" => "Lehetővé teszi, hogy a felhasználók külső tárolási szolgáltatásokat csatoljanak be a saját területükre",
"SSL root certificates" => "SSL tanúsítványok",
"Import Root Certificate" => "SSL tanúsítványok importálása"
);
diff --git a/apps/files_external/l10n/id.php b/apps/files_external/l10n/id.php
index 53ab79ae7ee..9f91fdf992f 100644
--- a/apps/files_external/l10n/id.php
+++ b/apps/files_external/l10n/id.php
@@ -20,7 +20,6 @@ $TRANSLATIONS = array(
"Users" => "Pengguna",
"Delete" => "Hapus",
"Enable User External Storage" => "Aktifkan Penyimpanan Eksternal Pengguna",
-"Allow users to mount their own external storage" => "Izinkan pengguna untuk mengaitkan penyimpanan eksternal mereka",
"SSL root certificates" => "Sertifikat root SSL",
"Import Root Certificate" => "Impor Sertifikat Root"
);
diff --git a/apps/files_external/l10n/is.php b/apps/files_external/l10n/is.php
index d2229d1fcdd..e86cfa108a6 100644
--- a/apps/files_external/l10n/is.php
+++ b/apps/files_external/l10n/is.php
@@ -18,7 +18,6 @@ $TRANSLATIONS = array(
"Users" => "Notendur",
"Delete" => "Eyða",
"Enable User External Storage" => "Virkja ytra gagnasvæði notenda",
-"Allow users to mount their own external storage" => "Leyfa notendum að bæta við sínum eigin ytri gagnasvæðum",
"SSL root certificates" => "SSL rótar skilríki",
"Import Root Certificate" => "Flytja inn rótar skilríki"
);
diff --git a/apps/files_external/l10n/it.php b/apps/files_external/l10n/it.php
index b53663beb56..d62d8e97327 100644
--- a/apps/files_external/l10n/it.php
+++ b/apps/files_external/l10n/it.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Concedi l'accesso",
"Please provide a valid Dropbox app key and secret." => "Fornisci chiave di applicazione e segreto di Dropbox validi.",
"Error configuring Google Drive storage" => "Errore durante la configurazione dell'archivio Google Drive",
+"Saved" => "Salvato",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Avviso:</b> \"smbclient\" non è installato. Impossibile montare condivisioni CIFS/SMB. Chiedi all'amministratore di sistema di installarlo.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Avviso:</b> il supporto FTP di PHP non è abilitato o non è installato. Impossibile montare condivisioni FTP. Chiedi all'amministratore di sistema di installarlo.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Avviso:</b> il supporto Curl di PHP non è abilitato o non è installato. Impossibile montare condivisioni ownCloud / WebDAV o GoogleDrive. Chiedi all'amministratore di sistema di installarlo.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Utenti",
"Delete" => "Elimina",
"Enable User External Storage" => "Abilita la memoria esterna dell'utente",
-"Allow users to mount their own external storage" => "Consenti agli utenti di montare la propria memoria esterna",
+"Allow users to mount the following external storage" => "Consenti agli utenti di montare la seguente memoria esterna",
"SSL root certificates" => "Certificati SSL radice",
"Import Root Certificate" => "Importa certificato radice"
);
diff --git a/apps/files_external/l10n/ja.php b/apps/files_external/l10n/ja.php
new file mode 100644
index 00000000000..312dc85188d
--- /dev/null
+++ b/apps/files_external/l10n/ja.php
@@ -0,0 +1,29 @@
+<?php
+$TRANSLATIONS = array(
+"Access granted" => "アクセスは許可されました",
+"Error configuring Dropbox storage" => "Dropboxストレージの設定エラー",
+"Grant access" => "アクセスを許可",
+"Please provide a valid Dropbox app key and secret." => "有効なDropboxアプリのキーとパスワードを入力してください。",
+"Error configuring Google Drive storage" => "Googleドライブストレージの設定エラー",
+"Saved" => "保存されました",
+"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>警告:</b> \"smbclient\" がインストールされていません。CIFS/SMB共有のマウントはできません。システム管理者にインストールを依頼してください。",
+"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>警告:</b> PHPのFTPサポートが無効またはインストールされていません。FTP共有のマウントはできません。システム管理者にインストールを依頼してください。",
+"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>警告:</b> PHPのCurlサポートが無効またはインストールされていません。ownCloud / WebDAVまたはGoogleDriveのマウントはできません。システム管理者にインストールを依頼してください。",
+"External Storage" => "外部ストレージ",
+"Folder name" => "フォルダー名",
+"External storage" => "外部ストレージ",
+"Configuration" => "設定",
+"Options" => "オプション",
+"Applicable" => "適用範囲",
+"Add storage" => "ストレージを追加",
+"None set" => "未設定",
+"All Users" => "すべてのユーザー",
+"Groups" => "グループ",
+"Users" => "ユーザー",
+"Delete" => "削除",
+"Enable User External Storage" => "ユーザーの外部ストレージを有効にする",
+"Allow users to mount the following external storage" => "ユーザに以下の外部ストレージのマウントを許可する",
+"SSL root certificates" => "SSLルート証明書",
+"Import Root Certificate" => "ルート証明書をインポート"
+);
+$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/apps/files_external/l10n/ja_JP.php b/apps/files_external/l10n/ja_JP.php
index fc528f035c2..312dc85188d 100644
--- a/apps/files_external/l10n/ja_JP.php
+++ b/apps/files_external/l10n/ja_JP.php
@@ -3,25 +3,26 @@ $TRANSLATIONS = array(
"Access granted" => "アクセスは許可されました",
"Error configuring Dropbox storage" => "Dropboxストレージの設定エラー",
"Grant access" => "アクセスを許可",
-"Please provide a valid Dropbox app key and secret." => "有効なDropboxアプリのキーとパスワードを入力して下さい。",
+"Please provide a valid Dropbox app key and secret." => "有効なDropboxアプリのキーとパスワードを入力してください。",
"Error configuring Google Drive storage" => "Googleドライブストレージの設定エラー",
-"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>警告:</b> \"smbclient\" はインストールされていません。CIFS/SMB 共有のマウントはできません。システム管理者にインストールをお願いして下さい。",
-"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>警告:</b> PHPのFTPサポートは無効もしくはインストールされていません。FTP共有のマウントはできません。システム管理者にインストールをお願いして下さい。",
-"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>警告:</b> PHP の Curl サポートは無効もしくはインストールされていません。ownCloud / WebDAV もしくは GoogleDrive のマウントはできません。システム管理者にインストールをお願いして下さい。",
+"Saved" => "保存されました",
+"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>警告:</b> \"smbclient\" がインストールされていません。CIFS/SMB共有のマウントはできません。システム管理者にインストールを依頼してください。",
+"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>警告:</b> PHPのFTPサポートが無効またはインストールされていません。FTP共有のマウントはできません。システム管理者にインストールを依頼してください。",
+"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>警告:</b> PHPのCurlサポートが無効またはインストールされていません。ownCloud / WebDAVまたはGoogleDriveのマウントはできません。システム管理者にインストールを依頼してください。",
"External Storage" => "外部ストレージ",
-"Folder name" => "フォルダ名",
+"Folder name" => "フォルダー名",
"External storage" => "外部ストレージ",
"Configuration" => "設定",
"Options" => "オプション",
"Applicable" => "適用範囲",
"Add storage" => "ストレージを追加",
"None set" => "未設定",
-"All Users" => "すべてのユーザ",
+"All Users" => "すべてのユーザー",
"Groups" => "グループ",
-"Users" => "ユーザ",
+"Users" => "ユーザー",
"Delete" => "削除",
-"Enable User External Storage" => "ユーザの外部ストレージを有効にする",
-"Allow users to mount their own external storage" => "ユーザに外部ストレージのマウントを許可する",
+"Enable User External Storage" => "ユーザーの外部ストレージを有効にする",
+"Allow users to mount the following external storage" => "ユーザに以下の外部ストレージのマウントを許可する",
"SSL root certificates" => "SSLルート証明書",
"Import Root Certificate" => "ルート証明書をインポート"
);
diff --git a/apps/files_external/l10n/ka_GE.php b/apps/files_external/l10n/ka_GE.php
index 445d40e7089..4953f91ce6a 100644
--- a/apps/files_external/l10n/ka_GE.php
+++ b/apps/files_external/l10n/ka_GE.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "მომხმარებელი",
"Delete" => "წაშლა",
"Enable User External Storage" => "მომხმარებლის ექსტერნალ საცავის აქტივირება",
-"Allow users to mount their own external storage" => "მიეცით მომხმარებლებს თავისი ექსტერნალ საცავის მონტირების უფლება",
"SSL root certificates" => "SSL root სერთიფიკატები",
"Import Root Certificate" => "Root სერთიფიკატის იმპორტირება"
);
diff --git a/apps/files_external/l10n/km.php b/apps/files_external/l10n/km.php
index f7d9faa38c5..4586f866a74 100644
--- a/apps/files_external/l10n/km.php
+++ b/apps/files_external/l10n/km.php
@@ -1,5 +1,8 @@
<?php
$TRANSLATIONS = array(
+"Folder name" => "ឈ្មោះ​ថត",
+"Groups" => "ក្រុ",
+"Users" => "អ្នកប្រើ",
"Delete" => "លុប"
);
$PLURAL_FORMS = "nplurals=1; plural=0;";
diff --git a/apps/files_external/l10n/ko.php b/apps/files_external/l10n/ko.php
index 64d815a5bcb..088a419e1c1 100644
--- a/apps/files_external/l10n/ko.php
+++ b/apps/files_external/l10n/ko.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "사용자",
"Delete" => "삭제",
"Enable User External Storage" => "사용자 외부 저장소 사용",
-"Allow users to mount their own external storage" => "사용자별 외부 저장소 마운트 허용",
"SSL root certificates" => "SSL 루트 인증서",
"Import Root Certificate" => "루트 인증서 가져오기"
);
diff --git a/apps/files_external/l10n/lt_LT.php b/apps/files_external/l10n/lt_LT.php
index 57cdfe6722a..c96119c8b68 100644
--- a/apps/files_external/l10n/lt_LT.php
+++ b/apps/files_external/l10n/lt_LT.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Vartotojai",
"Delete" => "Ištrinti",
"Enable User External Storage" => "Įjungti vartotojų išorines saugyklas",
-"Allow users to mount their own external storage" => "Leisti vartotojams pridėti savo išorines saugyklas",
"SSL root certificates" => "SSL sertifikatas",
"Import Root Certificate" => "Įkelti pagrindinį sertifikatą"
);
diff --git a/apps/files_external/l10n/lv.php b/apps/files_external/l10n/lv.php
index d0db01a22b5..18e56178892 100644
--- a/apps/files_external/l10n/lv.php
+++ b/apps/files_external/l10n/lv.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Lietotāji",
"Delete" => "Dzēst",
"Enable User External Storage" => "Aktivēt lietotāja ārējo krātuvi",
-"Allow users to mount their own external storage" => "Ļaut lietotājiem montēt pašiem savu ārējo krātuvi",
"SSL root certificates" => "SSL saknes sertifikāti",
"Import Root Certificate" => "Importēt saknes sertifikātus"
);
diff --git a/apps/files_external/l10n/mk.php b/apps/files_external/l10n/mk.php
index e410b398ac9..b59bb138f1d 100644
--- a/apps/files_external/l10n/mk.php
+++ b/apps/files_external/l10n/mk.php
@@ -18,7 +18,6 @@ $TRANSLATIONS = array(
"Users" => "Корисници",
"Delete" => "Избриши",
"Enable User External Storage" => "Овозможи надворешни за корисници",
-"Allow users to mount their own external storage" => "Дозволи им на корисниците да монтираат свои надворешни дискови",
"SSL root certificates" => "SSL root сертификати",
"Import Root Certificate" => "Увези"
);
diff --git a/apps/files_external/l10n/nb_NO.php b/apps/files_external/l10n/nb_NO.php
index cb31ac89227..c103112dbe3 100644
--- a/apps/files_external/l10n/nb_NO.php
+++ b/apps/files_external/l10n/nb_NO.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Brukere",
"Delete" => "Slett",
"Enable User External Storage" => "Aktiver ekstern lagring for bruker",
-"Allow users to mount their own external storage" => "Tillat brukere å koble til egne eksterne lagringsmedium",
"SSL root certificates" => "SSL root-sertifikater",
"Import Root Certificate" => "Importer root-sertifikat"
);
diff --git a/apps/files_external/l10n/nl.php b/apps/files_external/l10n/nl.php
index 35e63b09a35..4fa579775f9 100644
--- a/apps/files_external/l10n/nl.php
+++ b/apps/files_external/l10n/nl.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Sta toegang toe",
"Please provide a valid Dropbox app key and secret." => "Geef een geldige Dropbox key en secret.",
"Error configuring Google Drive storage" => "Fout tijdens het configureren van Google Drive opslag",
+"Saved" => "Bewaard",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Waarschuwing:</b> \"smbclient\" is niet geïnstalleerd. Mounten van CIFS/SMB shares is niet mogelijk. Vraag uw beheerder om smbclient te installeren.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Waarschuwing:</b> FTP ondersteuning in PHP is niet geactiveerd of geïnstalleerd. Mounten van FTP shares is niet mogelijk. Vraag uw beheerder FTP ondersteuning te installeren.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Waarschuwing:</b> Curl ondersteuning in PHP is niet geactiveerd of geïnstalleerd. Mounten van ownCloud / WebDAV of GoogleDrive is niet mogelijk. Vraag uw systeembeheerder dit te installeren.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Gebruikers",
"Delete" => "Verwijder",
"Enable User External Storage" => "Externe opslag voor gebruikers activeren",
-"Allow users to mount their own external storage" => "Sta gebruikers toe om hun eigen externe opslag aan te koppelen",
+"Allow users to mount the following external storage" => "Sta gebruikers toe de volgende externe opslag aan te koppelen",
"SSL root certificates" => "SSL root certificaten",
"Import Root Certificate" => "Importeer root certificaat"
);
diff --git a/apps/files_external/l10n/pl.php b/apps/files_external/l10n/pl.php
index f5501b9755b..ece0620f754 100644
--- a/apps/files_external/l10n/pl.php
+++ b/apps/files_external/l10n/pl.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Udziel dostępu",
"Please provide a valid Dropbox app key and secret." => "Proszę podać prawidłowy klucz aplikacji Dropbox i klucz sekretny.",
"Error configuring Google Drive storage" => "Wystąpił błąd podczas konfigurowania zasobu Google Drive",
+"Saved" => "Zapisano",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Ostrzeżenie:</b> \"smbclient\" nie jest zainstalowany. Zamontowanie katalogów CIFS/SMB nie jest możliwe. Skontaktuj sie z administratorem w celu zainstalowania.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Ostrzeżenie:</b> Wsparcie dla FTP w PHP nie jest zainstalowane lub włączone. Skontaktuj sie z administratorem w celu zainstalowania lub włączenia go.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Ostrzeżenie:</b> Wsparcie dla Curl w PHP nie jest zainstalowane lub włączone. Montowanie WebDAV lub GoogleDrive nie będzie możliwe. Skontaktuj się z administratorem w celu zainstalowania lub włączenia tej opcji.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Użytkownicy",
"Delete" => "Usuń",
"Enable User External Storage" => "Włącz zewnętrzne zasoby dyskowe użytkownika",
-"Allow users to mount their own external storage" => "Zezwalaj użytkownikom na montowanie ich własnych zewnętrznych zasobów dyskowych",
+"Allow users to mount the following external storage" => "Pozwól użytkownikom montować następujące zewnętrzne zasoby dyskowe",
"SSL root certificates" => "Główny certyfikat SSL",
"Import Root Certificate" => "Importuj główny certyfikat"
);
diff --git a/apps/files_external/l10n/pt_BR.php b/apps/files_external/l10n/pt_BR.php
index f69bbc1ebe6..fbb945c5439 100644
--- a/apps/files_external/l10n/pt_BR.php
+++ b/apps/files_external/l10n/pt_BR.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Permitir acesso",
"Please provide a valid Dropbox app key and secret." => "Por favor forneça um app key e secret válido do Dropbox",
"Error configuring Google Drive storage" => "Erro ao configurar armazenamento do Google Drive",
+"Saved" => "Salvo",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Aviso:</b> \"smbclient\" não está instalado. Impossível montar compartilhamentos de CIFS/SMB. Por favor, peça ao seu administrador do sistema para instalá-lo.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Aviso:</b> O suporte para FTP do PHP não está ativado ou instalado. Impossível montar compartilhamentos FTP. Por favor, peça ao seu administrador do sistema para instalá-lo.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b> Aviso: </b> O suport a Curl em PHP não está habilitado ou instalado. A montagem do ownCloud / WebDAV ou GoogleDrive não é possível. Por favor, solicite ao seu administrador do sistema instalá-lo.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Usuários",
"Delete" => "Excluir",
"Enable User External Storage" => "Habilitar Armazenamento Externo do Usuário",
-"Allow users to mount their own external storage" => "Permitir usuários a montar seus próprios armazenamentos externos",
+"Allow users to mount the following external storage" => "Permitir que usuários montem o seguinte armazenamento externo",
"SSL root certificates" => "Certificados SSL raíz",
"Import Root Certificate" => "Importar Certificado Raíz"
);
diff --git a/apps/files_external/l10n/pt_PT.php b/apps/files_external/l10n/pt_PT.php
index 3f2afd33f07..eb4d8feb41a 100644
--- a/apps/files_external/l10n/pt_PT.php
+++ b/apps/files_external/l10n/pt_PT.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Conceder acesso",
"Please provide a valid Dropbox app key and secret." => "Por favor forneça uma \"app key\" e \"secret\" do Dropbox válidas.",
"Error configuring Google Drive storage" => "Erro ao configurar o armazenamento do Google Drive",
+"Saved" => "Guardado",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Atenção:</b> O cliente \"smbclient\" não está instalado. Não é possível montar as partilhas CIFS/SMB . Peça ao seu administrador para instalar.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Aviso:</b> O suporte FTP no PHP não está activate ou instalado. Não é possível montar as partilhas FTP. Peça ao seu administrador para instalar.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Atenção:<br> O suporte PHP para o Curl não está activado ou instalado. A montagem do ownCloud/WebDav ou GoolgeDriver não é possível. Por favor contacte o administrador para o instalar.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Utilizadores",
"Delete" => "Eliminar",
"Enable User External Storage" => "Activar Armazenamento Externo para o Utilizador",
-"Allow users to mount their own external storage" => "Permitir que os utilizadores montem o seu próprio armazenamento externo",
+"Allow users to mount the following external storage" => "Permitir que os utilizadores montem o seguinte armazenamento externo",
"SSL root certificates" => "Certificados SSL de raiz",
"Import Root Certificate" => "Importar Certificado Root"
);
diff --git a/apps/files_external/l10n/ro.php b/apps/files_external/l10n/ro.php
index 7115d09ea94..a90b0299e17 100644
--- a/apps/files_external/l10n/ro.php
+++ b/apps/files_external/l10n/ro.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Permite accesul",
"Please provide a valid Dropbox app key and secret." => "Prezintă te rog o cheie de Dropbox validă și parola",
"Error configuring Google Drive storage" => "Eroare la configurarea mediului de stocare Google Drive",
+"Saved" => "Salvat",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Atenție:</b> \"smbclient\" nu este instalat. Montarea mediilor CIFS/SMB partajate nu este posibilă. Solicită administratorului sistemului tău să îl instaleaze.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Atenție:</b> suportul pentru FTP în PHP nu este activat sau instalat. Montarea mediilor FPT partajate nu este posibilă. Solicită administratorului sistemului tău să îl instaleze.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Atentie:</b> Suportul Curl nu este pornit / instalat in configuratia PHP! Montarea ownCloud / WebDAV / GoogleDrive nu este posibila! Intrebati administratorul sistemului despre aceasta problema!",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Utilizatori",
"Delete" => "Șterge",
"Enable User External Storage" => "Permite stocare externă pentru utilizatori",
-"Allow users to mount their own external storage" => "Permite utilizatorilor să monteze stocare externă proprie",
+"Allow users to mount the following external storage" => "Permite utilizatorilor să monteze următoarea unitate de stocare",
"SSL root certificates" => "Certificate SSL root",
"Import Root Certificate" => "Importă certificat root"
);
diff --git a/apps/files_external/l10n/ru.php b/apps/files_external/l10n/ru.php
index 50c25acba06..8ed437839cd 100644
--- a/apps/files_external/l10n/ru.php
+++ b/apps/files_external/l10n/ru.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Предоставление доступа",
"Please provide a valid Dropbox app key and secret." => "Пожалуйста, предоставьте действующий ключ Dropbox и пароль.",
"Error configuring Google Drive storage" => "Ошибка при настройке хранилища Google Drive",
+"Saved" => "Сохранено",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Внимание:</b> \"smbclient\" не установлен. Подключение по CIFS/SMB невозможно. Пожалуйста, обратитесь к системному администратору, чтобы установить его.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Внимание:</b> Поддержка FTP не включена в PHP. Подключение по FTP невозможно. Пожалуйста, обратитесь к системному администратору, чтобы включить.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Внимание:</b> Поддержка Curl в PHP не включена или не установлена. Подключение ownCloud / WebDAV или GoogleDrive невозможно. Попросите вашего системного администратора установить его.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Пользователи",
"Delete" => "Удалить",
"Enable User External Storage" => "Включить пользовательские внешние носители",
-"Allow users to mount their own external storage" => "Разрешить пользователям монтировать их собственные внешние носители",
+"Allow users to mount the following external storage" => "Разрешить пользователям монтировать следующую внешнюю систему хранения данных",
"SSL root certificates" => "Корневые сертификаты SSL",
"Import Root Certificate" => "Импортировать корневые сертификаты"
);
diff --git a/apps/files_external/l10n/si_LK.php b/apps/files_external/l10n/si_LK.php
index cad928accef..ac41f596340 100644
--- a/apps/files_external/l10n/si_LK.php
+++ b/apps/files_external/l10n/si_LK.php
@@ -16,7 +16,6 @@ $TRANSLATIONS = array(
"Users" => "පරිශීලකයන්",
"Delete" => "මකා දමන්න",
"Enable User External Storage" => "පරිශීලක භාහිර ගබඩාවන් සක්‍රිය කරන්න",
-"Allow users to mount their own external storage" => "පරිශීලකයන්ට තමාගේම භාහිර ගබඩාවන් මවුන්ට් කිරීමේ අයිතිය දෙන්න",
"SSL root certificates" => "SSL මූල සහතිකයන්",
"Import Root Certificate" => "මූල සහතිකය ආයාත කරන්න"
);
diff --git a/apps/files_external/l10n/sk_SK.php b/apps/files_external/l10n/sk_SK.php
index 664d97c43b2..aa288982576 100644
--- a/apps/files_external/l10n/sk_SK.php
+++ b/apps/files_external/l10n/sk_SK.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Používatelia",
"Delete" => "Zmazať",
"Enable User External Storage" => "Povoliť externé úložisko",
-"Allow users to mount their own external storage" => "Povoliť používateľom pripojiť si vlastné externé úložisko",
"SSL root certificates" => "Koreňové SSL certifikáty",
"Import Root Certificate" => "Importovať koreňový certifikát"
);
diff --git a/apps/files_external/l10n/sl.php b/apps/files_external/l10n/sl.php
index b0fcbf9eb69..05e626fcf83 100644
--- a/apps/files_external/l10n/sl.php
+++ b/apps/files_external/l10n/sl.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Odobri dostop",
"Please provide a valid Dropbox app key and secret." => "Vpisati je treba veljaven ključ programa in kodo za Dropbox",
"Error configuring Google Drive storage" => "Napaka nastavljanja shrambe Google Drive",
+"Saved" => "Shranjeno",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Opozorilo:</b> paket \"smbclient\" ni nameščen. Priklapljanje pogonov CIFS/SMB ne bo mogoče.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Opozorilo:</b> podpora FTP v PHP ni omogočena ali pa ni nameščena. Priklapljanje pogonov FTP zato ne bo mogoče.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Opozorilo:</b> podpora za Curl v PHP ni omogočena ali pa ni nameščena. Priklapljanje točke ownCloud / WebDAV ali GoogleDrive zato ne bo mogoče. Zahtevane pakete je treba pred uporabo namestiti.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Uporabniki",
"Delete" => "Izbriši",
"Enable User External Storage" => "Omogoči zunanjo uporabniško podatkovno shrambo",
-"Allow users to mount their own external storage" => "Dovoli uporabnikom priklop lastne zunanje podatkovne shrambe",
+"Allow users to mount the following external storage" => "Dovoli uporabnikom priklapljanje navedenih zunanjih shramb.",
"SSL root certificates" => "Korenska potrdila SSL",
"Import Root Certificate" => "Uvozi korensko potrdilo"
);
diff --git a/apps/files_external/l10n/sv.php b/apps/files_external/l10n/sv.php
index 2c0b0ab69e4..183df674b9d 100644
--- a/apps/files_external/l10n/sv.php
+++ b/apps/files_external/l10n/sv.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Användare",
"Delete" => "Radera",
"Enable User External Storage" => "Aktivera extern lagring för användare",
-"Allow users to mount their own external storage" => "Tillåt användare att montera egen extern lagring",
"SSL root certificates" => "SSL rotcertifikat",
"Import Root Certificate" => "Importera rotcertifikat"
);
diff --git a/apps/files_external/l10n/ta_LK.php b/apps/files_external/l10n/ta_LK.php
index bb663a4fcb6..94ddaf9c5e1 100644
--- a/apps/files_external/l10n/ta_LK.php
+++ b/apps/files_external/l10n/ta_LK.php
@@ -16,7 +16,6 @@ $TRANSLATIONS = array(
"Users" => "பயனாளர்",
"Delete" => "நீக்குக",
"Enable User External Storage" => "பயனாளர் வெளி சேமிப்பை இயலுமைப்படுத்துக",
-"Allow users to mount their own external storage" => "பயனாளர் அவர்களுடைய சொந்த வெளியக சேமிப்பை ஏற்ற அனுமதிக்க",
"SSL root certificates" => "SSL வேர் சான்றிதழ்கள்",
"Import Root Certificate" => "வேர் சான்றிதழை இறக்குமதி செய்க"
);
diff --git a/apps/files_external/l10n/th_TH.php b/apps/files_external/l10n/th_TH.php
index f2ea35f10f4..a1a56a4d2e4 100644
--- a/apps/files_external/l10n/th_TH.php
+++ b/apps/files_external/l10n/th_TH.php
@@ -18,7 +18,6 @@ $TRANSLATIONS = array(
"Users" => "ผู้ใช้งาน",
"Delete" => "ลบ",
"Enable User External Storage" => "เปิดให้มีการใช้พื้นที่จัดเก็บข้อมูลของผู้ใช้งานจากภายนอกได้",
-"Allow users to mount their own external storage" => "อนุญาตให้ผู้ใช้งานสามารถชี้ตำแหน่งไปที่พื้นที่จัดเก็บข้อมูลภายนอกของตนเองได้",
"SSL root certificates" => "ใบรับรองความปลอดภัยด้วยระบบ SSL จาก Root",
"Import Root Certificate" => "นำเข้าข้อมูลใบรับรองความปลอดภัยจาก Root"
);
diff --git a/apps/files_external/l10n/tr.php b/apps/files_external/l10n/tr.php
index 5d5e2b726a9..a835d6f174a 100644
--- a/apps/files_external/l10n/tr.php
+++ b/apps/files_external/l10n/tr.php
@@ -5,6 +5,7 @@ $TRANSLATIONS = array(
"Grant access" => "Erişim sağlandı",
"Please provide a valid Dropbox app key and secret." => "Lütfen Dropbox app key ve secret temin ediniz",
"Error configuring Google Drive storage" => "Google Drive depo yapılandırma hatası",
+"Saved" => "Kaydedildi",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Uyarı:</b> \"smbclient\" kurulu değil. CIFS/SMB paylaşımlarını bağlama işlemi mümkün olmadı. Lütfen kurulumu için sistem yöneticinize danışın.",
"<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it." => "<b>Uyarı:</b> PHP içerisinde FTP desteği etkin veya yüklü değil. FTP paylaşımlarını bağlama işlemi mümkün olmadı. Lütfen kurulumu için sistem yöneticinize danışın.",
"<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it." => "<b>Uyarı:</b> PHP içerisinde Curl desteği etkin veya yüklü değil. OwnCloud / WebDAV veya GoogleDrive bağlama işlemi mümkün olmadı. Lütfen kurulumu için sistem yöneticinizde danışın.",
@@ -21,7 +22,7 @@ $TRANSLATIONS = array(
"Users" => "Kullanıcılar",
"Delete" => "Sil",
"Enable User External Storage" => "Kullanıcılar için Harici Depolamayı Etkinleştir",
-"Allow users to mount their own external storage" => "Kullanıcıların kendi harici depolamalarını bağlamalarına izin ver",
+"Allow users to mount the following external storage" => "Kullanıcıların aşağıdaki harici depolamayı bağlamalarına izin ver",
"SSL root certificates" => "SSL kök sertifikaları",
"Import Root Certificate" => "Kök Sertifikalarını İçe Aktar"
);
diff --git a/apps/files_external/l10n/uk.php b/apps/files_external/l10n/uk.php
index e535b455d10..a7c028aa935 100644
--- a/apps/files_external/l10n/uk.php
+++ b/apps/files_external/l10n/uk.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Користувачі",
"Delete" => "Видалити",
"Enable User External Storage" => "Активувати користувацькі зовнішні сховища",
-"Allow users to mount their own external storage" => "Дозволити користувачам монтувати власні зовнішні сховища",
"SSL root certificates" => "SSL корневі сертифікати",
"Import Root Certificate" => "Імпортувати корневі сертифікати"
);
diff --git a/apps/files_external/l10n/vi.php b/apps/files_external/l10n/vi.php
index da8ac419cda..5fd00dc2bf5 100644
--- a/apps/files_external/l10n/vi.php
+++ b/apps/files_external/l10n/vi.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "Người dùng",
"Delete" => "Xóa",
"Enable User External Storage" => "Kích hoạt tính năng lưu trữ ngoài",
-"Allow users to mount their own external storage" => "Cho phép người dùng kết nối với lưu trữ riêng bên ngoài của họ",
"SSL root certificates" => "Chứng chỉ SSL root",
"Import Root Certificate" => "Nhập Root Certificate"
);
diff --git a/apps/files_external/l10n/zh_CN.php b/apps/files_external/l10n/zh_CN.php
index 5e2c2e4fe0c..bb85d0e4f49 100644
--- a/apps/files_external/l10n/zh_CN.php
+++ b/apps/files_external/l10n/zh_CN.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "用户",
"Delete" => "删除",
"Enable User External Storage" => "启用用户外部存储",
-"Allow users to mount their own external storage" => "允许用户挂载自有外部存储",
"SSL root certificates" => "SSL根证书",
"Import Root Certificate" => "导入根证书"
);
diff --git a/apps/files_external/l10n/zh_TW.php b/apps/files_external/l10n/zh_TW.php
index d85d18a1c32..7c256cd2ab7 100644
--- a/apps/files_external/l10n/zh_TW.php
+++ b/apps/files_external/l10n/zh_TW.php
@@ -21,7 +21,6 @@ $TRANSLATIONS = array(
"Users" => "使用者",
"Delete" => "刪除",
"Enable User External Storage" => "啓用使用者外部儲存",
-"Allow users to mount their own external storage" => "允許使用者自行掛載他們的外部儲存",
"SSL root certificates" => "SSL 根憑證",
"Import Root Certificate" => "匯入根憑證"
);
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 43275d36c06..472c3963d51 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -4,6 +4,8 @@
*
* @author Michael Gapczynski
* @copyright 2012 Michael Gapczynski mtgap@owncloud.com
+* @copyright 2014 Vincent Petry <pvince81@owncloud.com>
+* @copyright 2014 Robin McCorkell <rmccorkell@karoshi.org.uk>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
@@ -19,15 +21,24 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
+set_include_path(
+ get_include_path() . PATH_SEPARATOR .
+ \OC_App::getAppPath('files_external') . '/3rdparty/phpseclib/phpseclib'
+);
+
/**
-* Class to configure the config/mount.php and data/$user/mount.php files
-*/
+ * Class to configure mount.json globally and for users
+ */
class OC_Mount_Config {
+ // TODO: make this class non-static and give it a proper namespace
const MOUNT_TYPE_GLOBAL = 'global';
const MOUNT_TYPE_GROUP = 'group';
const MOUNT_TYPE_USER = 'user';
+ // whether to skip backend test (for unit tests, as this static class is not mockable)
+ public static $skipTest = false;
+
/**
* Get details on each of the external storage backends, used for the mount config UI
* If a custom UI is needed, add the key 'custom' and a javascript file with that name will be loaded
@@ -39,13 +50,14 @@ class OC_Mount_Config {
*/
public static function getBackends() {
+ // FIXME: do not rely on php key order for the options order in the UI
$backends['\OC\Files\Storage\Local']=array(
'backend' => 'Local',
'configuration' => array(
'datadir' => 'Location'));
$backends['\OC\Files\Storage\AmazonS3']=array(
- 'backend' => 'Amazon S3',
+ 'backend' => 'Amazon S3 and compliant',
'configuration' => array(
'key' => 'Access Key',
'secret' => '*Secret Key',
@@ -111,11 +123,18 @@ class OC_Mount_Config {
'password' => '*Password',
'share' => 'Share',
'root' => '&Root'));
+ $backends['\OC\Files\Storage\SMB_OC'] = array(
+ 'backend' => 'SMB / CIFS using OC login',
+ 'configuration' => array(
+ 'host' => 'URL',
+ 'username_as_share' => '!Username as share',
+ 'share' => '&Share',
+ 'root' => '&Root'));
}
}
if(OC_Mount_Config::checkcurl()){
- $backends['\OC\Files\Storage\DAV']=array(
+ $backends['\OC\Files\Storage\DAV']=array(
'backend' => 'WebDAV',
'configuration' => array(
'host' => 'URL',
@@ -123,7 +142,7 @@ class OC_Mount_Config {
'password' => '*Password',
'root' => '&Root',
'secure' => '!Secure https://'));
- $backends['\OC\Files\Storage\OwnCloud']=array(
+ $backends['\OC\Files\Storage\OwnCloud']=array(
'backend' => 'ownCloud',
'configuration' => array(
'host' => 'URL',
@@ -156,6 +175,125 @@ class OC_Mount_Config {
}
/**
+ * Hook that mounts the given user's visible mount points
+ * @param array $data
+ */
+ public static function initMountPointsHook($data) {
+ $mountPoints = self::getAbsoluteMountPoints($data['user']);
+ foreach ($mountPoints as $mountPoint => $options) {
+ \OC\Files\Filesystem::mount($options['class'], $options['options'], $mountPoint);
+ }
+ }
+
+ /**
+ * Returns the mount points for the given user.
+ * The mount point is relative to the data directory.
+ *
+ * @param string $user user
+ * @return array of mount point string as key, mountpoint config as value
+ */
+ public static function getAbsoluteMountPoints($user) {
+ $mountPoints = array();
+
+ $datadir = \OC_Config::getValue("datadirectory", \OC::$SERVERROOT . "/data");
+ $mount_file = \OC_Config::getValue("mount_file", $datadir . "/mount.json");
+
+ //move config file to it's new position
+ if (is_file(\OC::$SERVERROOT . '/config/mount.json')) {
+ rename(\OC::$SERVERROOT . '/config/mount.json', $mount_file);
+ }
+
+ // Load system mount points
+ $mountConfig = self::readData(false);
+ if (isset($mountConfig[self::MOUNT_TYPE_GLOBAL])) {
+ foreach ($mountConfig[self::MOUNT_TYPE_GLOBAL] as $mountPoint => $options) {
+ $options['options'] = self::decryptPasswords($options['options']);
+ $mountPoints[$mountPoint] = $options;
+ }
+ }
+ if (isset($mountConfig[self::MOUNT_TYPE_GROUP])) {
+ foreach ($mountConfig[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
+ if (\OC_Group::inGroup($user, $group)) {
+ foreach ($mounts as $mountPoint => $options) {
+ $mountPoint = self::setUserVars($user, $mountPoint);
+ foreach ($options as &$option) {
+ $option = self::setUserVars($user, $option);
+ }
+ $options['options'] = self::decryptPasswords($options['options']);
+ $mountPoints[$mountPoint] = $options;
+ }
+ }
+ }
+ }
+ if (isset($mountConfig[self::MOUNT_TYPE_USER])) {
+ foreach ($mountConfig[self::MOUNT_TYPE_USER] as $mountUser => $mounts) {
+ if ($mountUser === 'all' or strtolower($mountUser) === strtolower($user)) {
+ foreach ($mounts as $mountPoint => $options) {
+ $mountPoint = self::setUserVars($user, $mountPoint);
+ foreach ($options as &$option) {
+ $option = self::setUserVars($user, $option);
+ }
+ $options['options'] = self::decryptPasswords($options['options']);
+ $mountPoints[$mountPoint] = $options;
+ }
+ }
+ }
+ }
+
+ // Load personal mount points
+ $mountConfig = self::readData(true);
+ if (isset($mountConfig[self::MOUNT_TYPE_USER][$user])) {
+ foreach ($mountConfig[self::MOUNT_TYPE_USER][$user] as $mountPoint => $options) {
+ $options['options'] = self::decryptPasswords($options['options']);
+ $mountPoints[$mountPoint] = $options;
+ }
+ }
+
+ return $mountPoints;
+ }
+
+ /**
+ * fill in the correct values for $user
+ *
+ * @param string $user
+ * @param string $input
+ * @return string
+ */
+ private static function setUserVars($user, $input) {
+ return str_replace('$user', $user, $input);
+ }
+
+
+ /**
+ * Get details on each of the external storage backends, used for the mount config UI
+ * Some backends are not available as a personal backend, f.e. Local and such that have
+ * been disabled by the admin.
+ *
+ * If a custom UI is needed, add the key 'custom' and a javascript file with that name will be loaded
+ * If the configuration parameter should be secret, add a '*' to the beginning of the value
+ * If the configuration parameter is a boolean, add a '!' to the beginning of the value
+ * If the configuration parameter is optional, add a '&' to the beginning of the value
+ * If the configuration parameter is hidden, add a '#' to the beginning of the value
+ * @return array
+ */
+ public static function getPersonalBackends() {
+
+ $backends = self::getBackends();
+
+ // Remove local storage and other disabled storages
+ unset($backends['\OC\Files\Storage\Local']);
+
+ $allowed_backends = explode(',', OCP\Config::getAppValue('files_external', 'user_mounting_backends', ''));
+ foreach ($backends as $backend => $null) {
+ if (!in_array($backend, $allowed_backends)) {
+ unset($backends[$backend]);
+ }
+ }
+
+ return $backends;
+ }
+
+ /**
* Get the system mount points
* The returned array is not in the same format as getUserMountPoints()
* @return array
@@ -171,20 +309,26 @@ class OC_Mount_Config {
if (strpos($mount['class'], 'OC_Filestorage_') !== false) {
$mount['class'] = '\OC\Files\Storage\\'.substr($mount['class'], 15);
}
+ $mount['options'] = self::decryptPasswords($mount['options']);
// Remove '/$user/files/' from mount point
$mountPoint = substr($mountPoint, 13);
- // Merge the mount point into the current mount points
- if (isset($system[$mountPoint]) && $system[$mountPoint]['configuration'] == $mount['options']) {
- $system[$mountPoint]['applicable']['groups']
- = array_merge($system[$mountPoint]['applicable']['groups'], array($group));
+
+ $config = array(
+ 'class' => $mount['class'],
+ 'mountpoint' => $mountPoint,
+ 'backend' => $backends[$mount['class']]['backend'],
+ 'options' => $mount['options'],
+ 'applicable' => array('groups' => array($group), 'users' => array()),
+ 'status' => self::getBackendStatus($mount['class'], $mount['options'], false)
+ );
+ $hash = self::makeConfigHash($config);
+ // If an existing config exists (with same class, mountpoint and options)
+ if (isset($system[$hash])) {
+ // add the groups into that config
+ $system[$hash]['applicable']['groups']
+ = array_merge($system[$hash]['applicable']['groups'], array($group));
} else {
- $system[$mountPoint] = array(
- 'class' => $mount['class'],
- 'backend' => $backends[$mount['class']]['backend'],
- 'configuration' => $mount['options'],
- 'applicable' => array('groups' => array($group), 'users' => array()),
- 'status' => self::getBackendStatus($mount['class'], $mount['options'])
- );
+ $system[$hash] = $config;
}
}
}
@@ -196,25 +340,30 @@ class OC_Mount_Config {
if (strpos($mount['class'], 'OC_Filestorage_') !== false) {
$mount['class'] = '\OC\Files\Storage\\'.substr($mount['class'], 15);
}
+ $mount['options'] = self::decryptPasswords($mount['options']);
// Remove '/$user/files/' from mount point
$mountPoint = substr($mountPoint, 13);
- // Merge the mount point into the current mount points
- if (isset($system[$mountPoint]) && $system[$mountPoint]['configuration'] == $mount['options']) {
- $system[$mountPoint]['applicable']['users']
- = array_merge($system[$mountPoint]['applicable']['users'], array($user));
+ $config = array(
+ 'class' => $mount['class'],
+ 'mountpoint' => $mountPoint,
+ 'backend' => $backends[$mount['class']]['backend'],
+ 'options' => $mount['options'],
+ 'applicable' => array('groups' => array(), 'users' => array($user)),
+ 'status' => self::getBackendStatus($mount['class'], $mount['options'], false)
+ );
+ $hash = self::makeConfigHash($config);
+ // If an existing config exists (with same class, mountpoint and options)
+ if (isset($system[$hash])) {
+ // add the users into that config
+ $system[$hash]['applicable']['users']
+ = array_merge($system[$hash]['applicable']['users'], array($user));
} else {
- $system[$mountPoint] = array(
- 'class' => $mount['class'],
- 'backend' => $backends[$mount['class']]['backend'],
- 'configuration' => $mount['options'],
- 'applicable' => array('groups' => array(), 'users' => array($user)),
- 'status' => self::getBackendStatus($mount['class'], $mount['options'])
- );
+ $system[$hash] = $config;
}
}
}
}
- return $system;
+ return array_values($system);
}
/**
@@ -233,26 +382,37 @@ class OC_Mount_Config {
if (strpos($mount['class'], 'OC_Filestorage_') !== false) {
$mount['class'] = '\OC\Files\Storage\\'.substr($mount['class'], 15);
}
- // Remove '/uid/files/' from mount point
- $personal[substr($mountPoint, strlen($uid) + 8)] = array(
+ $mount['options'] = self::decryptPasswords($mount['options']);
+ $personal[] = array(
'class' => $mount['class'],
+ // Remove '/uid/files/' from mount point
+ 'mountpoint' => substr($mountPoint, strlen($uid) + 8),
'backend' => $backends[$mount['class']]['backend'],
- 'configuration' => $mount['options'],
- 'status' => self::getBackendStatus($mount['class'], $mount['options'])
+ 'options' => $mount['options'],
+ 'status' => self::getBackendStatus($mount['class'], $mount['options'], true)
);
}
}
return $personal;
}
- private static function getBackendStatus($class, $options) {
+ /**
+ * Test connecting using the given backend configuration
+ * @param string $class backend class name
+ * @param array $options backend configuration options
+ * @return bool true if the connection succeeded, false otherwise
+ */
+ private static function getBackendStatus($class, $options, $isPersonal) {
+ if (self::$skipTest) {
+ return true;
+ }
foreach ($options as &$option) {
- $option = str_replace('$user', OCP\User::getUser(), $option);
+ $option = self::setUserVars(OCP\User::getUser(), $option);
}
if (class_exists($class)) {
try {
$storage = new $class($options);
- return $storage->test();
+ return $storage->test($isPersonal);
} catch (Exception $exception) {
\OCP\Util::logException('files_external', $exception);
return false;
@@ -287,18 +447,25 @@ class OC_Mount_Config {
if (!isset($backends[$class])) {
// invalid backend
return false;
- }
+ }
if ($isPersonal) {
// Verify that the mount point applies for the current user
- // Prevent non-admin users from mounting local storage
- if ($applicable !== OCP\User::getUser() || strtolower($class) === '\oc\files\storage\local') {
+ // Prevent non-admin users from mounting local storage and other disabled backends
+ $allowed_backends = self::getPersonalBackends();
+ if ($applicable != OCP\User::getUser() || !isset($allowed_backends[$class])) {
return false;
}
$mountPoint = '/'.$applicable.'/files/'.ltrim($mountPoint, '/');
} else {
$mountPoint = '/$user/files/'.ltrim($mountPoint, '/');
}
- $mount = array($applicable => array($mountPoint => array('class' => $class, 'options' => $classOptions)));
+
+ $mount = array($applicable => array(
+ $mountPoint => array(
+ 'class' => $class,
+ 'options' => self::encryptPasswords($classOptions))
+ )
+ );
$mountPoints = self::readData($isPersonal);
// Merge the new mount point into the current mount points
if (isset($mountPoints[$mountType])) {
@@ -312,7 +479,7 @@ class OC_Mount_Config {
$mountPoints[$mountType] = $mount;
}
self::writeData($isPersonal, $mountPoints);
- return self::getBackendStatus($class, $classOptions);
+ return self::getBackendStatus($class, $classOptions, $isPersonal);
}
/**
@@ -389,7 +556,12 @@ class OC_Mount_Config {
$datadir = \OC_Config::getValue('datadirectory', \OC::$SERVERROOT . '/data/');
$file = \OC_Config::getValue('mount_file', $datadir . '/mount.json');
}
- $content = json_encode($data);
+ $options = 0;
+ if (defined('JSON_PRETTY_PRINT')) {
+ // only for PHP >= 5.4
+ $options = JSON_PRETTY_PRINT;
+ }
+ $content = json_encode($data, $options);
@file_put_contents($file, $content);
@chmod($file, 0640);
}
@@ -446,7 +618,7 @@ class OC_Mount_Config {
*/
public static function checksmbclient() {
if(function_exists('shell_exec')) {
- $output=shell_exec('which smbclient 2> /dev/null');
+ $output=shell_exec('command -v smbclient 2> /dev/null');
return !empty($output);
}else{
return false;
@@ -491,4 +663,87 @@ class OC_Mount_Config {
return $txt;
}
+
+ /**
+ * Encrypt passwords in the given config options
+ * @param array $options mount options
+ * @return array updated options
+ */
+ private static function encryptPasswords($options) {
+ if (isset($options['password'])) {
+ $options['password_encrypted'] = self::encryptPassword($options['password']);
+ // do not unset the password, we want to keep the keys order
+ // on load... because that's how the UI currently works
+ $options['password'] = '';
+ }
+ return $options;
+ }
+
+ /**
+ * Decrypt passwords in the given config options
+ * @param array $options mount options
+ * @return array updated options
+ */
+ private static function decryptPasswords($options) {
+ // note: legacy options might still have the unencrypted password in the "password" field
+ if (isset($options['password_encrypted'])) {
+ $options['password'] = self::decryptPassword($options['password_encrypted']);
+ unset($options['password_encrypted']);
+ }
+ return $options;
+ }
+
+ /**
+ * Encrypt a single password
+ * @param string $password plain text password
+ * @return encrypted password
+ */
+ private static function encryptPassword($password) {
+ $cipher = self::getCipher();
+ $iv = \OCP\Util::generateRandomBytes(16);
+ $cipher->setIV($iv);
+ return base64_encode($iv . $cipher->encrypt($password));
+ }
+
+ /**
+ * Decrypts a single password
+ * @param string $encryptedPassword encrypted password
+ * @return plain text password
+ */
+ private static function decryptPassword($encryptedPassword) {
+ $cipher = self::getCipher();
+ $binaryPassword = base64_decode($encryptedPassword);
+ $iv = substr($binaryPassword, 0, 16);
+ $cipher->setIV($iv);
+ $binaryPassword = substr($binaryPassword, 16);
+ return $cipher->decrypt($binaryPassword);
+ }
+
+ /**
+ * Returns the encryption cipher
+ */
+ private static function getCipher() {
+ if (!class_exists('Crypt_AES', false)) {
+ include('Crypt/AES.php');
+ }
+ $cipher = new Crypt_AES(CRYPT_AES_MODE_CBC);
+ $cipher->setKey(\OCP\Config::getSystemValue('passwordsalt'));
+ return $cipher;
+ }
+
+ /**
+ * Computes a hash based on the given configuration.
+ * This is mostly used to find out whether configurations
+ * are the same.
+ */
+ private static function makeConfigHash($config) {
+ $data = json_encode(
+ array(
+ 'c' => $config['class'],
+ 'm' => $config['mountpoint'],
+ 'o' => $config['options']
+ )
+ );
+ return hash('md5', $data);
+ }
}
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index c5fba92ee68..f3f3b3ed7f3 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -37,7 +37,7 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
$this->share = substr($this->share, 0, -1);
}
} else {
- throw new \Exception();
+ throw new \Exception('Invalid configuration');
}
}
diff --git a/apps/files_external/lib/smb_oc.php b/apps/files_external/lib/smb_oc.php
new file mode 100644
index 00000000000..0c79c06c5df
--- /dev/null
+++ b/apps/files_external/lib/smb_oc.php
@@ -0,0 +1,93 @@
+<?php
+/**
+ * Copyright (c) 2014 Robin McCorkell <rmccorkell@karoshi.org.uk>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\Files\Storage;
+
+require_once __DIR__ . '/../3rdparty/smb4php/smb.php';
+
+class SMB_OC extends \OC\Files\Storage\SMB {
+ private $username_as_share;
+
+ public function __construct($params) {
+ if (isset($params['host']) && \OC::$session->exists('smb-credentials')) {
+ $host=$params['host'];
+ $this->username_as_share = ($params['username_as_share'] === 'true');
+
+ $params_auth = \OC::$session->get('smb-credentials');
+ $user = \OC::$session->get('loginname');
+ $password = $params_auth['password'];
+
+ $root=isset($params['root'])?$params['root']:'/';
+ $share = '';
+
+ if ($this->username_as_share) {
+ $share = '/'.$user;
+ } elseif (isset($params['share'])) {
+ $share = $params['share'];
+ } else {
+ throw new \Exception();
+ }
+ parent::__construct(array(
+ "user" => $user,
+ "password" => $password,
+ "host" => $host,
+ "share" => $share,
+ "root" => $root
+ ));
+ } else {
+ throw new \Exception();
+ }
+ }
+
+ public static function login( $params ) {
+ \OC::$session->set('smb-credentials', $params);
+ }
+
+ public function isSharable($path) {
+ return false;
+ }
+
+ public function test($isPersonal = true) {
+ if ($isPersonal) {
+ if ($this->stat('')) {
+ return true;
+ }
+ return false;
+ } else {
+ $smb = new \smb();
+ $pu = $smb->parse_url($this->constructUrl(''));
+
+ // Attempt to connect anonymously
+ $pu['user'] = '';
+ $pu['pass'] = '';
+
+ // Share cannot be checked if dynamic
+ if ($this->username_as_share) {
+ if ($smb->look($pu)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ if (!$pu['share']) {
+ return false;
+ }
+
+ // The following error messages are expected due to anonymous login
+ $regexp = array(
+ '(NT_STATUS_ACCESS_DENIED)' => 'skip'
+ ) + $smb->getRegexp();
+
+ if ($smb->client("-d 0 " . escapeshellarg('//' . $pu['host'] . '/' . $pu['share']) . " -c exit", $pu, $regexp)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+}
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php
index 7a56fcfc8b7..1337d9f581d 100644
--- a/apps/files_external/lib/swift.php
+++ b/apps/files_external/lib/swift.php
@@ -251,6 +251,10 @@ class Swift extends \OC\Files\Storage\Common {
$mtime = $object->extra_headers['X-Object-Meta-Timestamp'];
}
+ if (!empty($mtime)) {
+ $mtime = floor($mtime);
+ }
+
$stat = array();
$stat['size'] = $object->content_length;
$stat['mtime'] = $mtime;
@@ -370,7 +374,7 @@ class Swift extends \OC\Files\Storage\Common {
'X-Object-Meta-Timestamp' => $mtime
)
);
- return $object->Update($settings);
+ return $object->UpdateMetadata($settings);
} else {
$object = $this->container->DataObject();
if (is_null($mtime)) {
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index 9afe73aebd7..279ae716935 100644
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -8,7 +8,7 @@
namespace OC\Files\Storage;
-class DAV extends \OC\Files\Storage\Common{
+class DAV extends \OC\Files\Storage\Common {
private $password;
private $user;
private $host;
@@ -21,7 +21,7 @@ class DAV extends \OC\Files\Storage\Common{
*/
private $client;
- private static $tempFiles=array();
+ private static $tempFiles = array();
public function __construct($params) {
if (isset($params['host']) && isset($params['user']) && isset($params['password'])) {
@@ -29,9 +29,9 @@ class DAV extends \OC\Files\Storage\Common{
//remove leading http[s], will be generated in createBaseUri()
if (substr($host, 0, 8) == "https://") $host = substr($host, 8);
else if (substr($host, 0, 7) == "http://") $host = substr($host, 7);
- $this->host=$host;
- $this->user=$params['user'];
- $this->password=$params['password'];
+ $this->host = $host;
+ $this->user = $params['user'];
+ $this->password = $params['password'];
if (isset($params['secure'])) {
if (is_string($params['secure'])) {
$this->secure = ($params['secure'] === 'true');
@@ -42,25 +42,25 @@ class DAV extends \OC\Files\Storage\Common{
$this->secure = false;
}
if ($this->secure === true) {
- $certPath=\OC_User::getHome(\OC_User::getUser()) . '/files_external/rootcerts.crt';
+ $certPath = \OC_User::getHome(\OC_User::getUser()) . '/files_external/rootcerts.crt';
if (file_exists($certPath)) {
- $this->certPath=$certPath;
+ $this->certPath = $certPath;
}
}
- $this->root=isset($params['root'])?$params['root']:'/';
- if ( ! $this->root || $this->root[0]!='/') {
- $this->root='/'.$this->root;
+ $this->root = isset($params['root']) ? $params['root'] : '/';
+ if (!$this->root || $this->root[0] != '/') {
+ $this->root = '/' . $this->root;
}
- if (substr($this->root, -1, 1)!='/') {
- $this->root.='/';
+ if (substr($this->root, -1, 1) != '/') {
+ $this->root .= '/';
}
} else {
throw new \Exception();
}
}
- private function init(){
- if($this->ready) {
+ private function init() {
+ if ($this->ready) {
return;
}
$this->ready = true;
@@ -78,28 +78,28 @@ class DAV extends \OC\Files\Storage\Common{
}
}
- public function getId(){
+ public function getId() {
return 'webdav::' . $this->user . '@' . $this->host . '/' . $this->root;
}
protected function createBaseUri() {
- $baseUri='http';
+ $baseUri = 'http';
if ($this->secure) {
- $baseUri.='s';
+ $baseUri .= 's';
}
- $baseUri.='://'.$this->host.$this->root;
+ $baseUri .= '://' . $this->host . $this->root;
return $baseUri;
}
public function mkdir($path) {
$this->init();
- $path=$this->cleanPath($path);
+ $path = $this->cleanPath($path);
return $this->simpleResponse('MKCOL', $path, null, 201);
}
public function rmdir($path) {
$this->init();
- $path=$this->cleanPath($path) . '/';
+ $path = $this->cleanPath($path) . '/';
// FIXME: some WebDAV impl return 403 when trying to DELETE
// a non-empty folder
return $this->simpleResponse('DELETE', $path, null, 204);
@@ -107,35 +107,35 @@ class DAV extends \OC\Files\Storage\Common{
public function opendir($path) {
$this->init();
- $path=$this->cleanPath($path);
+ $path = $this->cleanPath($path);
try {
- $response=$this->client->propfind($this->encodePath($path), array(), 1);
- $id=md5('webdav'.$this->root.$path);
+ $response = $this->client->propfind($this->encodePath($path), array(), 1);
+ $id = md5('webdav' . $this->root . $path);
$content = array();
- $files=array_keys($response);
- array_shift($files);//the first entry is the current directory
+ $files = array_keys($response);
+ array_shift($files); //the first entry is the current directory
foreach ($files as $file) {
$file = urldecode(basename($file));
- $content[]=$file;
+ $content[] = $file;
}
\OC\Files\Stream\Dir::register($id, $content);
- return opendir('fakedir://'.$id);
- } catch(\Exception $e) {
+ return opendir('fakedir://' . $id);
+ } catch (\Exception $e) {
return false;
}
}
public function filetype($path) {
$this->init();
- $path=$this->cleanPath($path);
+ $path = $this->cleanPath($path);
try {
- $response=$this->client->propfind($this->encodePath($path), array('{DAV:}resourcetype'));
+ $response = $this->client->propfind($this->encodePath($path), array('{DAV:}resourcetype'));
$responseType = array();
if (isset($response["{DAV:}resourcetype"])) {
- $responseType=$response["{DAV:}resourcetype"]->resourceType;
+ $responseType = $response["{DAV:}resourcetype"]->resourceType;
}
- return (count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file';
- } catch(\Exception $e) {
+ return (count($responseType) > 0 and $responseType[0] == "{DAV:}collection") ? 'dir' : 'file';
+ } catch (\Exception $e) {
error_log($e->getMessage());
\OCP\Util::writeLog("webdav client", \OCP\Util::sanitizeHTML($e->getMessage()), \OCP\Util::ERROR);
return false;
@@ -144,11 +144,11 @@ class DAV extends \OC\Files\Storage\Common{
public function file_exists($path) {
$this->init();
- $path=$this->cleanPath($path);
+ $path = $this->cleanPath($path);
try {
$this->client->propfind($this->encodePath($path), array('{DAV:}resourcetype'));
- return true;//no 404 exception
- } catch(\Exception $e) {
+ return true; //no 404 exception
+ } catch (\Exception $e) {
return false;
}
}
@@ -160,34 +160,34 @@ class DAV extends \OC\Files\Storage\Common{
public function fopen($path, $mode) {
$this->init();
- $path=$this->cleanPath($path);
- switch($mode) {
+ $path = $this->cleanPath($path);
+ switch ($mode) {
case 'r':
case 'rb':
- if ( ! $this->file_exists($path)) {
+ if (!$this->file_exists($path)) {
return false;
}
//straight up curl instead of sabredav here, sabredav put's the entire get result in memory
$curl = curl_init();
$fp = fopen('php://temp', 'r+');
- curl_setopt($curl, CURLOPT_USERPWD, $this->user.':'.$this->password);
- curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().$this->encodePath($path));
+ curl_setopt($curl, CURLOPT_USERPWD, $this->user . ':' . $this->password);
+ curl_setopt($curl, CURLOPT_URL, $this->createBaseUri() . $this->encodePath($path));
curl_setopt($curl, CURLOPT_FILE, $fp);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
if ($this->secure === true) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
- if($this->certPath){
+ if ($this->certPath) {
curl_setopt($curl, CURLOPT_CAINFO, $this->certPath);
}
}
-
- curl_exec ($curl);
+
+ curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($statusCode !== 200) {
\OCP\Util::writeLog("webdav client", 'curl GET ' . curl_getinfo($curl, CURLINFO_EFFECTIVE_URL) . ' returned status code ' . $statusCode, \OCP\Util::ERROR);
}
- curl_close ($curl);
+ curl_close($curl);
rewind($fp);
return $fp;
case 'w':
@@ -203,18 +203,19 @@ class DAV extends \OC\Files\Storage\Common{
case 'c':
case 'c+':
//emulate these
- if (strrpos($path, '.')!==false) {
- $ext=substr($path, strrpos($path, '.'));
+ if (strrpos($path, '.') !== false) {
+ $ext = substr($path, strrpos($path, '.'));
} else {
- $ext='';
+ $ext = '';
}
- $tmpFile = \OCP\Files::tmpFile($ext);
- \OC\Files\Stream\Close::registerCallback($tmpFile, array($this, 'writeBack'));
- if($this->file_exists($path)) {
- $this->getFile($path, $tmpFile);
+ if ($this->file_exists($path)) {
+ $tmpFile = $this->getCachedFile($path);
+ } else {
+ $tmpFile = \OCP\Files::tmpFile($ext);
}
- self::$tempFiles[$tmpFile]=$path;
- return fopen('close://'.$tmpFile, $mode);
+ \OC\Files\Stream\Close::registerCallback($tmpFile, array($this, 'writeBack'));
+ self::$tempFiles[$tmpFile] = $path;
+ return fopen('close://' . $tmpFile, $mode);
}
}
@@ -227,32 +228,31 @@ class DAV extends \OC\Files\Storage\Common{
public function free_space($path) {
$this->init();
- $path=$this->cleanPath($path);
+ $path = $this->cleanPath($path);
try {
- $response=$this->client->propfind($this->encodePath($path), array('{DAV:}quota-available-bytes'));
+ $response = $this->client->propfind($this->encodePath($path), array('{DAV:}quota-available-bytes'));
if (isset($response['{DAV:}quota-available-bytes'])) {
return (int)$response['{DAV:}quota-available-bytes'];
} else {
return \OC\Files\SPACE_UNKNOWN;
}
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
return \OC\Files\SPACE_UNKNOWN;
}
}
- public function touch($path, $mtime=null) {
+ public function touch($path, $mtime = null) {
$this->init();
if (is_null($mtime)) {
- $mtime=time();
+ $mtime = time();
}
- $path=$this->cleanPath($path);
+ $path = $this->cleanPath($path);
// if file exists, update the mtime, else create a new empty file
if ($this->file_exists($path)) {
try {
$this->client->proppatch($this->encodePath($path), array('{DAV:}lastmodified' => $mtime));
- }
- catch (\Sabre_DAV_Exception_NotImplemented $e) {
+ } catch (\Sabre_DAV_Exception_NotImplemented $e) {
return false;
}
} else {
@@ -261,23 +261,13 @@ class DAV extends \OC\Files\Storage\Common{
return true;
}
- /**
- * @param string $path
- * @param string $target
- */
- public function getFile($path, $target) {
- $this->init();
- $source=$this->fopen($path, 'r');
- file_put_contents($target, $source);
- }
-
- public function uploadFile($path, $target) {
+ protected function uploadFile($path, $target) {
$this->init();
- $source=fopen($path, 'r');
+ $source = fopen($path, 'r');
$curl = curl_init();
- curl_setopt($curl, CURLOPT_USERPWD, $this->user.':'.$this->password);
- curl_setopt($curl, CURLOPT_URL, $this->createBaseUri().str_replace(' ', '%20', $target));
+ curl_setopt($curl, CURLOPT_USERPWD, $this->user . ':' . $this->password);
+ curl_setopt($curl, CURLOPT_URL, $this->createBaseUri() . str_replace(' ', '%20', $target));
curl_setopt($curl, CURLOPT_BINARYTRANSFER, true);
curl_setopt($curl, CURLOPT_INFILE, $source); // file pointer
curl_setopt($curl, CURLOPT_INFILESIZE, filesize($path));
@@ -285,26 +275,29 @@ class DAV extends \OC\Files\Storage\Common{
if ($this->secure === true) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
- if($this->certPath){
+ if ($this->certPath) {
curl_setopt($curl, CURLOPT_CAINFO, $this->certPath);
}
}
- curl_exec ($curl);
+ curl_exec($curl);
$statusCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if ($statusCode !== 200) {
\OCP\Util::writeLog("webdav client", 'curl GET ' . curl_getinfo($curl, CURLINFO_EFFECTIVE_URL) . ' returned status code ' . $statusCode, \OCP\Util::ERROR);
}
- curl_close ($curl);
+ curl_close($curl);
+ $this->removeCachedFile($target);
}
public function rename($path1, $path2) {
$this->init();
$path1 = $this->encodePath($this->cleanPath($path1));
- $path2 = $this->createBaseUri().$this->encodePath($this->cleanPath($path2));
+ $path2 = $this->createBaseUri() . $this->encodePath($this->cleanPath($path2));
try {
- $this->client->request('MOVE', $path1, null, array('Destination'=>$path2));
+ $this->client->request('MOVE', $path1, null, array('Destination' => $path2));
+ $this->removeCachedFile($path1);
+ $this->removeCachedFile($path2);
return true;
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
return false;
}
}
@@ -312,47 +305,48 @@ class DAV extends \OC\Files\Storage\Common{
public function copy($path1, $path2) {
$this->init();
$path1 = $this->encodePath($this->cleanPath($path1));
- $path2 = $this->createBaseUri().$this->encodePath($this->cleanPath($path2));
+ $path2 = $this->createBaseUri() . $this->encodePath($this->cleanPath($path2));
try {
- $this->client->request('COPY', $path1, null, array('Destination'=>$path2));
+ $this->client->request('COPY', $path1, null, array('Destination' => $path2));
+ $this->removeCachedFile($path2);
return true;
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
return false;
}
}
public function stat($path) {
$this->init();
- $path=$this->cleanPath($path);
+ $path = $this->cleanPath($path);
try {
$response = $this->client->propfind($this->encodePath($path), array('{DAV:}getlastmodified', '{DAV:}getcontentlength'));
return array(
- 'mtime'=>strtotime($response['{DAV:}getlastmodified']),
- 'size'=>(int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0,
+ 'mtime' => strtotime($response['{DAV:}getlastmodified']),
+ 'size' => (int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0,
);
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
return array();
}
}
public function getMimeType($path) {
$this->init();
- $path=$this->cleanPath($path);
+ $path = $this->cleanPath($path);
try {
- $response=$this->client->propfind($this->encodePath($path), array('{DAV:}getcontenttype', '{DAV:}resourcetype'));
+ $response = $this->client->propfind($this->encodePath($path), array('{DAV:}getcontenttype', '{DAV:}resourcetype'));
$responseType = array();
if (isset($response["{DAV:}resourcetype"])) {
- $responseType=$response["{DAV:}resourcetype"]->resourceType;
+ $responseType = $response["{DAV:}resourcetype"]->resourceType;
}
- $type=(count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file';
- if ($type=='dir') {
+ $type = (count($responseType) > 0 and $responseType[0] == "{DAV:}collection") ? 'dir' : 'file';
+ if ($type == 'dir') {
return 'httpd/unix-directory';
} elseif (isset($response['{DAV:}getcontenttype'])) {
return $response['{DAV:}getcontenttype'];
} else {
return false;
}
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
return false;
}
}
@@ -368,6 +362,7 @@ class DAV extends \OC\Files\Storage\Common{
/**
* URL encodes the given path but keeps the slashes
+ *
* @param string $path to encode
* @return string encoded path
*/
@@ -382,11 +377,11 @@ class DAV extends \OC\Files\Storage\Common{
* @param integer $expected
*/
private function simpleResponse($method, $path, $body, $expected) {
- $path=$this->cleanPath($path);
+ $path = $this->cleanPath($path);
try {
- $response=$this->client->request($method, $this->encodePath($path), $body);
- return $response['statusCode']==$expected;
- } catch(\Exception $e) {
+ $response = $this->client->request($method, $this->encodePath($path), $body);
+ return $response['statusCode'] == $expected;
+ } catch (\Exception $e) {
return false;
}
}
diff --git a/apps/files_external/personal.php b/apps/files_external/personal.php
index 90f5e159535..90d7afed28b 100755
--- a/apps/files_external/personal.php
+++ b/apps/files_external/personal.php
@@ -22,9 +22,8 @@
OCP\Util::addScript('files_external', 'settings');
OCP\Util::addStyle('files_external', 'settings');
-$backends = OC_Mount_Config::getBackends();
-// Remove local storage
-unset($backends['\OC\Files\Storage\Local']);
+$backends = OC_Mount_Config::getPersonalBackends();
+
$tmpl = new OCP\Template('files_external', 'settings');
$tmpl->assign('isAdminPage', false);
$tmpl->assign('mounts', OC_Mount_Config::getPersonalMountPoints());
diff --git a/apps/files_external/settings.php b/apps/files_external/settings.php
index 31183409e39..5b62b542200 100644
--- a/apps/files_external/settings.php
+++ b/apps/files_external/settings.php
@@ -26,10 +26,26 @@ OCP\Util::addScript('files_external', 'settings');
OCP\Util::addscript('3rdparty', 'chosen/chosen.jquery.min');
OCP\Util::addStyle('files_external', 'settings');
OCP\Util::addStyle('3rdparty', 'chosen/chosen');
+
+$backends = OC_Mount_Config::getBackends();
+$personal_backends = array();
+$enabled_backends = explode(',', OCP\Config::getAppValue('files_external', 'user_mounting_backends', ''));
+foreach ($backends as $class => $backend)
+{
+ if ($class != '\OC\Files\Storage\Local')
+ {
+ $personal_backends[$class] = array(
+ 'backend' => $backend['backend'],
+ 'enabled' => in_array($class, $enabled_backends),
+ );
+ }
+}
+
$tmpl = new OCP\Template('files_external', 'settings');
$tmpl->assign('isAdminPage', true);
$tmpl->assign('mounts', OC_Mount_Config::getSystemMountPoints());
-$tmpl->assign('backends', OC_Mount_Config::getBackends());
+$tmpl->assign('backends', $backends);
+$tmpl->assign('personal_backends', $personal_backends);
$tmpl->assign('groups', OC_Group::getGroups());
$tmpl->assign('users', OCP\User::getUsers());
$tmpl->assign('userDisplayNames', OC_User::getDisplayNames());
diff --git a/apps/files_external/templates/settings.php b/apps/files_external/templates/settings.php
index 3ca16c3c7a8..80238666376 100644
--- a/apps/files_external/templates/settings.php
+++ b/apps/files_external/templates/settings.php
@@ -16,17 +16,17 @@
</thead>
<tbody width="100%">
<?php $_['mounts'] = array_merge($_['mounts'], array('' => array())); ?>
- <?php foreach ($_['mounts'] as $mountPoint => $mount): ?>
- <tr <?php print_unescaped(($mountPoint != '') ? 'class="'.OC_Util::sanitizeHTML($mount['class']).'"' : 'id="addMountPoint"'); ?>>
+ <?php foreach ($_['mounts'] as $mount): ?>
+ <tr <?php print_unescaped(($mount['mountpoint'] !== '') ? 'class="'.OC_Util::sanitizeHTML($mount['class']).'"' : 'id="addMountPoint"'); ?>>
<td class="status">
<?php if (isset($mount['status'])): ?>
<span class="<?php p(($mount['status']) ? 'success' : 'error'); ?>"></span>
<?php endif; ?>
</td>
<td class="mountPoint"><input type="text" name="mountPoint"
- value="<?php p($mountPoint); ?>"
+ value="<?php p($mount['mountpoint']); ?>"
placeholder="<?php p($l->t('Folder name')); ?>" /></td>
- <?php if ($mountPoint == ''): ?>
+ <?php if ($mount['mountpoint'] == ''): ?>
<td class="backend">
<select id="selectBackend" data-configurations='<?php print_unescaped(json_encode($_['backends'])); ?>'>
<option value="" disabled selected
@@ -41,32 +41,35 @@
data-class="<?php p($mount['class']); ?>"><?php p($mount['backend']); ?></td>
<?php endif; ?>
<td class ="configuration" width="100%">
- <?php if (isset($mount['configuration'])): ?>
- <?php foreach ($mount['configuration'] as $parameter => $value): ?>
+ <?php if (isset($mount['options'])): ?>
+ <?php foreach ($mount['options'] as $parameter => $value): ?>
<?php if (isset($_['backends'][$mount['class']]['configuration'][$parameter])): ?>
- <?php $placeholder = $_['backends'][$mount['class']]['configuration'][$parameter]; ?>
- <?php if (strpos($placeholder, '*') !== false): ?>
+ <?php
+ $placeholder = $_['backends'][$mount['class']]['configuration'][$parameter];
+ $is_optional = FALSE;
+ if (strpos($placeholder, '&') === 0) {
+ $is_optional = TRUE;
+ $placeholder = substr($placeholder, 1);
+ }
+ ?>
+ <?php if (strpos($placeholder, '*') === 0): ?>
<input type="password"
+ <?php if ($is_optional): ?> class="optional"<?php endif; ?>
data-parameter="<?php p($parameter); ?>"
value="<?php p($value); ?>"
placeholder="<?php p(substr($placeholder, 1)); ?>" />
- <?php elseif (strpos($placeholder, '!') !== false): ?>
+ <?php elseif (strpos($placeholder, '!') === 0): ?>
<label><input type="checkbox"
data-parameter="<?php p($parameter); ?>"
<?php if ($value == 'true'): ?> checked="checked"<?php endif; ?>
/><?php p(substr($placeholder, 1)); ?></label>
- <?php elseif (strpos($placeholder, '&') !== false): ?>
- <input type="text"
- class="optional"
- data-parameter="<?php p($parameter); ?>"
- value="<?php p($value); ?>"
- placeholder="<?php p(substr($placeholder, 1)); ?>" />
- <?php elseif (strpos($placeholder, '#') !== false): ?>
+ <?php elseif (strpos($placeholder, '#') === 0): ?>
<input type="hidden"
data-parameter="<?php p($parameter); ?>"
value="<?php p($value); ?>" />
<?php else: ?>
<input type="text"
+ <?php if ($is_optional): ?> class="optional"<?php endif; ?>
data-parameter="<?php p($parameter); ?>"
value="<?php p($value); ?>"
placeholder="<?php p($placeholder); ?>" />
@@ -108,7 +111,7 @@
</select>
</td>
<?php endif; ?>
- <td <?php if ($mountPoint != ''): ?>class="remove"
+ <td <?php if ($mount['mountpoint'] != ''): ?>class="remove"
<?php else: ?>style="visibility:hidden;"
<?php endif ?>><img alt="<?php p($l->t('Delete')); ?>"
title="<?php p($l->t('Delete')); ?>"
@@ -122,12 +125,18 @@
<?php if ($_['isAdminPage']): ?>
<br />
- <input type="checkbox"
- name="allowUserMounting"
- id="allowUserMounting"
- value="1" <?php if ($_['allowUserMounting'] == 'yes') print_unescaped(' checked="checked"'); ?> />
- <label for="allowUserMounting"><?php p($l->t('Enable User External Storage')); ?></label><br/>
- <em><?php p($l->t('Allow users to mount their own external storage')); ?></em>
+ <input type="checkbox" name="allowUserMounting" id="allowUserMounting"
+ value="1" <?php if ($_['allowUserMounting'] == 'yes') print_unescaped(' checked="checked"'); ?> />
+ <label for="allowUserMounting"><?php p($l->t('Enable User External Storage')); ?></label> <span id="userMountingMsg" class="msg"></span>
+
+ <p id="userMountingBackups"<?php if ($_['allowUserMounting'] != 'yes'): ?> class="hidden"<?php endif; ?>>
+ <?php p($l->t('Allow users to mount the following external storage')); ?><br />
+ <?php $i = 0; foreach ($_['personal_backends'] as $class => $backend): ?>
+ <input type="checkbox" id="allowUserMountingBackends<?php p($i); ?>" name="allowUserMountingBackends[]" value="<?php p($class); ?>" <?php if ($backend['enabled']) print_unescaped(' checked="checked"'); ?> />
+ <label for="allowUserMountingBackends<?php p($i); ?>"><?php p($backend['backend']); ?></label> <br />
+ <?php $i++; ?>
+ <?php endforeach; ?>
+ </p>
<?php endif; ?>
</fieldset>
</form>
diff --git a/apps/files_external/tests/mountconfig.php b/apps/files_external/tests/mountconfig.php
index 24ebcf51346..c89874c94d5 100644
--- a/apps/files_external/tests/mountconfig.php
+++ b/apps/files_external/tests/mountconfig.php
@@ -34,6 +34,90 @@ class Test_Mount_Config_Dummy_Storage {
* Class Test_Mount_Config
*/
class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
+
+ private $dataDir;
+ private $userHome;
+ private $oldAllowedBackends;
+ private $allBackends;
+
+ const TEST_USER1 = 'user1';
+ const TEST_USER2 = 'user2';
+ const TEST_GROUP1 = 'group1';
+ const TEST_GROUP2 = 'group2';
+
+ public function setUp() {
+ \OC_User::createUser(self::TEST_USER1, self::TEST_USER1);
+ \OC_User::createUser(self::TEST_USER2, self::TEST_USER2);
+
+ \OC_Group::createGroup(self::TEST_GROUP1);
+ \OC_Group::addToGroup(self::TEST_USER1, self::TEST_GROUP1);
+ \OC_Group::createGroup(self::TEST_GROUP2);
+ \OC_Group::addToGroup(self::TEST_USER2, self::TEST_GROUP2);
+
+ \OC_User::setUserId(self::TEST_USER1);
+ $this->userHome = \OC_User::getHome(self::TEST_USER1);
+ mkdir($this->userHome);
+
+ $this->dataDir = \OC_Config::getValue(
+ 'datadirectory',
+ \OC::$SERVERROOT . '/data/'
+ );
+ $this->oldAllowedBackends = OCP\Config::getAppValue(
+ 'files_external',
+ 'user_mounting_backends',
+ ''
+ );
+ $this->allBackends = OC_Mount_Config::getBackends();
+ OCP\Config::setAppValue(
+ 'files_external',
+ 'user_mounting_backends',
+ implode(',', array_keys($this->allBackends))
+ );
+
+ OC_Mount_Config::$skipTest = true;
+ }
+
+ public function tearDown() {
+ OC_Mount_Config::$skipTest = false;
+
+ \OC_User::deleteUser(self::TEST_USER2);
+ \OC_User::deleteUser(self::TEST_USER1);
+ \OC_Group::deleteGroup(self::TEST_GROUP1);
+ \OC_Group::deleteGroup(self::TEST_GROUP2);
+
+ @unlink($this->dataDir . '/mount.json');
+
+ OCP\Config::setAppValue(
+ 'files_external',
+ 'user_mounting_backends',
+ $this->oldAllowedBackends
+ );
+ }
+
+ /**
+ * Reads the global config, for checking
+ */
+ private function readGlobalConfig() {
+ $configFile = $this->dataDir . '/mount.json';
+ return json_decode(file_get_contents($configFile), true);
+ }
+
+ /**
+ * Reads the user config, for checking
+ */
+ private function readUserConfig() {
+ $configFile = $this->userHome . '/mount.json';
+ return json_decode(file_get_contents($configFile), true);
+ }
+
+ /**
+ * Write the user config, to simulate existing files
+ */
+ private function writeUserConfig($config) {
+ $configFile = $this->userHome . '/mount.json';
+ file_put_contents($configFile, json_encode($config));
+ }
+
/**
* Test mount point validation
*/
@@ -42,35 +126,518 @@ class Test_Mount_Config extends \PHPUnit_Framework_TestCase {
$mountType = 'user';
$applicable = 'all';
$isPersonal = false;
- $this->assertEquals(false, OC_Mount_Config::addMountPoint('', $storageClass, array(), $mountType, $applicable, $isPersonal));
- $this->assertEquals(false, OC_Mount_Config::addMountPoint('/', $storageClass, array(), $mountType, $applicable, $isPersonal));
- $this->assertEquals(false, OC_Mount_Config::addMountPoint('Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
- $this->assertEquals(false, OC_Mount_Config::addMountPoint('/Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
+ $this->assertFalse(OC_Mount_Config::addMountPoint('', $storageClass, array(), $mountType, $applicable, $isPersonal));
+ $this->assertFalse(OC_Mount_Config::addMountPoint('/', $storageClass, array(), $mountType, $applicable, $isPersonal));
+ $this->assertFalse(OC_Mount_Config::addMountPoint('Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
+ $this->assertFalse(OC_Mount_Config::addMountPoint('/Shared', $storageClass, array(), $mountType, $applicable, $isPersonal));
+
+ }
+
+ /**
+ * Test adding a global mount point
+ */
+ public function testAddGlobalMountPoint() {
+ $mountType = OC_Mount_Config::MOUNT_TYPE_USER;
+ $applicable = 'all';
+ $isPersonal = false;
+ $this->assertEquals(true, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\Storage\SFTP', array(), $mountType, $applicable, $isPersonal));
+
+ $config = $this->readGlobalConfig();
+ $this->assertEquals(1, count($config));
+ $this->assertTrue(isset($config[$mountType]));
+ $this->assertTrue(isset($config[$mountType][$applicable]));
+ $this->assertTrue(isset($config[$mountType][$applicable]['/$user/files/ext']));
+ $this->assertEquals(
+ '\OC\Files\Storage\SFTP',
+ $config[$mountType][$applicable]['/$user/files/ext']['class']
+ );
}
+ /**
+ * Test adding a personal mount point
+ */
public function testAddMountPointSingleUser() {
- \OC_User::setUserId('test');
- $mountType = 'user';
- $applicable = 'test';
+ $mountType = OC_Mount_Config::MOUNT_TYPE_USER;
+ $applicable = self::TEST_USER1;
+ $isPersonal = true;
+
+ $this->assertEquals(true, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\Storage\SFTP', array(), $mountType, $applicable, $isPersonal));
+
+ $config = $this->readUserConfig();
+ $this->assertEquals(1, count($config));
+ $this->assertTrue(isset($config[$mountType]));
+ $this->assertTrue(isset($config[$mountType][$applicable]));
+ $this->assertTrue(isset($config[$mountType][$applicable]['/' . self::TEST_USER1 . '/files/ext']));
+ $this->assertEquals(
+ '\OC\Files\Storage\SFTP',
+ $config[$mountType][$applicable]['/' . self::TEST_USER1 . '/files/ext']['class']
+ );
+ }
+
+ /**
+ * Test adding a personal mount point using disallowed backend
+ */
+ public function testAddDisallowedBackendMountPointSingleUser() {
+ $mountType = OC_Mount_Config::MOUNT_TYPE_USER;
+ $applicable = self::TEST_USER1;
$isPersonal = true;
+
// local
- $this->assertEquals(false, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\storage\local', array(), $mountType, $applicable, $isPersonal));
- // non-local
- // FIXME: can't test this yet as the class (write operation) is not mockable
- // $this->assertEquals(true, OC_Mount_Config::addMountPoint('/ext', '\OC\Files\Storage\SFTP', array(), $mountType, $applicable, $isPersonal));
+ $this->assertFalse(OC_Mount_Config::addMountPoint('/ext', '\OC\Files\storage\local', array(), $mountType, $applicable, $isPersonal));
+
+ unset($this->allBackends['\OC\Files\Storage\SFTP']);
+ OCP\Config::setAppValue(
+ 'files_external',
+ 'user_mounting_backends',
+ implode(',', array_keys($this->allBackends))
+ );
+ // non-local but forbidden
+ $this->assertFalse(OC_Mount_Config::addMountPoint('/ext', '\OC\Files\Storage\SFTP', array(), $mountType, $applicable, $isPersonal));
+
+ $this->assertFalse(file_exists($this->userHome . '/mount.json'));
}
+ /**
+ * Test adding a mount point with an non-existant backend
+ */
public function testAddMountPointUnexistClass() {
- \OC_User::setUserId('test');
$storageClass = 'Unexist_Storage';
- $mountType = 'user';
- $applicable = 'test';
+ $mountType = OC_Mount_Config::MOUNT_TYPE_USER;
+ $applicable = self::TEST_USER1;
+ $isPersonal = false;
+ $this->assertFalse(OC_Mount_Config::addMountPoint('/ext', $storageClass, array(), $mountType, $applicable, $isPersonal));
+
+ }
+
+ /**
+ * Provider for testing configurations with different
+ * "applicable" values (all, user, groups)
+ */
+ public function applicableConfigProvider() {
+ return array(
+ // applicable to "all"
+ array(
+ OC_Mount_Config::MOUNT_TYPE_USER,
+ 'all',
+ array(
+ 'users' => array('all'),
+ 'groups' => array()
+ )
+ ),
+ // applicable to single user
+ array(
+ OC_Mount_Config::MOUNT_TYPE_USER,
+ self::TEST_USER1,
+ array(
+ 'users' => array(self::TEST_USER1),
+ 'groups' => array()
+ )
+ ),
+ // applicable to single group
+ array(
+ OC_Mount_Config::MOUNT_TYPE_GROUP,
+ self::TEST_GROUP1,
+ array(
+ 'users' => array(),
+ 'groups' => array(self::TEST_GROUP1)
+ )
+ ),
+ );
+ }
+
+ /**
+ * Test reading and writing global config
+ *
+ * @dataProvider applicableConfigProvider
+ */
+ public function testReadWriteGlobalConfig($mountType, $applicable, $expectApplicableArray) {
+ $mountType = $mountType;
+ $applicable = $applicable;
+ $isPersonal = false;
+ $options = array(
+ 'host' => 'smbhost',
+ 'user' => 'smbuser',
+ 'password' => 'smbpassword',
+ 'share' => 'smbshare',
+ 'root' => 'smbroot'
+ );
+
+ // write config
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $options,
+ $mountType,
+ $applicable,
+ $isPersonal
+ )
+ );
+
+ // re-read config
+ $config = OC_Mount_Config::getSystemMountPoints();
+ $this->assertEquals(1, count($config));
+ $this->assertEquals('\OC\Files\Storage\SMB', $config[0]['class']);
+ $this->assertEquals('ext', $config[0]['mountpoint']);
+ $this->assertEquals($expectApplicableArray, $config[0]['applicable']);
+ $savedOptions = $config[0]['options'];
+ $this->assertEquals($options, $savedOptions);
+ // key order needs to be preserved for the UI...
+ $this->assertEquals(array_keys($options), array_keys($savedOptions));
+ }
+
+ /**
+ * Test reading and writing config
+ */
+ public function testReadWritePersonalConfig() {
+ $mountType = OC_Mount_Config::MOUNT_TYPE_USER;
+ $applicable = self::TEST_USER1;
$isPersonal = true;
- // local
- // non-local
- $this->assertEquals(false, OC_Mount_Config::addMountPoint('/ext', $storageClass, array(), $mountType, $applicable, $isPersonal));
+ $options = array(
+ 'host' => 'smbhost',
+ 'user' => 'smbuser',
+ 'password' => 'smbpassword',
+ 'share' => 'smbshare',
+ 'root' => 'smbroot'
+ );
+
+ // write config
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $options,
+ $mountType,
+ $applicable,
+ $isPersonal
+ )
+ );
+
+ // re-read config
+ $config = OC_Mount_Config::getPersonalMountPoints();
+ $this->assertEquals(1, count($config));
+ $this->assertEquals('\OC\Files\Storage\SMB', $config[0]['class']);
+ $this->assertEquals('ext', $config[0]['mountpoint']);
+ $savedOptions = $config[0]['options'];
+ $this->assertEquals($options, $savedOptions);
+ // key order needs to be preserved for the UI...
+ $this->assertEquals(array_keys($options), array_keys($savedOptions));
+ }
+
+ /**
+ * Test password obfuscation
+ */
+ public function testPasswordObfuscation() {
+ $mountType = OC_Mount_Config::MOUNT_TYPE_USER;
+ $applicable = self::TEST_USER1;
+ $isPersonal = true;
+ $mountConfig = array(
+ 'host' => 'smbhost',
+ 'user' => 'smbuser',
+ 'password' => 'smbpassword',
+ 'share' => 'smbshare',
+ 'root' => 'smbroot'
+ );
+
+ // write config
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $mountConfig,
+ $mountType,
+ $applicable,
+ $isPersonal
+ )
+ );
+
+ // note: password re-reading is covered by testReadWritePersonalConfig
+
+ // check that password inside the file is NOT in plain text
+ $config = $this->readUserConfig();
+ $savedConfig = $config[$mountType][$applicable]['/' . self::TEST_USER1 . '/files/ext']['options'];
+
+ // no more clear text password in file (kept because of key order)
+ $this->assertEquals('', $savedConfig['password']);
+
+ // encrypted password is present
+ $this->assertNotEquals($mountConfig['password'], $savedConfig['password_encrypted']);
+ }
+
+ /**
+ * Test read legacy passwords
+ */
+ public function testReadLegacyPassword() {
+ $mountType = OC_Mount_Config::MOUNT_TYPE_USER;
+ $applicable = self::TEST_USER1;
+ $isPersonal = true;
+ $mountConfig = array(
+ 'host' => 'smbhost',
+ 'user' => 'smbuser',
+ 'password' => 'smbpassword',
+ 'share' => 'smbshare',
+ 'root' => 'smbroot'
+ );
+
+ // write config
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $mountConfig,
+ $mountType,
+ $applicable,
+ $isPersonal
+ )
+ );
+
+ $config = $this->readUserConfig();
+ // simulate non-encrypted password situation
+ $config[$mountType][$applicable]['/' . self::TEST_USER1 . '/files/ext']['options']['password'] = 'smbpasswd';
+
+ $this->writeUserConfig($config);
+
+ // re-read config, password was read correctly
+ $config = OC_Mount_Config::getPersonalMountPoints();
+ $savedMountConfig = $config[0]['options'];
+ $this->assertEquals($mountConfig, $savedMountConfig);
+ }
+
+ public function mountDataProvider() {
+ return array(
+ // Tests for visible mount points
+ // system mount point for all users
+ array(
+ false,
+ OC_Mount_Config::MOUNT_TYPE_USER,
+ 'all',
+ self::TEST_USER1,
+ true,
+ ),
+ // system mount point for a specific user
+ array(
+ false,
+ OC_Mount_Config::MOUNT_TYPE_USER,
+ self::TEST_USER1,
+ self::TEST_USER1,
+ true,
+ ),
+ // system mount point for a specific group
+ array(
+ false,
+ OC_Mount_Config::MOUNT_TYPE_GROUP,
+ self::TEST_GROUP1,
+ self::TEST_USER1,
+ true,
+ ),
+ // user mount point
+ array(
+ true,
+ OC_Mount_Config::MOUNT_TYPE_USER,
+ self::TEST_USER1,
+ self::TEST_USER1,
+ true,
+ ),
+
+ // Tests for non-visible mount points
+ // system mount point for another user
+ array(
+ false,
+ OC_Mount_Config::MOUNT_TYPE_USER,
+ self::TEST_USER2,
+ self::TEST_USER1,
+ false,
+ ),
+ // system mount point for a specific group
+ array(
+ false,
+ OC_Mount_Config::MOUNT_TYPE_GROUP,
+ self::TEST_GROUP2,
+ self::TEST_USER1,
+ false,
+ ),
+ // user mount point
+ array(
+ true,
+ OC_Mount_Config::MOUNT_TYPE_USER,
+ self::TEST_USER1,
+ self::TEST_USER2,
+ false,
+ ),
+ );
+ }
+
+ /**
+ * Test mount points used at mount time, making sure
+ * the configuration is prepared properly.
+ *
+ * @dataProvider mountDataProvider
+ * @param bool $isPersonal true for personal mount point, false for system mount point
+ * @param string $mountType mount type
+ * @param string $applicable target user/group or "all"
+ * @param string $testUser user for which to retrieve the mount points
+ * @param bool $expectVisible whether to expect the mount point to be visible for $testUser
+ */
+ public function testMount($isPersonal, $mountType, $applicable, $testUser, $expectVisible) {
+ $mountConfig = array(
+ 'host' => 'someost',
+ 'user' => 'someuser',
+ 'password' => 'somepassword',
+ 'root' => 'someroot'
+ );
+
+ // add mount point as "test" user
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $mountConfig,
+ $mountType,
+ $applicable,
+ $isPersonal
+ )
+ );
+
+ // check mount points in the perspective of user $testUser
+ \OC_User::setUserId($testUser);
+
+ $mountPoints = OC_Mount_Config::getAbsoluteMountPoints($testUser);
+ if ($expectVisible) {
+ $this->assertEquals(1, count($mountPoints));
+ $this->assertTrue(isset($mountPoints['/' . self::TEST_USER1 . '/files/ext']));
+ $this->assertEquals('\OC\Files\Storage\SMB', $mountPoints['/' . self::TEST_USER1 . '/files/ext']['class']);
+ $this->assertEquals($mountConfig, $mountPoints['/' . self::TEST_USER1 . '/files/ext']['options']);
+ }
+ else {
+ $this->assertEquals(0, count($mountPoints));
+ }
+ }
+
+ /**
+ * Test the same config for multiple users.
+ * The config will be merged by getSystemMountPoints().
+ */
+ public function testConfigMerging() {
+ $mountType = OC_Mount_Config::MOUNT_TYPE_USER;
+ $isPersonal = false;
+ $options = array(
+ 'host' => 'smbhost',
+ 'user' => 'smbuser',
+ 'password' => 'smbpassword',
+ 'share' => 'smbshare',
+ 'root' => 'smbroot'
+ );
+
+ // write config
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $options,
+ OC_Mount_Config::MOUNT_TYPE_USER,
+ self::TEST_USER1,
+ $isPersonal
+ )
+ );
+
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $options,
+ OC_Mount_Config::MOUNT_TYPE_USER,
+ self::TEST_USER2,
+ $isPersonal
+ )
+ );
+
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $options,
+ OC_Mount_Config::MOUNT_TYPE_GROUP,
+ self::TEST_GROUP2,
+ $isPersonal
+ )
+ );
+
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $options,
+ OC_Mount_Config::MOUNT_TYPE_GROUP,
+ self::TEST_GROUP1,
+ $isPersonal
+ )
+ );
+
+ // re-read config
+ $config = OC_Mount_Config::getSystemMountPoints();
+ $this->assertEquals(1, count($config));
+ $this->assertEquals('\OC\Files\Storage\SMB', $config[0]['class']);
+ $this->assertEquals('ext', $config[0]['mountpoint']);
+ $this->assertEquals($options, $config[0]['options']);
+ $this->assertEquals(array(self::TEST_USER1, self::TEST_USER2), $config[0]['applicable']['users']);
+ $this->assertEquals(array(self::TEST_GROUP2, self::TEST_GROUP1), $config[0]['applicable']['groups']);
+ }
+
+ /**
+ * Create then re-read mount points configs where the mount points
+ * have the same path, the config must NOT be merged.
+ */
+ public function testRereadMountpointWithSamePath() {
+ $mountType = OC_Mount_Config::MOUNT_TYPE_USER;
+ $isPersonal = false;
+ $options1 = array(
+ 'host' => 'smbhost',
+ 'user' => 'smbuser',
+ 'password' => 'smbpassword',
+ 'share' => 'smbshare',
+ 'root' => 'smbroot'
+ );
+
+ // write config
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $options1,
+ $mountType,
+ self::TEST_USER1,
+ $isPersonal
+ )
+ );
+
+ $options2 = array(
+ 'host' => 'anothersmbhost',
+ 'user' => 'anothersmbuser',
+ 'password' => 'anothersmbpassword',
+ 'share' => 'anothersmbshare',
+ 'root' => 'anothersmbroot'
+ );
+ $this->assertTrue(
+ OC_Mount_Config::addMountPoint(
+ '/ext',
+ '\OC\Files\Storage\SMB',
+ $options2,
+ $mountType,
+ self::TEST_USER2,
+ $isPersonal
+ )
+ );
+ // re-read config
+ $config = OC_Mount_Config::getSystemMountPoints();
+ $this->assertEquals(2, count($config));
+ $this->assertEquals('\OC\Files\Storage\SMB', $config[0]['class']);
+ $this->assertEquals('ext', $config[0]['mountpoint']);
+ $this->assertEquals($options1, $config[0]['options']);
+ $this->assertEquals('\OC\Files\Storage\SMB', $config[1]['class']);
+ $this->assertEquals('ext', $config[1]['mountpoint']);
+ $this->assertEquals($options2, $config[1]['options']);
}
}