summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-07-12 09:43:04 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-07-12 09:43:04 +0200
commit24b4806af4a9b485b4b9a772809d118e91c6d97f (patch)
treedf5664782eefd384bd6ed3dc363a25575da89202 /apps/files_external
parent8793acfb4e751cfdb464d259de45249cec5d6398 (diff)
parent3abe68176ff09ca579ff9e5f15872fb5cab8ff4d (diff)
downloadnextcloud-server-24b4806af4a9b485b4b9a772809d118e91c6d97f.tar.gz
nextcloud-server-24b4806af4a9b485b4b9a772809d118e91c6d97f.zip
Merge branch 'master' into googledrive
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/ajax/addRootCertificate.php4
-rw-r--r--apps/files_external/js/settings.js19
-rw-r--r--apps/files_external/l10n/es.php12
-rw-r--r--apps/files_external/l10n/es_AR.php5
-rw-r--r--apps/files_external/l10n/eu.php1
-rw-r--r--apps/files_external/l10n/fa.php7
-rw-r--r--apps/files_external/l10n/ko.php3
-rw-r--r--apps/files_external/l10n/lt_LT.php1
-rw-r--r--apps/files_external/l10n/nn_NO.php1
-rw-r--r--apps/files_external/l10n/sv.php1
-rw-r--r--apps/files_external/l10n/te.php1
-rw-r--r--apps/files_external/l10n/zh_CN.GB2312.php1
-rw-r--r--apps/files_external/lib/smb.php14
-rw-r--r--apps/files_external/tests/config.php9
14 files changed, 61 insertions, 18 deletions
diff --git a/apps/files_external/ajax/addRootCertificate.php b/apps/files_external/ajax/addRootCertificate.php
index 43fd6752c4a..ae349bfcd3a 100644
--- a/apps/files_external/ajax/addRootCertificate.php
+++ b/apps/files_external/ajax/addRootCertificate.php
@@ -29,8 +29,12 @@ if ($isValid == false) {
// add the certificate if it could be verified
if ( $isValid ) {
+ // disable proxy to prevent multiple fopen calls
+ $proxyStatus = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
$view->file_put_contents($filename, $data);
OC_Mount_Config::createCertificateBundle();
+ \OC_FileProxy::$enabled = $proxyStatus;
} else {
OCP\Util::writeLog('files_external',
'Couldn\'t import SSL root certificate ('.$filename.'), allowed formats: PEM and DER',
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index ac408786ff6..3e605c59a93 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -88,7 +88,7 @@ OC.MountConfig={
url: OC.filePath('files_external', 'ajax', 'removeMountPoint.php'),
data: {
mountPoint: mountPoint,
- class: backendClass,
+ 'class': backendClass,
classOptions: classOptions,
mountType: mountType,
applicable: applicable,
@@ -103,7 +103,7 @@ OC.MountConfig={
url: OC.filePath('files_external', 'ajax', 'removeMountPoint.php'),
data: {
mountPoint: mountPoint,
- class: backendClass,
+ 'class': backendClass,
classOptions: classOptions,
mountType: mountType,
applicable: applicable,
@@ -247,15 +247,18 @@ $(document).ready(function() {
OC.MountConfig.saveStorage($(this).parent().parent());
});
+ $('#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});
+ $tr.remove();
+ return true;
+ });
+
$('#externalStorage').on('click', 'td.remove>img', function() {
var tr = $(this).parent().parent();
var mountPoint = $(tr).find('.mountPoint input').val();
- if ( ! mountPoint) {
- var row=this.parentNode.parentNode;
- $.post(OC.filePath('files_external', 'ajax', 'removeRootCertificate.php'), { cert: row.id });
- $(tr).remove();
- return true;
- }
+
if ($('#externalStorage').data('admin') === true) {
var isPersonal = false;
var multiselect = $(tr).find('.chzn-select').val();
diff --git a/apps/files_external/l10n/es.php b/apps/files_external/l10n/es.php
index f83562dd643..d145a176f71 100644
--- a/apps/files_external/l10n/es.php
+++ b/apps/files_external/l10n/es.php
@@ -1,12 +1,12 @@
<?php $TRANSLATIONS = array(
-"Access granted" => "Acceso garantizado",
+"Access granted" => "Acceso concedido",
"Error configuring Dropbox storage" => "Error configurando el almacenamiento de Dropbox",
-"Grant access" => "Garantizar acceso",
-"Please provide a valid Dropbox app key and secret." => "Por favor , proporcione un secreto y una contraseña válida de la app Dropbox.",
+"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",
"<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.",
+"<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.",
"External Storage" => "Almacenamiento externo",
"Folder name" => "Nombre de la carpeta",
"External storage" => "Almacenamiento externo",
@@ -19,8 +19,8 @@
"Groups" => "Grupos",
"Users" => "Usuarios",
"Delete" => "Eliminar",
-"Enable User External Storage" => "Habilitar almacenamiento de usuario externo",
+"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" => "Raíz de certificados SSL ",
+"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 6706aa43a31..c1b3ac63886 100644
--- a/apps/files_external/l10n/es_AR.php
+++ b/apps/files_external/l10n/es_AR.php
@@ -4,8 +4,9 @@
"Grant access" => "Permitir acceso",
"Please provide a valid Dropbox app key and secret." => "Por favor, proporcioná un secreto y una contraseña válida para la aplicación Dropbox.",
"Error configuring Google Drive storage" => "Error al configurar el almacenamiento de Google Drive",
-"<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> \"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 está instalado. Montar archivos CIFS/SMB no es posible. Por favor, pedile al administrador de tu 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 está instalado. Montar archivos FTP no es posible. Por favor, pedile al administrador de tu 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 de PHP no está activo ni instalado. Montar servicios ownCloud, WebDAV y/o GoogleDrive no será posible. Pedile al administrador del sistema que lo instale.",
"External Storage" => "Almacenamiento externo",
"Folder name" => "Nombre de la carpeta",
"External storage" => "Almacenamiento externo",
diff --git a/apps/files_external/l10n/eu.php b/apps/files_external/l10n/eu.php
index 83be50deb00..9dc1f3e9c03 100644
--- a/apps/files_external/l10n/eu.php
+++ b/apps/files_external/l10n/eu.php
@@ -6,6 +6,7 @@
"Error configuring Google Drive storage" => "Errore bat egon da Google Drive biltegiratzea konfiguratzean",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Abisua:</b> \"smbclient\" ez dago instalatuta. CIFS/SMB partekatutako karpetak montatzea ez da posible. Mesedez eskatu zure sistema kudeatzaileari instalatzea.",
"<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>Abisua:</b> PHPren FTP modulua ez dago instalatuta edo gaitua. FTP partekatutako karpetak montatzea ez da posible. Mesedez eskatu zure sistema kudeatzaileari instalatzea.",
+"<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>Abisua:</b> Curl euskarri PHP modulua ez dago instalatuta edo gaitua. Ezinezko da ownCloud /WebDAV GoogleDrive-n muntatzea. Mesedez eskatu sistema kudeatzaileari instala dezan. ",
"External Storage" => "Kanpoko Biltegiratzea",
"Folder name" => "Karpetaren izena",
"External storage" => "Kanpoko biltegiratzea",
diff --git a/apps/files_external/l10n/fa.php b/apps/files_external/l10n/fa.php
index 1921ba9f2ae..82d3676e17c 100644
--- a/apps/files_external/l10n/fa.php
+++ b/apps/files_external/l10n/fa.php
@@ -1,5 +1,12 @@
<?php $TRANSLATIONS = array(
+"Access granted" => "مجوز دسترسی صادر شد",
+"Error configuring Dropbox storage" => "خطا به هنگام تنظیم فضای دراپ باکس",
+"Grant access" => " مجوز اعطا دسترسی",
+"Please provide a valid Dropbox app key and secret." => "لطفا یک کلید و کد امنیتی صحیح دراپ باکس وارد کنید.",
+"Error configuring Google Drive storage" => "خطا به هنگام تنظیم فضای Google Drive",
+"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "خطا: \"smbclient\" نصب نشده است. نصب و راه اندازی سهام CIFS/SMB امکان پذیر نمیباشد. لطفا از مدیریت سازمان خود برای راه اندازی آن درخواست نمایید.",
"External Storage" => "حافظه خارجی",
+"Folder name" => "نام پوشه",
"Configuration" => "پیکربندی",
"Options" => "تنظیمات",
"Applicable" => "قابل اجرا",
diff --git a/apps/files_external/l10n/ko.php b/apps/files_external/l10n/ko.php
index 47de9aad5e0..803b489c218 100644
--- a/apps/files_external/l10n/ko.php
+++ b/apps/files_external/l10n/ko.php
@@ -6,11 +6,14 @@
"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, Google 드라이브 공유를 마운트할 수 없습니다. 시스템 관리자에게 설치를 요청하십시오.",
"External Storage" => "외부 저장소",
"Folder name" => "폴더 이름",
+"External storage" => "외부 저장소",
"Configuration" => "설정",
"Options" => "옵션",
"Applicable" => "적용 가능",
+"Add storage" => "저장소 추가",
"None set" => "설정되지 않음",
"All Users" => "모든 사용자",
"Groups" => "그룹",
diff --git a/apps/files_external/l10n/lt_LT.php b/apps/files_external/l10n/lt_LT.php
index 9bf997d87cb..29c962d9a80 100644
--- a/apps/files_external/l10n/lt_LT.php
+++ b/apps/files_external/l10n/lt_LT.php
@@ -6,6 +6,7 @@
"Error configuring Google Drive storage" => "Klaida nustatinėjant Google Drive talpyklą",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Įspėjimas:</b> \"smbclient\" nėra įdiegtas. CIFS/SMB dalinimasis nėra galimas. Prašome susisiekti su sistemos administratoriumi kad būtų įdiegtas \"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>Įspėjimas:</b> FTP palaikymas PHP sistemoje nėra įjungtas arba nėra įdiegtas. FTP dalinimosi įjungimas nėra galimas. Prašome susisiekti su sistemos administratoriumi kad būtų įdiegtas FTP palaikymas. ",
+"<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>Įspėjimas:</b> \"Curl\" palaikymas PHP terpėje nėra įjungtas arba įdiegtas. ownCloud/WebDAV ar GoogleDrive įjungimas nebus įmanomas. Prašome susisiekti su sistemos administratoriumi kad būtų įdiegtas arba įjungtas \"Curl\" palaikymas.",
"External Storage" => "Išorinės saugyklos",
"Folder name" => "Katalogo pavadinimas",
"External storage" => "Išorinė saugykla",
diff --git a/apps/files_external/l10n/nn_NO.php b/apps/files_external/l10n/nn_NO.php
index 4b4b6167d88..998c3f82457 100644
--- a/apps/files_external/l10n/nn_NO.php
+++ b/apps/files_external/l10n/nn_NO.php
@@ -1,4 +1,5 @@
<?php $TRANSLATIONS = array(
+"Configuration" => "Innstillingar",
"Groups" => "Grupper",
"Users" => "Brukarar",
"Delete" => "Slett"
diff --git a/apps/files_external/l10n/sv.php b/apps/files_external/l10n/sv.php
index 45d3589228f..80e68ab6e06 100644
--- a/apps/files_external/l10n/sv.php
+++ b/apps/files_external/l10n/sv.php
@@ -6,6 +6,7 @@
"Error configuring Google Drive storage" => "Fel vid konfigurering av Google Drive",
"<b>Warning:</b> \"smbclient\" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it." => "<b>Varning:</b> \"smb-klienten\" är inte installerad. Montering av CIFS/SMB delningar är inte möjligt. Kontakta din systemadministratör för att få den installerad.",
"<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>Varning:</b> Stöd för FTP i PHP är inte aktiverat eller installerat. Montering av FTP-delningar är inte möjligt. Kontakta din systemadministratör för att få det installerat.",
+"<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>Varning:<b> Curl-stöd i PHP är inte aktiverat eller installerat. Montering av ownCloud / WebDAV eller GoogleDrive är inte möjligt. Vänligen be din administratör att installera det.",
"External Storage" => "Extern lagring",
"Folder name" => "Mappnamn",
"External storage" => "Extern lagring",
diff --git a/apps/files_external/l10n/te.php b/apps/files_external/l10n/te.php
index f557dda5592..3d31f6438f5 100644
--- a/apps/files_external/l10n/te.php
+++ b/apps/files_external/l10n/te.php
@@ -1,4 +1,5 @@
<?php $TRANSLATIONS = array(
+"Folder name" => "సంచయం పేరు",
"Users" => "వాడుకరులు",
"Delete" => "తొలగించు"
);
diff --git a/apps/files_external/l10n/zh_CN.GB2312.php b/apps/files_external/l10n/zh_CN.GB2312.php
index c74323db175..47298f8007d 100644
--- a/apps/files_external/l10n/zh_CN.GB2312.php
+++ b/apps/files_external/l10n/zh_CN.GB2312.php
@@ -6,6 +6,7 @@
"Error configuring Google Drive storage" => "配置 Google Drive 存储失败",
"<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>“SMB客户端”未安装。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 或 Google Drive 的功能将不可用。请询问您的系统管理员去安装它。",
"External Storage" => "外部存储",
"Folder name" => "文件夹名",
"External storage" => "外部存储",
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index 655c3c9a816..81a6c956385 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -57,12 +57,22 @@ class SMB extends \OC\Files\Storage\StreamWrapper{
public function stat($path) {
if ( ! $path and $this->root=='/') {//mtime doesn't work for shares
- $mtime=$this->shareMTime();
$stat=stat($this->constructUrl($path));
+ if (empty($stat)) {
+ return false;
+ }
+ $mtime=$this->shareMTime();
$stat['mtime']=$mtime;
return $stat;
} else {
- return stat($this->constructUrl($path));
+ $stat = stat($this->constructUrl($path));
+
+ // smb4php can return an empty array if the connection could not be established
+ if (empty($stat)) {
+ return false;
+ }
+
+ return $stat;
}
}
diff --git a/apps/files_external/tests/config.php b/apps/files_external/tests/config.php
index 1d4f30c713d..bac594b485f 100644
--- a/apps/files_external/tests/config.php
+++ b/apps/files_external/tests/config.php
@@ -1,4 +1,13 @@
<?php
+
+// in case there are private configurations in the users home -> use them
+$privateConfigFile = $_SERVER['HOME'] . '/owncloud-extfs-test-config.php';
+if (file_exists($privateConfigFile)) {
+ $config = include($privateConfigFile);
+ return $config;
+}
+
+// this is now more a template now for your private configurations
return array(
'ftp'=>array(
'run'=>false,