aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/appinfo/app.php2
-rw-r--r--apps/files_external/appinfo/info.xml4
-rw-r--r--apps/files_external/js/public_key.js18
-rw-r--r--apps/files_external/js/settings.js1
-rw-r--r--apps/files_external/l10n/de.js6
-rw-r--r--apps/files_external/l10n/de.json6
-rw-r--r--apps/files_external/l10n/es_MX.js34
-rw-r--r--apps/files_external/l10n/es_MX.json34
-rw-r--r--apps/files_external/l10n/nb.js8
-rw-r--r--apps/files_external/l10n/nb.json8
-rw-r--r--apps/files_external/lib/AppInfo/Application.php18
-rw-r--r--apps/files_external/lib/Controller/AjaxController.php10
-rw-r--r--apps/files_external/lib/Lib/Auth/PublicKey/RSA.php11
-rw-r--r--apps/files_external/lib/Settings/Personal.php103
-rw-r--r--apps/files_external/lib/Settings/PersonalSection.php67
-rw-r--r--apps/files_external/personal.php47
16 files changed, 252 insertions, 125 deletions
diff --git a/apps/files_external/appinfo/app.php b/apps/files_external/appinfo/app.php
index ddf609129f6..250cbbd00d1 100644
--- a/apps/files_external/appinfo/app.php
+++ b/apps/files_external/appinfo/app.php
@@ -35,8 +35,6 @@ require_once __DIR__ . '/../3rdparty/autoload.php';
\OC_Mount_Config::$app = new \OCA\Files_External\AppInfo\Application();
$appContainer = \OC_Mount_Config::$app->getContainer();
-\OC_Mount_Config::$app->registerSettings();
-
\OCA\Files\App::getNavigationManager()->add(function () {
$l = \OC::$server->getL10N('files_external');
return [
diff --git a/apps/files_external/appinfo/info.xml b/apps/files_external/appinfo/info.xml
index 5772b89ba9e..74cb3e64e43 100644
--- a/apps/files_external/appinfo/info.xml
+++ b/apps/files_external/appinfo/info.xml
@@ -14,7 +14,7 @@ External storage can be configured using the GUI or at the command line. This se
<documentation>
<admin>admin-external-storage</admin>
</documentation>
- <version>1.4.0</version>
+ <version>1.4.1</version>
<types>
<filesystem/>
</types>
@@ -29,6 +29,8 @@ External storage can be configured using the GUI or at the command line. This se
<settings>
<admin>OCA\Files_External\Settings\Admin</admin>
<admin-section>OCA\Files_External\Settings\Section</admin-section>
+ <personal>OCA\Files_External\Settings\Personal</personal>
+ <personal-section>OCA\Files_External\Settings\PersonalSection</personal-section>
</settings>
<commands>
diff --git a/apps/files_external/js/public_key.js b/apps/files_external/js/public_key.js
index 5f9658381f0..669f1095735 100644
--- a/apps/files_external/js/public_key.js
+++ b/apps/files_external/js/public_key.js
@@ -22,6 +22,19 @@ $(document).ready(function() {
});
function setupTableRow(tr, config) {
+ var selectList = document.createElement('select');
+ selectList.id = 'keyLength';
+
+ var options = [1024, 2048, 4096];
+ for (var i = 0; i < options.length; i++) {
+ var option = document.createElement('option');
+ option.value = options[i];
+ option.text = options[i];
+ selectList.appendChild(option);
+ }
+
+ $(config).append(selectList);
+
$(config).append($(document.createElement('input'))
.addClass('button auth-param')
.attr('type', 'button')
@@ -32,8 +45,11 @@ $(document).ready(function() {
function generateKeys(tr) {
var config = $(tr).find('.configuration');
+ var keyLength = config.find('#keyLength').val();
- $.post(OC.filePath('files_external', 'ajax', 'public_key.php'), {}, function(result) {
+ $.post(OC.filePath('files_external', 'ajax', 'public_key.php'), {
+ keyLength: keyLength
+ }, function(result) {
if (result && result.status === 'success') {
$(config).find('[data-parameter="public_key"]').val(result.data.public_key).keyup();
$(config).find('[data-parameter="private_key"]').val(result.data.private_key);
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 4e35ea531eb..112676b8c27 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -93,6 +93,7 @@ function addSelect2 ($elements, userListLimit) {
placeholder: t('files_external', 'All users. Type to select user or group.'),
allowClear: true,
multiple: true,
+ toggleSelect: true,
dropdownCssClass: 'files-external-select2',
//minimumInputLength: 1,
ajax: {
diff --git a/apps/files_external/l10n/de.js b/apps/files_external/l10n/de.js
index d899dad522f..d59d8895b4e 100644
--- a/apps/files_external/l10n/de.js
+++ b/apps/files_external/l10n/de.js
@@ -102,9 +102,9 @@ OC.L10N.register(
"OpenStack Object Storage" : "Openstack-Objektspeicher",
"Service name" : "Service Name",
"Request timeout (seconds)" : "Anfrage -Timeout ( Sekunden)",
- "The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "Die cURL-Unterstützung von PHP ist deaktiviert oder nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wenden Sie Sich zur Installation an den Systemadministrator.",
- "The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "Die FTP-Unterstützung von PHP ist deaktiviert oder nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wenden Sie Sich zur Installation an den Systemadministrator.",
- "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" ist nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wenden Sie Sich zur Installation an den Systemadministrator.",
+ "The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "Die cURL-Unterstützung von PHP ist deaktiviert oder nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wende Dich zur Installation an den Systemadministrator.",
+ "The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "Die FTP-Unterstützung von PHP ist deaktiviert oder nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wende Dich zur Installation an den Systemadministrator.",
+ "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" ist nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wende Dich zur Installation an den Systemadministrator.",
"External storage support" : "Unterstützung für externen Speicher",
"No external storage configured" : "Kein externer Speicher konfiguriert",
"You can add external storages in the personal settings" : "Externe Speicher können in den persönlichen Einstellungen hinzugefügt werden",
diff --git a/apps/files_external/l10n/de.json b/apps/files_external/l10n/de.json
index a755709b8d2..2f3388eac22 100644
--- a/apps/files_external/l10n/de.json
+++ b/apps/files_external/l10n/de.json
@@ -100,9 +100,9 @@
"OpenStack Object Storage" : "Openstack-Objektspeicher",
"Service name" : "Service Name",
"Request timeout (seconds)" : "Anfrage -Timeout ( Sekunden)",
- "The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "Die cURL-Unterstützung von PHP ist deaktiviert oder nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wenden Sie Sich zur Installation an den Systemadministrator.",
- "The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "Die FTP-Unterstützung von PHP ist deaktiviert oder nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wenden Sie Sich zur Installation an den Systemadministrator.",
- "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" ist nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wenden Sie Sich zur Installation an den Systemadministrator.",
+ "The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "Die cURL-Unterstützung von PHP ist deaktiviert oder nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wende Dich zur Installation an den Systemadministrator.",
+ "The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "Die FTP-Unterstützung von PHP ist deaktiviert oder nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wende Dich zur Installation an den Systemadministrator.",
+ "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" ist nicht installiert. Das Hinzufügen von %s ist nicht möglich. Bitte wende Dich zur Installation an den Systemadministrator.",
"External storage support" : "Unterstützung für externen Speicher",
"No external storage configured" : "Kein externer Speicher konfiguriert",
"You can add external storages in the personal settings" : "Externe Speicher können in den persönlichen Einstellungen hinzugefügt werden",
diff --git a/apps/files_external/l10n/es_MX.js b/apps/files_external/l10n/es_MX.js
index ff7d7d488e6..5c8427caf60 100644
--- a/apps/files_external/l10n/es_MX.js
+++ b/apps/files_external/l10n/es_MX.js
@@ -1,9 +1,9 @@
OC.L10N.register(
"files_external",
{
- "Fetching request tokens failed. Verify that your app key and secret are correct." : "Se presentó una falla al buscar las fichas de solicitud. Favor de verificar que su llave de aplicación y su secreto sean correctos. ",
- "Fetching access tokens failed. Verify that your app key and secret are correct." : "Se presentó una falla al buscar las fichas de acceso. Favor de verificar que su llave de aplicación y su secreto sean correctos. ",
- "Please provide a valid app key and secret." : "Favor de proporcionar una llave de aplicación y secreto válidos.",
+ "Fetching request tokens failed. Verify that your app key and secret are correct." : "Se presentó una falla al buscar las fichas de solicitud. Por favor verifica que tu llave de aplicación y tu secreto sean correctos. ",
+ "Fetching access tokens failed. Verify that your app key and secret are correct." : "Se presentó una falla al buscar las fichas de acceso. Por favor verifica que tu llave de aplicación y tu secreto sean correctos. ",
+ "Please provide a valid app key and secret." : "Por favor proporciona una llave de aplicación y secreto válidos.",
"Step 1 failed. Exception: %s" : "Falla en el paso 1: Excepción %s",
"Step 2 failed. Exception: %s" : "Paso 2 falló. Excepción: %s",
"External storages" : "Almacenamiento externo",
@@ -16,24 +16,24 @@ OC.L10N.register(
"Error configuring OAuth2" : "Se presentó un error al configurar OAuth2",
"Generate keys" : "Generar llaves",
"Error generating key pair" : "Se presentó un error al generar el juego de llaves",
- "All users. Type to select user or group." : "Todos los usuarios. Escriba para seleccionar el usuario o grupo",
+ "All users. Type to select user or group." : "Todos los usuarios. Escribe para seleccionar el usuario o grupo",
"(group)" : "(grupo)",
"Compatibility with Mac NFD encoding (slow)" : "Compatibilidad con codificación Mac NFD (lenta)",
"Admin defined" : "Administrador definido",
"Saved" : "Guardado",
"Saving..." : "Guardando...",
"Save" : "Guardar",
- "Empty response from the server" : "Respuesta vacía del servidor",
- "Couldn't access. Please logout and login to activate this mount point" : "No fue posible accesar. Favor de salir e iniciar sesión para activar este punto de montaje",
+ "Empty response from the server" : "Respuesta del servidor vacía",
+ "Couldn't access. Please logout and login to activate this mount point" : "No fue posible accesar. Por favor cierra e inicia sesión para activar este punto de montaje",
"Couldn't get the information from the remote server: {code} {type}" : "No fue posible obtener la información del servidor remoto: {code} {type}",
"Couldn't get the list of external mount points: {type}" : "No fue posible obtener la lista de puntos de montaje externos: {type}",
"There was an error with message: " : "Se presentó un problema con el mensaje:",
"External mount error" : "Error de montaje externo",
"external-storage" : "almacenamiento externo",
"Couldn't get the list of Windows network drive mount points: empty response from the server" : "No fue posible obtener el listado de los puntos de montaje de la unidad de red de Windows: respuesta del servidor vacía ",
- "Some of the configured external mount points are not connected. Please click on the red row(s) for more information" : "Algunos de los puntos de montaje externos configurados no se encuentran conectados. Favor de hacer click en los renglon(es) en rojo para más información",
- "Please enter the credentials for the {mount} mount" : "Favor de ingresar las credenciales para el montaje {mount}",
- "Username" : "Nombre de usuario",
+ "Some of the configured external mount points are not connected. Please click on the red row(s) for more information" : "Algunos de los puntos de montaje externos configurados no se encuentran conectados. Por favor has click en los renglon(es) en rojo para más información",
+ "Please enter the credentials for the {mount} mount" : "Por favor ingresa las credenciales para el montaje {mount}",
+ "Username" : "Usuario",
"Password" : "Contraseña",
"Credentials saved" : "Credenciales guardadas",
"Credentials saving failed" : "Se ha presentado una falla al guardar las credenciales",
@@ -46,7 +46,7 @@ OC.L10N.register(
"Not permitted to use backend \"%s\"" : "No está permitido usar el backend \"%s\"",
"Not permitted to use authentication mechanism \"%s\"" : "No está permitido el uso del mecanismo de autenticación \"%s\"",
"Unsatisfied backend parameters" : "Parametros del backend no satisfechos",
- "Unsatisfied authentication mechanism parameters" : "Parametros no satisfechos del mecanismo de autenticación",
+ "Unsatisfied authentication mechanism parameters" : "Parámetros no satisfechos del mecanismo de autenticación",
"Insufficient data: %s" : "Datos insuficientes: %s",
"%s" : "%s",
"Storage with ID \"%d\" is not user editable" : "El almacenamiento con ID \"%d\" no puede ser editado por el usuario",
@@ -61,13 +61,13 @@ OC.L10N.register(
"Client ID" : "ID del cliente",
"Client secret" : "Secreto del cliente",
"OpenStack" : "OpenStack",
- "Tenant name" : "¡No se encontraron archivos en su búsqueda que hayan sido modificados\n\n en los últimos 7 días! ",
+ "Tenant name" : "Nombre de inquilino",
"Identity endpoint URL" : "URL del punto de enlace de Identidad",
"Rackspace" : "Rackspace",
"API key" : "Llave de API",
"Global credentials" : "Credenciales globales",
"Log-in credentials, save in database" : "Credenciales de inicio de sesión, guardar en la base de datos",
- "Username and password" : "Nombre de usuario y contraseña",
+ "Username and password" : "Usuario y contraseña",
"Log-in credentials, save in session" : "Credenciales de inicio de sesión, guardar en la sesión",
"User entered, store in database" : "Usuario ingresado, almacenar en la base de datos",
"RSA public key" : "Llave pública RSA",
@@ -98,16 +98,16 @@ OC.L10N.register(
"Share" : "Compartir",
"Domain" : "Dominio",
"SMB / CIFS using OC login" : "SMB / CIFS usando inicio de sesión OC",
- "Username as share" : "Nombre de usuario como elemento compartido",
+ "Username as share" : "Usuario como elemento compartido",
"OpenStack Object Storage" : "OpenStack Object Storage",
"Service name" : "Nombre del servicio",
"Request timeout (seconds)" : "Tiemo de vida de la solicitud (segudos)",
- "The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "El soporte para cURL en PHP no se encuentra habilitado o instalado. El montaje de %s no es posible. Favor de solicitar a su administador su instalación. ",
- "The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "El soporte para FTP en PHP no se encuentra habilitado o instalado. El montaje de %s no es posible. Favor de solicitar a su administador su instalación. ",
- "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" no se encuentra instalado. El montaje de %s no es posible. Favor de solicitar a su administrador su instalación. ",
+ "The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "El soporte para cURL en PHP no se encuentra habilitado o instalado. El montaje de %s no es posible. Por favor solicita a tu administador su instalación. ",
+ "The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "El soporte para FTP en PHP no se encuentra habilitado o instalado. El montaje de %s no es posible. Por favor solicita a tu administador su instalación. ",
+ "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" no se encuentra instalado. El montaje de %s no es posible. Por favor solicita a tu administrador su instalación. ",
"External storage support" : "Soporte de almacenamiento externo",
"No external storage configured" : "No se ha configurado el almacenamiento externo",
- "You can add external storages in the personal settings" : "Usted puede agregar almacenamiento externo en las configuraciones personales",
+ "You can add external storages in the personal settings" : "Puedes agregar almacenamiento externo en las configuraciones personales",
"Name" : "Nombre",
"Storage type" : "Tipo de almacenamiento",
"Scope" : "Alcance",
diff --git a/apps/files_external/l10n/es_MX.json b/apps/files_external/l10n/es_MX.json
index 2b778b6e595..f1c44ca8395 100644
--- a/apps/files_external/l10n/es_MX.json
+++ b/apps/files_external/l10n/es_MX.json
@@ -1,7 +1,7 @@
{ "translations": {
- "Fetching request tokens failed. Verify that your app key and secret are correct." : "Se presentó una falla al buscar las fichas de solicitud. Favor de verificar que su llave de aplicación y su secreto sean correctos. ",
- "Fetching access tokens failed. Verify that your app key and secret are correct." : "Se presentó una falla al buscar las fichas de acceso. Favor de verificar que su llave de aplicación y su secreto sean correctos. ",
- "Please provide a valid app key and secret." : "Favor de proporcionar una llave de aplicación y secreto válidos.",
+ "Fetching request tokens failed. Verify that your app key and secret are correct." : "Se presentó una falla al buscar las fichas de solicitud. Por favor verifica que tu llave de aplicación y tu secreto sean correctos. ",
+ "Fetching access tokens failed. Verify that your app key and secret are correct." : "Se presentó una falla al buscar las fichas de acceso. Por favor verifica que tu llave de aplicación y tu secreto sean correctos. ",
+ "Please provide a valid app key and secret." : "Por favor proporciona una llave de aplicación y secreto válidos.",
"Step 1 failed. Exception: %s" : "Falla en el paso 1: Excepción %s",
"Step 2 failed. Exception: %s" : "Paso 2 falló. Excepción: %s",
"External storages" : "Almacenamiento externo",
@@ -14,24 +14,24 @@
"Error configuring OAuth2" : "Se presentó un error al configurar OAuth2",
"Generate keys" : "Generar llaves",
"Error generating key pair" : "Se presentó un error al generar el juego de llaves",
- "All users. Type to select user or group." : "Todos los usuarios. Escriba para seleccionar el usuario o grupo",
+ "All users. Type to select user or group." : "Todos los usuarios. Escribe para seleccionar el usuario o grupo",
"(group)" : "(grupo)",
"Compatibility with Mac NFD encoding (slow)" : "Compatibilidad con codificación Mac NFD (lenta)",
"Admin defined" : "Administrador definido",
"Saved" : "Guardado",
"Saving..." : "Guardando...",
"Save" : "Guardar",
- "Empty response from the server" : "Respuesta vacía del servidor",
- "Couldn't access. Please logout and login to activate this mount point" : "No fue posible accesar. Favor de salir e iniciar sesión para activar este punto de montaje",
+ "Empty response from the server" : "Respuesta del servidor vacía",
+ "Couldn't access. Please logout and login to activate this mount point" : "No fue posible accesar. Por favor cierra e inicia sesión para activar este punto de montaje",
"Couldn't get the information from the remote server: {code} {type}" : "No fue posible obtener la información del servidor remoto: {code} {type}",
"Couldn't get the list of external mount points: {type}" : "No fue posible obtener la lista de puntos de montaje externos: {type}",
"There was an error with message: " : "Se presentó un problema con el mensaje:",
"External mount error" : "Error de montaje externo",
"external-storage" : "almacenamiento externo",
"Couldn't get the list of Windows network drive mount points: empty response from the server" : "No fue posible obtener el listado de los puntos de montaje de la unidad de red de Windows: respuesta del servidor vacía ",
- "Some of the configured external mount points are not connected. Please click on the red row(s) for more information" : "Algunos de los puntos de montaje externos configurados no se encuentran conectados. Favor de hacer click en los renglon(es) en rojo para más información",
- "Please enter the credentials for the {mount} mount" : "Favor de ingresar las credenciales para el montaje {mount}",
- "Username" : "Nombre de usuario",
+ "Some of the configured external mount points are not connected. Please click on the red row(s) for more information" : "Algunos de los puntos de montaje externos configurados no se encuentran conectados. Por favor has click en los renglon(es) en rojo para más información",
+ "Please enter the credentials for the {mount} mount" : "Por favor ingresa las credenciales para el montaje {mount}",
+ "Username" : "Usuario",
"Password" : "Contraseña",
"Credentials saved" : "Credenciales guardadas",
"Credentials saving failed" : "Se ha presentado una falla al guardar las credenciales",
@@ -44,7 +44,7 @@
"Not permitted to use backend \"%s\"" : "No está permitido usar el backend \"%s\"",
"Not permitted to use authentication mechanism \"%s\"" : "No está permitido el uso del mecanismo de autenticación \"%s\"",
"Unsatisfied backend parameters" : "Parametros del backend no satisfechos",
- "Unsatisfied authentication mechanism parameters" : "Parametros no satisfechos del mecanismo de autenticación",
+ "Unsatisfied authentication mechanism parameters" : "Parámetros no satisfechos del mecanismo de autenticación",
"Insufficient data: %s" : "Datos insuficientes: %s",
"%s" : "%s",
"Storage with ID \"%d\" is not user editable" : "El almacenamiento con ID \"%d\" no puede ser editado por el usuario",
@@ -59,13 +59,13 @@
"Client ID" : "ID del cliente",
"Client secret" : "Secreto del cliente",
"OpenStack" : "OpenStack",
- "Tenant name" : "¡No se encontraron archivos en su búsqueda que hayan sido modificados\n\n en los últimos 7 días! ",
+ "Tenant name" : "Nombre de inquilino",
"Identity endpoint URL" : "URL del punto de enlace de Identidad",
"Rackspace" : "Rackspace",
"API key" : "Llave de API",
"Global credentials" : "Credenciales globales",
"Log-in credentials, save in database" : "Credenciales de inicio de sesión, guardar en la base de datos",
- "Username and password" : "Nombre de usuario y contraseña",
+ "Username and password" : "Usuario y contraseña",
"Log-in credentials, save in session" : "Credenciales de inicio de sesión, guardar en la sesión",
"User entered, store in database" : "Usuario ingresado, almacenar en la base de datos",
"RSA public key" : "Llave pública RSA",
@@ -96,16 +96,16 @@
"Share" : "Compartir",
"Domain" : "Dominio",
"SMB / CIFS using OC login" : "SMB / CIFS usando inicio de sesión OC",
- "Username as share" : "Nombre de usuario como elemento compartido",
+ "Username as share" : "Usuario como elemento compartido",
"OpenStack Object Storage" : "OpenStack Object Storage",
"Service name" : "Nombre del servicio",
"Request timeout (seconds)" : "Tiemo de vida de la solicitud (segudos)",
- "The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "El soporte para cURL en PHP no se encuentra habilitado o instalado. El montaje de %s no es posible. Favor de solicitar a su administador su instalación. ",
- "The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "El soporte para FTP en PHP no se encuentra habilitado o instalado. El montaje de %s no es posible. Favor de solicitar a su administador su instalación. ",
- "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" no se encuentra instalado. El montaje de %s no es posible. Favor de solicitar a su administrador su instalación. ",
+ "The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "El soporte para cURL en PHP no se encuentra habilitado o instalado. El montaje de %s no es posible. Por favor solicita a tu administador su instalación. ",
+ "The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "El soporte para FTP en PHP no se encuentra habilitado o instalado. El montaje de %s no es posible. Por favor solicita a tu administador su instalación. ",
+ "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" no se encuentra instalado. El montaje de %s no es posible. Por favor solicita a tu administrador su instalación. ",
"External storage support" : "Soporte de almacenamiento externo",
"No external storage configured" : "No se ha configurado el almacenamiento externo",
- "You can add external storages in the personal settings" : "Usted puede agregar almacenamiento externo en las configuraciones personales",
+ "You can add external storages in the personal settings" : "Puedes agregar almacenamiento externo en las configuraciones personales",
"Name" : "Nombre",
"Storage type" : "Tipo de almacenamiento",
"Scope" : "Alcance",
diff --git a/apps/files_external/l10n/nb.js b/apps/files_external/l10n/nb.js
index b4620b5f20a..9a751ca44bc 100644
--- a/apps/files_external/l10n/nb.js
+++ b/apps/files_external/l10n/nb.js
@@ -1,9 +1,9 @@
OC.L10N.register(
"files_external",
{
- "Fetching request tokens failed. Verify that your app key and secret are correct." : "Henting av henvendelsessymboler mislyktes. Sjekk at app-nøkkelen og hemmeligheten din stemmer. ",
- "Fetching access tokens failed. Verify that your app key and secret are correct." : "Henting av adgangssymboler mislyktes. Sjekk at app-nøkkelen og hemmeligheten din stemmer.",
- "Please provide a valid app key and secret." : "Vær vennlig å oppgi gyldig appnøkkel og hemmelighet.",
+ "Fetching request tokens failed. Verify that your app key and secret are correct." : "Henting av henvendelsessymboler mislyktes. Sjekk at programnøkkelen og hemmeligheten din stemmer. ",
+ "Fetching access tokens failed. Verify that your app key and secret are correct." : "Henting av adgangssymboler mislyktes. Sjekk at programnøkkelen og hemmeligheten din stemmer.",
+ "Please provide a valid app key and secret." : "Oppgi gyldig programnøkkel og hemmelighet.",
"Step 1 failed. Exception: %s" : "Steg 1 mislyktes. Unntak: %s",
"Step 2 failed. Exception: %s" : "Steg 2 mislyktes. Unntak: %s",
"External storages" : "Ekstern lagring",
@@ -104,7 +104,7 @@ OC.L10N.register(
"Request timeout (seconds)" : "Tidsavbrudd for forespørsel (sekunder)",
"The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>Merk:</b> Støtte for cURL i PHP er ikke aktivert eller installert. Oppkobling av %s er ikke mulig. Be systemadministratoren om å installere det.",
"The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>Merk:</b> FTP-støtte i PHP er ikke slått på eller installert. Kan ikke koble opp %s. Ta kontakt med systemadministratoren for å få dette installert.",
- "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" er ikke installert. Oppkobling av %s er ikke mulig. Vennligst spør din systemadministrator om å installere det.",
+ "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" er ikke installert. Oppkobling av %s er ikke mulig. Spør din systemadministrator om å installere det.",
"External storage support" : "Støtte for lagring eksternt",
"No external storage configured" : "Eksternt lager er ikke konfigurert",
"You can add external storages in the personal settings" : "Du kan legge til eksterne lagre i personlige innstillinger",
diff --git a/apps/files_external/l10n/nb.json b/apps/files_external/l10n/nb.json
index 8611584c4dc..66a1a58fe45 100644
--- a/apps/files_external/l10n/nb.json
+++ b/apps/files_external/l10n/nb.json
@@ -1,7 +1,7 @@
{ "translations": {
- "Fetching request tokens failed. Verify that your app key and secret are correct." : "Henting av henvendelsessymboler mislyktes. Sjekk at app-nøkkelen og hemmeligheten din stemmer. ",
- "Fetching access tokens failed. Verify that your app key and secret are correct." : "Henting av adgangssymboler mislyktes. Sjekk at app-nøkkelen og hemmeligheten din stemmer.",
- "Please provide a valid app key and secret." : "Vær vennlig å oppgi gyldig appnøkkel og hemmelighet.",
+ "Fetching request tokens failed. Verify that your app key and secret are correct." : "Henting av henvendelsessymboler mislyktes. Sjekk at programnøkkelen og hemmeligheten din stemmer. ",
+ "Fetching access tokens failed. Verify that your app key and secret are correct." : "Henting av adgangssymboler mislyktes. Sjekk at programnøkkelen og hemmeligheten din stemmer.",
+ "Please provide a valid app key and secret." : "Oppgi gyldig programnøkkel og hemmelighet.",
"Step 1 failed. Exception: %s" : "Steg 1 mislyktes. Unntak: %s",
"Step 2 failed. Exception: %s" : "Steg 2 mislyktes. Unntak: %s",
"External storages" : "Ekstern lagring",
@@ -102,7 +102,7 @@
"Request timeout (seconds)" : "Tidsavbrudd for forespørsel (sekunder)",
"The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>Merk:</b> Støtte for cURL i PHP er ikke aktivert eller installert. Oppkobling av %s er ikke mulig. Be systemadministratoren om å installere det.",
"The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "<b>Merk:</b> FTP-støtte i PHP er ikke slått på eller installert. Kan ikke koble opp %s. Ta kontakt med systemadministratoren for å få dette installert.",
- "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" er ikke installert. Oppkobling av %s er ikke mulig. Vennligst spør din systemadministrator om å installere det.",
+ "\"%s\" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it." : "\"%s\" er ikke installert. Oppkobling av %s er ikke mulig. Spør din systemadministrator om å installere det.",
"External storage support" : "Støtte for lagring eksternt",
"No external storage configured" : "Eksternt lager er ikke konfigurert",
"You can add external storages in the personal settings" : "Du kan legge til eksterne lagre i personlige innstillinger",
diff --git a/apps/files_external/lib/AppInfo/Application.php b/apps/files_external/lib/AppInfo/Application.php
index fcf10adb375..0bbb81dfea2 100644
--- a/apps/files_external/lib/AppInfo/Application.php
+++ b/apps/files_external/lib/AppInfo/Application.php
@@ -65,24 +65,6 @@ class Application extends App implements IBackendProvider, IAuthMechanismProvide
}
/**
- * Register settings templates
- */
- public function registerSettings() {
- $container = $this->getContainer();
- $userSession = $container->getServer()->getUserSession();
- if (!$userSession->isLoggedIn()) {
- return;
- }
- $backendService = $container->query('OCA\\Files_External\\Service\\BackendService');
-
- /** @var \OCA\Files_External\Service\UserGlobalStoragesService $userGlobalStoragesService */
- $userGlobalStoragesService = $container->query('OCA\Files_External\Service\UserGlobalStoragesService');
- if (count($userGlobalStoragesService->getStorages()) > 0 || $backendService->isUserMountingAllowed()) {
- \OCP\App::registerPersonal('files_external', 'personal');
- }
- }
-
- /**
* @{inheritdoc}
*/
public function getBackends() {
diff --git a/apps/files_external/lib/Controller/AjaxController.php b/apps/files_external/lib/Controller/AjaxController.php
index f12f8450973..5f5b32cffb6 100644
--- a/apps/files_external/lib/Controller/AjaxController.php
+++ b/apps/files_external/lib/Controller/AjaxController.php
@@ -68,10 +68,11 @@ class AjaxController extends Controller {
}
/**
+ * @param int $keyLength
* @return array
*/
- private function generateSshKeys() {
- $key = $this->rsaMechanism->createKey();
+ private function generateSshKeys($keyLength) {
+ $key = $this->rsaMechanism->createKey($keyLength);
// Replace the placeholder label with a more meaningful one
$key['publickey'] = str_replace('phpseclib-generated-key', gethostname(), $key['publickey']);
@@ -82,9 +83,10 @@ class AjaxController extends Controller {
* Generates an SSH public/private key pair.
*
* @NoAdminRequired
+ * @param int $keyLength
*/
- public function getSshKeys() {
- $key = $this->generateSshKeys();
+ public function getSshKeys($keyLength = 1024) {
+ $key = $this->generateSshKeys($keyLength);
return new JSONResponse(
array('data' => array(
'private_key' => $key['privatekey'],
diff --git a/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php b/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php
index cb387b22012..8dedf8c5196 100644
--- a/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php
+++ b/apps/files_external/lib/Lib/Auth/PublicKey/RSA.php
@@ -35,8 +35,6 @@ use \phpseclib\Crypt\RSA as RSACrypt;
*/
class RSA extends AuthMechanism {
- const CREATE_KEY_BITS = 1024;
-
/** @var IConfig */
private $config;
@@ -69,14 +67,19 @@ class RSA extends AuthMechanism {
/**
* Generate a keypair
*
+ * @param int $keyLenth
* @return array ['privatekey' => $privateKey, 'publickey' => $publicKey]
*/
- public function createKey() {
+ public function createKey($keyLength) {
$rsa = new RSACrypt();
$rsa->setPublicKeyFormat(RSACrypt::PUBLIC_FORMAT_OPENSSH);
$rsa->setPassword($this->config->getSystemValue('secret', ''));
- return $rsa->createKey(self::CREATE_KEY_BITS);
+ if ($keyLength !== 1024 && $keyLength !== 2048 && $keyLength !== 4096) {
+ $keyLength = 1024;
+ }
+
+ return $rsa->createKey($keyLength);
}
}
diff --git a/apps/files_external/lib/Settings/Personal.php b/apps/files_external/lib/Settings/Personal.php
new file mode 100644
index 00000000000..946ba9f6944
--- /dev/null
+++ b/apps/files_external/lib/Settings/Personal.php
@@ -0,0 +1,103 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Files_External\Settings;
+
+use OCA\Files_External\Lib\Auth\Password\GlobalAuth;
+use OCA\Files_External\Service\BackendService;
+use OCA\Files_External\Service\GlobalStoragesService;
+use OCA\Files_External\Service\UserGlobalStoragesService;
+use OCP\AppFramework\Http\TemplateResponse;
+use OCP\Encryption\IManager;
+use OCP\IUserSession;
+use OCP\Settings\ISettings;
+
+class Personal implements ISettings {
+
+ /** @var IManager */
+ private $encryptionManager;
+
+ /** @var UserGlobalStoragesService */
+ private $userGlobalStoragesService;
+
+ /** @var BackendService */
+ private $backendService;
+
+ /** @var GlobalAuth */
+ private $globalAuth;
+
+ /** @var IUserSession */
+ private $userSession;
+
+ public function __construct(
+ IManager $encryptionManager,
+ UserGlobalStoragesService $userGlobalStoragesService,
+ BackendService $backendService,
+ GlobalAuth $globalAuth,
+ IUserSession $userSession
+ ) {
+ $this->encryptionManager = $encryptionManager;
+ $this->userGlobalStoragesService = $userGlobalStoragesService;
+ $this->backendService = $backendService;
+ $this->globalAuth = $globalAuth;
+ $this->userSession = $userSession;
+ }
+
+ /**
+ * @return TemplateResponse
+ */
+ public function getForm() {
+ $uid = $this->userSession->getUser()->getUID();
+
+ $parameters = [
+ 'encryptionEnabled' => $this->encryptionManager->isEnabled(),
+ 'visibilityType' => BackendService::VISIBILITY_PERSONAL,
+ 'storages' => $this->userGlobalStoragesService->getStorages(),
+ 'backends' => $this->backendService->getAvailableBackends(),
+ 'authMechanisms' => $this->backendService->getAuthMechanisms(),
+ 'dependencies' => \OC_Mount_Config::dependencyMessage($this->backendService->getBackends()),
+ 'allowUserMounting' => $this->backendService->isUserMountingAllowed(),
+ 'globalCredentials' => $this->globalAuth->getAuth($uid),
+ 'globalCredentialsUid' => $uid,
+ ];
+
+ return new TemplateResponse('files_external', 'settings', $parameters, '');
+ }
+
+ /**
+ * @return string the section ID, e.g. 'sharing'
+ */
+ public function getSection() {
+ return 'externalstorages';
+ }
+
+ /**
+ * @return int whether the form should be rather on the top or bottom of
+ * the admin section. The forms are arranged in ascending order of the
+ * priority values. It is required to return a value between 0 and 100.
+ *
+ * E.g.: 70
+ */
+ public function getPriority() {
+ return 40;
+ }
+
+}
diff --git a/apps/files_external/lib/Settings/PersonalSection.php b/apps/files_external/lib/Settings/PersonalSection.php
new file mode 100644
index 00000000000..32a841c420a
--- /dev/null
+++ b/apps/files_external/lib/Settings/PersonalSection.php
@@ -0,0 +1,67 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Robin Appelman <robin@icewind.nl>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Files_External\Settings;
+
+
+use OCA\Files_External\Service\BackendService;
+use OCA\Files_External\Service\UserGlobalStoragesService;
+use OCP\IL10N;
+use OCP\IURLGenerator;
+use OCP\IUserSession;
+
+class PersonalSection extends Section {
+ /** @var IUserSession */
+ private $userSession;
+
+ /** @var UserGlobalStoragesService */
+ private $userGlobalStoragesService;
+
+ /** @var BackendService */
+ private $backendService;
+
+ public function __construct(
+ IURLGenerator $url,
+ IL10N $l,
+ IUserSession $userSession,
+ UserGlobalStoragesService $userGlobalStoragesService,
+ BackendService $backendService
+ ) {
+ parent::__construct($url, $l);
+ $this->userSession = $userSession;
+ $this->userGlobalStoragesService = $userGlobalStoragesService;
+ $this->backendService = $backendService;
+ }
+
+ public function getID() {
+ if (!$this->userSession->isLoggedIn()) {
+ // we need to return the proper id while installing/upgrading the app
+ return parent::getID();
+ }
+
+ if (count($this->userGlobalStoragesService->getStorages()) > 0 || $this->backendService->isUserMountingAllowed()) {
+ return parent::getID();
+ } else {
+ // by returning a different id, no matching settings will be found and the item will be hidden
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/apps/files_external/personal.php b/apps/files_external/personal.php
deleted file mode 100644
index e2131252384..00000000000
--- a/apps/files_external/personal.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Joas Schilling <coding@schilljs.com>
- * @author Michael Gapczynski <GapczynskiM@gmail.com>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <robin@icewind.nl>
- * @author Robin McCorkell <robin@mccorkell.me.uk>
- * @author Vincent Petry <pvince81@owncloud.com>
- *
- * @license AGPL-3.0
- *
- * This code is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License, version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License, version 3,
- * along with this program. If not, see <http://www.gnu.org/licenses/>
- *
- */
-
-use \OCA\Files_External\Service\BackendService;
-
-// we must use the same container
-$appContainer = \OC_Mount_Config::$app->getContainer();
-$backendService = $appContainer->query('OCA\Files_External\Service\BackendService');
-$userStoragesService = $appContainer->query('OCA\Files_External\Service\UserStoragesService');
-$globalAuth = $appContainer->query('OCA\Files_External\Lib\Auth\Password\GlobalAuth');
-
-$tmpl = new OCP\Template('files_external', 'settings');
-$tmpl->assign('encryptionEnabled', \OC::$server->getEncryptionManager()->isEnabled());
-$tmpl->assign('visibilityType', BackendService::VISIBILITY_PERSONAL);
-$tmpl->assign('storages', $userStoragesService->getStorages());
-$tmpl->assign('dependencies', OC_Mount_Config::dependencyMessage($backendService->getBackends()));
-$tmpl->assign('backends', $backendService->getAvailableBackends());
-$tmpl->assign('authMechanisms', $backendService->getAuthMechanisms());
-$uid = \OC::$server->getUserSession()->getUser()->getUID();
-$tmpl->assign('globalCredentials', $globalAuth->getAuth($uid));
-$tmpl->assign('globalCredentialsUid', $uid);
-$tmpl->assign('allowUserMounting', $backendService->isUserMountingAllowed());
-return $tmpl->fetchPage();