diff --git a/roundcube/appinfo/app.php b/roundcube/appinfo/app.php index e1131b6..c9181bd 100644 --- a/roundcube/appinfo/app.php +++ b/roundcube/appinfo/app.php @@ -1,6 +1,6 @@ RoundCube Mail AGPL Martin Reinhardt; Leonardo R. Morelli - 10.0.0 + 10.0.1 - Integrates existing roundcube into OwnCloud, check the instructions below. + Integrates existing roundcube into OwnCloud. - - - https://github.com/hypery2k/owncloud/wiki/Installation#roundcube - - - https://github.com/hypery2k/owncloud + https://github.com/LeonardoRM/owncloud-roundcube/ diff --git a/roundcube/appinfo/routes.php b/roundcube/appinfo/routes.php index 66f0649..4a39772 100644 --- a/roundcube/appinfo/routes.php +++ b/roundcube/appinfo/routes.php @@ -1,4 +1,25 @@ . + * + */ return ['routes' => [ ['name' => 'page#index', 'url' => '/', 'verb' => 'GET'], //settings diff --git a/roundcube/css/adminSettings.css b/roundcube/css/adminSettings.css new file mode 100644 index 0000000..1f0da0d --- /dev/null +++ b/roundcube/css/adminSettings.css @@ -0,0 +1,6 @@ +.rcSetting { + margin-bottom: 24px; +} +#rcAddDomainPath { + display: inline-block; +} diff --git a/roundcube/js/adminSettings.js b/roundcube/js/adminSettings.js index 55c8791..712fbff 100644 --- a/roundcube/js/adminSettings.js +++ b/roundcube/js/adminSettings.js @@ -8,20 +8,32 @@ Roundcube.adminSettingsUI = function() { if ($('#roundcube').length <= 0) { return; } + $('#rcAddDomainPath').click(function() { + document.getElementById('rcTableDomainPath').tBodies[0].appendChild( + document.importNode( + document.getElementById('rcDomainPath').content, + true + ) + ); + }); + $('#rcTableDomainPath').on('click', '.action.delete', function() { + $(this).closest('tr').remove(); + }); $('#rcAdminSubmit').click(function(event) { event.preventDefault(); // Prevent CSRF with OC request token $('#requesttoken').val(oc_requesttoken); - var data = $('#rcMailAdminPrefs').serialize(); + var data = $('#rcAdminSettings').serialize(); $('#rc_save_success, #rc_save_error').hide(); $('#rc_save_status').show(); // Ajax $.post(OC.filePath('roundcube', 'ajax', 'adminSettings.php'), data, function(res) { $('#rc_save_status').hide(); if (res.status == 'success') { - $('#maildir').val(res.config.maildir); + $('#defaultRCPath').val(res.config.defaultRCPath); $('#rc_save_success').text(res.message).show().delay(2000).fadeOut(2000); + } else if (res.status == 'error') { $('#rc_save_error').text(res.message).show(); } }, 'json'); diff --git a/roundcube/js/app.js b/roundcube/js/app.js index 5b45672..833ba8f 100644 --- a/roundcube/js/app.js +++ b/roundcube/js/app.js @@ -5,7 +5,7 @@ var Roundcube = Roundcube || {}; * This is only for larry/melanie2_larry_mobile skins. * For other skins we don't do anything. */ -Roundcube.modIframe = function() { +Roundcube.hideTopLine = function() { var rcf = $("#roundcubeFrame"); if (!rcf[0].contentWindow.rcmail.env.skin.includes("larry")) { return; @@ -64,9 +64,11 @@ Roundcube.resizeIframe = function() { } $('#roundcubeFrame').ready(function() { - $('#roundcubeFrame').load(function() { - Roundcube.modIframe(); - }); + if (!$('#roundcubeFrame').hasClass('showTopLine')) { + $('#roundcubeFrame').load(function() { + Roundcube.hideTopLine(); + }); + } Roundcube.resizeIframe(); }); diff --git a/roundcube/js/mail.js b/roundcube/js/mail.js deleted file mode 100644 index ed5e204..0000000 --- a/roundcube/js/mail.js +++ /dev/null @@ -1,204 +0,0 @@ -// Declare namespace -var Roundcube = Roundcube || {}; - -/** - * Fills height of window (more precise than height: 100%;) - */ -Roundcube.fillHeight = function(selector) { - var height = $(window).height() - selector.offset().top; - selector.css('height', height); - if (selector.outerHeight() > selector.height()) { - selector.css('height', height - (selector.outerHeight() - selector.height())); - } -} -/** - * Fills width of window (more precise than width: 100%;) - */ -Roundcube.fillWidth = function(selector) { - var width = $(window).width() - selector.offset().left; - selector.css('width', width); - if (selector.outerWidth() > selector.width()) { - selector.css('width', width - (selector.outerWidth() - selector.width())); - } -} -/** - * Fills height and width of RC window. - * More precise than height/width: 100%. - */ -Roundcube.fillWindow = function(selector) { - if (selector.length === 0) { - return; - } - Roundcube.fillHeight(selector); - Roundcube.fillWidth(selector); -} - -/** - * Callback js function during after iframe loaded completly - */ -Roundcube.iframe_loaded = function() { - var roundcubeContents = $('#roundcubeFrame').contents(); - var roundcubeContentsMainscreen = roundcubeContents.find('#mainscreen'), - roundcubeContentsToolbar = roundcubeContents.find('#messagetoolbar'), - // remove header line, includes about line and - roundcubeContentsTopline = roundcubeContents.find('#topline'), - // correct top padding - top_margin = 10, - rc_version = '', - rc_theme = ''; - - try { - var top_nav = roundcubeContents.find('#topnav'); - // check if the above element exits (only in new larry theme, if null - // use rc 0.7 default theme - - if (top_nav.height() != null) { - rc_theme = 'larry'; - - var minimize_toggle = roundcubeContents.find('.minmodetoggle'); - if (minimize_toggle.height() != null) { - rc_version = "0-9"; - } else { - rc_version = "0-8"; - } - } else { - rc_version = "0-7"; - } - - switch (rc_theme) { - case "larry": - top_margin = 10; - // In larry theme with accounts plugin, we have to move the account - // selection - var acc_select = roundcubeContentsTopline.find('.username'); - if (acc_select) { - roundcubeContentsToolbar.attr('id', 'ocrcMessagetoolbar'); - var searchfilter = roundcubeContentsMainscreen.find('div#searchfilter'); - // Quick n dirty for space - acc_select.appendTo(searchfilter); - searchfilter.css({ - position : 'absolute', - top : '0px', - width : '160px', - right : '256px', - top : '7px' - }); - searchfilter.find('select#rcmlistfilter').css('width', '158px'); - searchfilter.find('a.menuselector').css('width', '158px'); - searchfilter.find('span.handle').css('width', '120px'); - var messagetoolbar = roundcubeContentsMainscreen.find('div#ocrcMessagetoolbar'); - messagetoolbar.css({ - left : '0', - right : '390px' - }); - // Extend messagetoolbar, if fullwidth is specified - roundcubeContentsMainscreen.find('.fullwidth').css('right', '0px'); - var toolbarselect = messagetoolbar.find('.toolbarselect'); - toolbarselect.css('position', 'absolute'); - toolbarselect.css('bottom', '6px'); - toolbarselect.css('right', '3px'); - } - break; - } - - switch (rc_version) { - case "0-7": - rc_version = "0-7"; - top_margin = parseInt(roundcubeContentsMainscreen.css('top'), 10) - roundcubeContentsTopline.height(); - // fix layout button issue on roundcube 0.7 - roundcubeContentsToolbar.css('padding', '20px 6px 5px 0px'); - roundcubeContentsToolbar.css('z-index', '100'); - break; - case "0-9": - roundcubeContents.find('body').removeAttr('class'); - roundcubeContents.find('.minmodetoggle').remove(); - break; - } - } catch (e) { - } - roundcubeContentsTopline.remove(); - - // fix topbar, issue https://github.com/hypery2k/owncloud/issues/54 - roundcubeContents.find('.toolbar').css('z-index', '80'); - roundcubeContents.find('.toolbar').css('position', 'absolute'); - - // remove logout button - roundcubeContents.find('.button-logout').remove(); - - // check if the header menu from roundcube was disabled - if ($('#disable_header_nav').val() === 'on') { - var top_nav = roundcubeContents.contents().find('#header'); - // check if the above element exists (only in new larry theme, if null - // use rc 0.7 default theme - if (top_nav.val() === undefined) { - top_nav = roundcubeContents.find('#taskbar'); - } else { - // new theme settings goes here - } - top_nav.remove(); - - roundcubeContentsMainscreen.css('top', top_margin); - } else { - if (top_nav.val() === undefined) { - top_nav = roundcubeContents.find('#taskbar'); - roundcubeContentsToolbar.css('top', '0px'); - roundcubeContentsToolbar.css('border', '0'); - roundcubeContentsMainscreen.css('top', '70px'); - } else { - // new theme settings goes here - // correct top padding - roundcubeContentsMainscreen.css('top', '50px'); - } - } - - // remove email address - roundcubeContents.find('.username').remove(); - - // RC only checks for visibility of the preview - // window. However, as with start with display:none for the - // entire frame, the preview window is indeed not visible at - // the start when RC initializes itself. - // - // However, this seems to be a Firefox-only problem. - var mailPrev = roundcubeContents.find('#mailpreviewframe'); - if (mailPrev.length && mailPrev.css('display') != 'none') { - $('#roundcubeFrame')[0].contentWindow.rcmail.set_env('contentframe', 'messagecontframe'); - } -}; - -/** - * Js functions called if iframe loaded - */ -Roundcube.iFrameReady = function(selector) { - $(window).resize(function() { - if (Roundcube.logdebug) { - console.log("Starting roundcube container resize ..."); - } - Roundcube.fillWindow($('#roundcube_container')); - Roundcube.iframe_loaded(); - }); - $('#roundcubeFrame').load(function() { - if (Roundcube.logdebug) { - console.log("Starting roundcube container resize ..."); - } - Roundcube.fillWindow($('#roundcube_container')); - Roundcube.iframe_loaded(); - }); - // check if the control menu from roundcube was disabled - if ($('#disable_control_nav').val() === '1') { - $('#roundcube_container').css('top', '3.5em'); - } - - // slide in roundcube nice with timeout to let iframe load - $("#roundcubeLoaderContainer").fadeOut(2500); - $(window).resize(); - $('#roundcubeFrame').show(); - Roundcube.iframe_loaded(); -} - -/** - * init js function during frame load - */ -$('#roundcubeFrame').ready(function() { - Roundcube.iFrameReady(); -}); diff --git a/roundcube/l10n/es.js b/roundcube/l10n/es.js index b064c02..f4f25f2 100644 --- a/roundcube/l10n/es.js +++ b/roundcube/l10n/es.js @@ -3,30 +3,27 @@ OC.L10N.register( { "Webmail" : "Webmail", "Not submitted for us." : "No enviado para nosotros.", - "Maildir can't be an empty string." : "Maildir no puede estar vacía.", - "Host is not valid." : "El host no es válido.", - "Port must be a valid port number or left empty." : "El número de puerto debe ser válido o dejado vacío.", - "Internal address '%s' is not an URL" : "La dirección interna '%s' no es una URL.", + "Default RC installation path can't be an empty string." : "La ruta por defecto de la instalación del RC no puede ser vacía.", + "Default path must be a url relative to this server." : "La ruta por defecto debe ser una url relativa a este servidor.", + "A domain is not valid." : "Uno de los dominios no es válido.", + "A path is not valid." : "Una de las rutas no es válida.", + "Paths must be urls relative to this server." : "Las rutas deben ser urls relativas a este servidor.", + "Unpaired domains and paths." : "El número de dominios y rutas no es parejo.", "Some inputs are not valid." : "Algunas entradas no son válidas.", "Application settings successfully stored." : "Configuración de la aplicación guardada con éxito.", - "Usuario 'admin' no hace Auto-Login." : "Usuario 'admin' no hace Auto-Login.", "Unable to login into roundcube. There are login errors." : "No se puede hacer login en RoundCube. Hay errores de login.", - "Basic settings" : "Configuración básica", - "If you have \"http://example.com/roundcube\" enter \"/roundcube/\" here. Note that subdomains or URLs do not work, just absolute paths to the same domain ownCloud is running." : "Si se tiene \"http://example.com/roundcube\", ingresar \"/roundcube/\" aquí. Notar que subdominios o URLs no funcionan, sólo rutas absolutas al mismo dominio en el que está ejecutándose ownCloud.", - "Absolute path to RC installation" : "Ruta absoluta a la instalación del RC.", + "Username '%s' is not an email address." : "El usuario '%s' no es un email válido.", + "Default RC installation path" : "Ruta por defecto al RC", + "Default path relative to ownCloud server (%s)." : "Ruta por defecto relativa al servidor ownCloud (%s).", + "Per email domain RC installations" : "Rutas a RC por dominio de email", + "Enter your users' email domains and their corresponding paths if you have different RoundCube installations. For example: 'domain1.com':'roundcube1/', 'domain2.com':'roundcube2/'. Path relative to ownCloud server." : "Ingresar los dominios de los emails de sus usuarios y las correspondientes rutas si tiene diferentes instalaciones de RoundCube. Por ejemplo: 'domain1.com':'roundcube1/', 'domain2.com':'roundcube2/'. Rutas relativas al servidor ownCloud.", + "Remove" : "Quitar", + "Add" : "Agregar", "Advanced settings" : "Configuración avanzada", - "Show RoundCube control navigation menu items with currently logged in user information" : "Mostrar menú de control de navegación del RC con información del usuario logueado.", - "Show information bar on top of page" : "Mostrar barra de información arriba de la página.", - "Enable SSL verification, e.g. disable for self-signed certificates" : "Habilitar verificación SSL (deshabilitar para certificados auto-firmados).", - "Enable debug messages. RC tends to bloat the log-files." : "Habilitar mensajes de depuración. RC tiende a llenar los archivos de log.", - "Enable debug logging" : "Habilitar depuración.", - "Overwrite roundcube server hostname if not the same as owncloud, e.g. for (sub)domains which resides on the same server, e.g rc.domain.tld. But keep in mind that due to iFrame security constraints it will be only working on the same server, see HTML/JS same-origin policies." : "Sobreescribir el hostname del servidor de RC si no es el mismo que ownCloud, ej.: para (sub)dominios que residan en el mismo servidor (rc.dominio.tld). Tener en cuenta que sólo funcionará en el mismo servidor por las restricciones de seguridad del iFrame. Ver políticas de HTML/JS same-origin.", - "Overwrite RC server hostname" : "Sobreescribir el hostname del servidor de RC.", - "Overwrite roundcube server port (If not specified, ports 80/443 are used for HTTP/S)." : "Sobreescribir el puerto del servidor de RC. (Si no se especifica, se usan los puertos 80/443 para HTTP/S.", - "Overwrite RC server port" : "Sobreescribir el puerto del servidor de RC.", - "Internal RoundCube address (as seen by the OwnCloud server). Use this if the internal address, to which OwnCloud should connect when talking to RoundCube, does not match the host and port set above." : "Dirección interna del RC (como la ve el servidor ownCloud). Usar esto si la dirección interna, a la que el ownCloud se debería conectar cuando habla con RC, no concuerda con el host y puerto de arriba.", - "Internal RC address" : "Dirección interna del RC.", - "Saving..." : "Guardando...", - "Save" : "Guardar" + "Show RoundCube top information bar (shows logout button)." : "Mostrar barra de información de RoundCube arriba (muestra botón de logout).", + "Disable when debugging with self-signed certificates." : "Deshabilitar para depurar con certificados auto-firmados.", + "Enable SSL verification." : "Habilitar verificación SSL.", + "Save" : "Guardar", + "Saving..." : "Guardando..." }, ""); diff --git a/roundcube/l10n/es.json b/roundcube/l10n/es.json index 54cb3a7..c1b64c9 100644 --- a/roundcube/l10n/es.json +++ b/roundcube/l10n/es.json @@ -1,30 +1,27 @@ { "translations": { "Webmail" : "Webmail", "Not submitted for us." : "No enviado para nosotros.", - "Maildir can't be an empty string." : "Maildir no puede estar vacía.", - "Host is not valid." : "El host no es válido.", - "Port must be a valid port number or left empty." : "El número de puerto debe ser válido o dejado vacío.", - "Internal address '%s' is not an URL" : "La dirección interna '%s' no es una URL.", + "Default RC installation path can't be an empty string." : "La ruta por defecto de la instalación del RC no puede ser vacía.", + "Default path must be a url relative to this server." : "La ruta por defecto debe ser una url relativa a este servidor.", + "A domain is not valid." : "Uno de los dominios no es válido.", + "A path is not valid." : "Una de las rutas no es válida.", + "Paths must be urls relative to this server." : "Las rutas deben ser urls relativas a este servidor.", + "Unpaired domains and paths." : "El número de dominios y rutas no es parejo.", "Some inputs are not valid." : "Algunas entradas no son válidas.", "Application settings successfully stored." : "Configuración de la aplicación guardada con éxito.", - "Usuario 'admin' no hace Auto-Login." : "Usuario 'admin' no hace Auto-Login.", "Unable to login into roundcube. There are login errors." : "No se puede hacer login en RoundCube. Hay errores de login.", - "Basic settings" : "Configuración básica", - "If you have \"http://example.com/roundcube\" enter \"/roundcube/\" here. Note that subdomains or URLs do not work, just absolute paths to the same domain ownCloud is running." : "Si se tiene \"http://example.com/roundcube\", ingresar \"/roundcube/\" aquí. Notar que subdominios o URLs no funcionan, sólo rutas absolutas al mismo dominio en el que está ejecutándose ownCloud.", - "Absolute path to RC installation" : "Ruta absoluta a la instalación del RC.", + "Username '%s' is not an email address." : "El usuario '%s' no es un email válido.", + "Default RC installation path" : "Ruta por defecto al RC", + "Default path relative to ownCloud server (%s)." : "Ruta por defecto relativa al servidor ownCloud (%s).", + "Per email domain RC installations" : "Rutas a RC por dominio de email", + "Enter your users' email domains and their corresponding paths if you have different RoundCube installations. For example: 'domain1.com':'roundcube1/', 'domain2.com':'roundcube2/'. Path relative to ownCloud server." : "Ingresar los dominios de los emails de sus usuarios y las correspondientes rutas si tiene diferentes instalaciones de RoundCube. Por ejemplo: 'domain1.com':'roundcube1/', 'domain2.com':'roundcube2/'. Rutas relativas al servidor ownCloud.", + "Remove" : "Quitar", + "Add" : "Agregar", "Advanced settings" : "Configuración avanzada", - "Show RoundCube control navigation menu items with currently logged in user information" : "Mostrar menú de control de navegación del RC con información del usuario logueado.", - "Show information bar on top of page" : "Mostrar barra de información arriba de la página.", - "Enable SSL verification, e.g. disable for self-signed certificates" : "Habilitar verificación SSL (deshabilitar para certificados auto-firmados).", - "Enable debug messages. RC tends to bloat the log-files." : "Habilitar mensajes de depuración. RC tiende a llenar los archivos de log.", - "Enable debug logging" : "Habilitar depuración.", - "Overwrite roundcube server hostname if not the same as owncloud, e.g. for (sub)domains which resides on the same server, e.g rc.domain.tld. But keep in mind that due to iFrame security constraints it will be only working on the same server, see HTML/JS same-origin policies." : "Sobreescribir el hostname del servidor de RC si no es el mismo que ownCloud, ej.: para (sub)dominios que residan en el mismo servidor (rc.dominio.tld). Tener en cuenta que sólo funcionará en el mismo servidor por las restricciones de seguridad del iFrame. Ver políticas de HTML/JS same-origin.", - "Overwrite RC server hostname" : "Sobreescribir el hostname del servidor de RC.", - "Overwrite roundcube server port (If not specified, ports 80/443 are used for HTTP/S)." : "Sobreescribir el puerto del servidor de RC. (Si no se especifica, se usan los puertos 80/443 para HTTP/S.", - "Overwrite RC server port" : "Sobreescribir el puerto del servidor de RC.", - "Internal RoundCube address (as seen by the OwnCloud server). Use this if the internal address, to which OwnCloud should connect when talking to RoundCube, does not match the host and port set above." : "Dirección interna del RC (como la ve el servidor ownCloud). Usar esto si la dirección interna, a la que el ownCloud se debería conectar cuando habla con RC, no concuerda con el host y puerto de arriba.", - "Internal RC address" : "Dirección interna del RC.", - "Saving..." : "Guardando...", - "Save" : "Guardar" + "Show RoundCube top information bar (shows logout button)." : "Mostrar barra de información de RoundCube arriba (muestra botón de logout).", + "Disable when debugging with self-signed certificates." : "Deshabilitar para depurar con certificados auto-firmados.", + "Enable SSL verification." : "Habilitar verificación SSL.", + "Save" : "Guardar", + "Saving..." : "Guardando..." },"pluralForm" :"" } \ No newline at end of file diff --git a/roundcube/l10n/es/roundcube.po b/roundcube/l10n/es/roundcube.po index bc2c22a..e93a6dd 100644 --- a/roundcube/l10n/es/roundcube.po +++ b/roundcube/l10n/es/roundcube.po @@ -2,133 +2,102 @@ msgid "Webmail" msgstr "Webmail" -#: lib/Controller/SettingsController.php:34 +#: lib/Controller/SettingsController.php:41 msgid "Not submitted for us." msgstr "No enviado para nosotros." -#: lib/Controller/SettingsController.php:49 -msgid "Maildir can't be an empty string." -msgstr "Maildir no puede estar vacía." +#: lib/Controller/SettingsController.php:55 +msgid "Default RC installation path can't be an empty string." +msgstr "La ruta por defecto de la instalación del RC no puede ser vacía." -#: lib/Controller/SettingsController.php:52 -msgid "Host is not valid." -msgstr "El host no es válido." +#: lib/Controller/SettingsController.php:57 +msgid "Default path must be a url relative to this server." +msgstr "La ruta por defecto debe ser una url relativa a este servidor." -#: lib/Controller/SettingsController.php:55 -msgid "Port must be a valid port number or left empty." -msgstr "El número de puerto debe ser válido o dejado vacío." +#: lib/Controller/SettingsController.php:63 +msgid "A domain is not valid." +msgstr "Uno de los dominios no es válido." -#: lib/Controller/SettingsController.php:59 -#, php-format -msgid "Internal address '%s' is not an URL" -msgstr "La dirección interna '%s' no es una URL." +#: lib/Controller/SettingsController.php:71 +msgid "A path is not valid." +msgstr "Una de las rutas no es válida." + +#: lib/Controller/SettingsController.php:76 +msgid "Paths must be urls relative to this server." +msgstr "Las rutas deben ser urls relativas a este servidor." -#: lib/Controller/SettingsController.php:65 +#: lib/Controller/SettingsController.php:83 +msgid "Unpaired domains and paths." +msgstr "El número de dominios y rutas no es parejo." + +#: lib/Controller/SettingsController.php:89 msgid "Some inputs are not valid." msgstr "Algunas entradas no son válidas." -#: lib/Controller/SettingsController.php:83 +#: lib/Controller/SettingsController.php:112 msgid "Application settings successfully stored." msgstr "Configuración de la aplicación guardada con éxito." -#: templates/part.error.admin.php:2 -msgid "Usuario 'admin' no hace Auto-Login." -msgstr "Usuario 'admin' no hace Auto-Login." - #: templates/part.error.login.php:2 msgid "Unable to login into roundcube. There are login errors." msgstr "No se puede hacer login en RoundCube. Hay errores de login." -#: templates/tpl.adminSettings.php:32 -msgid "Basic settings" -msgstr "Configuración básica" +#: templates/part.error.noemail.php:2 +#, php-format +msgid "Username '%s' is not an email address." +msgstr "El usuario '%s' no es un email válido." -#: templates/tpl.adminSettings.php:33 -msgid "" -"If you have \"http://example.com/roundcube\" enter \"/roundcube/\" here. " -"Note that subdomains or URLs do not work, just absolute paths to the same " -"domain ownCloud is running." -msgstr "Si se tiene \"http://example.com/roundcube\", ingresar \"/roundcube/\" " -"aquí. Notar que subdominios o URLs no funcionan, sólo rutas absolutas al " -"mismo dominio en el que está ejecutándose ownCloud." - -#: templates/tpl.adminSettings.php:33 -msgid "Absolute path to RC installation" -msgstr "Ruta absoluta a la instalación del RC." - -#: templates/tpl.adminSettings.php:38 -msgid "Advanced settings" -msgstr "Configuración avanzada" +#: templates/tpl.adminSettings.php:35 +msgid "Default RC installation path" +msgstr "Ruta por defecto al RC" #: templates/tpl.adminSettings.php:40 -msgid "Show RoundCube control navigation menu items with currently logged in " -"user information" -msgstr "Mostrar menú de control de navegación del RC con información del " -"usuario logueado." +#, php-format +msgid "Default path relative to ownCloud server (%s)." +msgstr "Ruta por defecto relativa al servidor ownCloud (%s)." #: templates/tpl.adminSettings.php:43 -msgid "Show information bar on top of page" -msgstr "Mostrar barra de información arriba de la página." - -#: templates/tpl.adminSettings.php:47 templates/tpl.adminSettings.php:50 -msgid "Enable SSL verification, e.g. disable for self-signed certificates" -msgstr "Habilitar verificación SSL (deshabilitar para certificados " -"auto-firmados)." +msgid "Per email domain RC installations" +msgstr "Rutas a RC por dominio de email" -#: templates/tpl.adminSettings.php:54 -msgid "Enable debug messages. RC tends to bloat the log-files." -msgstr "" -"Habilitar mensajes de depuración. RC tiende a llenar los archivos de log." +#: templates/tpl.adminSettings.php:44 +msgid "" +"Enter your users' email domains and their corresponding paths if you have " +"different RoundCube installations. For example: 'domain1.com':'roundcube1/', " +"'domain2.com':'roundcube2/'. Path relative to ownCloud server." +msgstr "Ingresar los dominios de los emails de sus usuarios y las " +"correspondientes rutas si tiene diferentes instalaciones de RoundCube. Por " +"ejemplo: 'domain1.com':'roundcube1/', 'domain2.com':'roundcube2/'. " +"Rutas relativas al servidor ownCloud." + +#: templates/tpl.adminSettings.php:51 templates/tpl.adminSettings.php:67 +msgid "Remove" +msgstr "Quitar" + +#: templates/tpl.adminSettings.php:78 +msgid "Add" +msgstr "Agregar" -#: templates/tpl.adminSettings.php:57 -msgid "Enable debug logging" -msgstr "Habilitar depuración." +#: templates/tpl.adminSettings.php:85 +msgid "Advanced settings" +msgstr "Configuración avanzada" -#: templates/tpl.adminSettings.php:61 -msgid "" -"Overwrite roundcube server hostname if not the same as owncloud, e.g. for " -"(sub)domains which resides on the same server, e.g rc.domain.tld. But keep " -"in mind that due to iFrame security constraints it will be only working on " -"the same server, see HTML/JS same-origin policies." -msgstr "" -"Sobreescribir el hostname del servidor de RC si no es el mismo que ownCloud, " -"ej.: para (sub)dominios que residan en el mismo servidor (rc.dominio.tld). " -"Tener en cuenta que sólo funcionará en el mismo servidor por las restricciones" -" de seguridad del iFrame. Ver políticas de HTML/JS same-origin." - -#: templates/tpl.adminSettings.php:62 -msgid "Overwrite RC server hostname" -msgstr "Sobreescribir el hostname del servidor de RC." - -#: templates/tpl.adminSettings.php:66 -msgid "" -"Overwrite roundcube server port (If not specified, ports 80/443 are used for " -"HTTP/S)." -msgstr "Sobreescribir el puerto del servidor de RC. (Si no se especifica, se " -"usan los puertos 80/443 para HTTP/S." +#: templates/tpl.adminSettings.php:89 +msgid "Show RoundCube top information bar (shows logout button)." +msgstr "Mostrar barra de información de RoundCube arriba (muestra botón de logout)." -#: templates/tpl.adminSettings.php:67 -msgid "Overwrite RC server port" -msgstr "Sobreescribir el puerto del servidor de RC." +#: templates/tpl.adminSettings.php:93 +msgid "Disable when debugging with self-signed certificates." +msgstr "Deshabilitar para depurar con certificados auto-firmados." -#: templates/tpl.adminSettings.php:72 -msgid "" -"Internal RoundCube address (as seen by the OwnCloud server). Use this if the " -"internal address, to which OwnCloud should connect when talking to " -"RoundCube, does not match the host and port set above." -msgstr "" -"Dirección interna del RC (como la ve el servidor ownCloud). Usar esto si la " -"dirección interna, a la que el ownCloud se debería conectar cuando habla con " -"RC, no concuerda con el host y puerto de arriba." - -#: templates/tpl.adminSettings.php:73 -msgid "Internal RC address" -msgstr "Dirección interna del RC." - -#: templates/tpl.adminSettings.php:81 -msgid "Saving..." -msgstr "Guardando..." +#: templates/tpl.adminSettings.php:96 +msgid "Enable SSL verification." +msgstr "Habilitar verificación SSL." -#: templates/tpl.adminSettings.php:85 +#: templates/tpl.adminSettings.php:100 msgid "Save" msgstr "Guardar" + +#: templates/tpl.adminSettings.php:101 +msgid "Saving..." +msgstr "Guardando..." diff --git a/roundcube/l10n/es_AR.js b/roundcube/l10n/es_AR.js index b064c02..f4f25f2 100644 --- a/roundcube/l10n/es_AR.js +++ b/roundcube/l10n/es_AR.js @@ -3,30 +3,27 @@ OC.L10N.register( { "Webmail" : "Webmail", "Not submitted for us." : "No enviado para nosotros.", - "Maildir can't be an empty string." : "Maildir no puede estar vacía.", - "Host is not valid." : "El host no es válido.", - "Port must be a valid port number or left empty." : "El número de puerto debe ser válido o dejado vacío.", - "Internal address '%s' is not an URL" : "La dirección interna '%s' no es una URL.", + "Default RC installation path can't be an empty string." : "La ruta por defecto de la instalación del RC no puede ser vacía.", + "Default path must be a url relative to this server." : "La ruta por defecto debe ser una url relativa a este servidor.", + "A domain is not valid." : "Uno de los dominios no es válido.", + "A path is not valid." : "Una de las rutas no es válida.", + "Paths must be urls relative to this server." : "Las rutas deben ser urls relativas a este servidor.", + "Unpaired domains and paths." : "El número de dominios y rutas no es parejo.", "Some inputs are not valid." : "Algunas entradas no son válidas.", "Application settings successfully stored." : "Configuración de la aplicación guardada con éxito.", - "Usuario 'admin' no hace Auto-Login." : "Usuario 'admin' no hace Auto-Login.", "Unable to login into roundcube. There are login errors." : "No se puede hacer login en RoundCube. Hay errores de login.", - "Basic settings" : "Configuración básica", - "If you have \"http://example.com/roundcube\" enter \"/roundcube/\" here. Note that subdomains or URLs do not work, just absolute paths to the same domain ownCloud is running." : "Si se tiene \"http://example.com/roundcube\", ingresar \"/roundcube/\" aquí. Notar que subdominios o URLs no funcionan, sólo rutas absolutas al mismo dominio en el que está ejecutándose ownCloud.", - "Absolute path to RC installation" : "Ruta absoluta a la instalación del RC.", + "Username '%s' is not an email address." : "El usuario '%s' no es un email válido.", + "Default RC installation path" : "Ruta por defecto al RC", + "Default path relative to ownCloud server (%s)." : "Ruta por defecto relativa al servidor ownCloud (%s).", + "Per email domain RC installations" : "Rutas a RC por dominio de email", + "Enter your users' email domains and their corresponding paths if you have different RoundCube installations. For example: 'domain1.com':'roundcube1/', 'domain2.com':'roundcube2/'. Path relative to ownCloud server." : "Ingresar los dominios de los emails de sus usuarios y las correspondientes rutas si tiene diferentes instalaciones de RoundCube. Por ejemplo: 'domain1.com':'roundcube1/', 'domain2.com':'roundcube2/'. Rutas relativas al servidor ownCloud.", + "Remove" : "Quitar", + "Add" : "Agregar", "Advanced settings" : "Configuración avanzada", - "Show RoundCube control navigation menu items with currently logged in user information" : "Mostrar menú de control de navegación del RC con información del usuario logueado.", - "Show information bar on top of page" : "Mostrar barra de información arriba de la página.", - "Enable SSL verification, e.g. disable for self-signed certificates" : "Habilitar verificación SSL (deshabilitar para certificados auto-firmados).", - "Enable debug messages. RC tends to bloat the log-files." : "Habilitar mensajes de depuración. RC tiende a llenar los archivos de log.", - "Enable debug logging" : "Habilitar depuración.", - "Overwrite roundcube server hostname if not the same as owncloud, e.g. for (sub)domains which resides on the same server, e.g rc.domain.tld. But keep in mind that due to iFrame security constraints it will be only working on the same server, see HTML/JS same-origin policies." : "Sobreescribir el hostname del servidor de RC si no es el mismo que ownCloud, ej.: para (sub)dominios que residan en el mismo servidor (rc.dominio.tld). Tener en cuenta que sólo funcionará en el mismo servidor por las restricciones de seguridad del iFrame. Ver políticas de HTML/JS same-origin.", - "Overwrite RC server hostname" : "Sobreescribir el hostname del servidor de RC.", - "Overwrite roundcube server port (If not specified, ports 80/443 are used for HTTP/S)." : "Sobreescribir el puerto del servidor de RC. (Si no se especifica, se usan los puertos 80/443 para HTTP/S.", - "Overwrite RC server port" : "Sobreescribir el puerto del servidor de RC.", - "Internal RoundCube address (as seen by the OwnCloud server). Use this if the internal address, to which OwnCloud should connect when talking to RoundCube, does not match the host and port set above." : "Dirección interna del RC (como la ve el servidor ownCloud). Usar esto si la dirección interna, a la que el ownCloud se debería conectar cuando habla con RC, no concuerda con el host y puerto de arriba.", - "Internal RC address" : "Dirección interna del RC.", - "Saving..." : "Guardando...", - "Save" : "Guardar" + "Show RoundCube top information bar (shows logout button)." : "Mostrar barra de información de RoundCube arriba (muestra botón de logout).", + "Disable when debugging with self-signed certificates." : "Deshabilitar para depurar con certificados auto-firmados.", + "Enable SSL verification." : "Habilitar verificación SSL.", + "Save" : "Guardar", + "Saving..." : "Guardando..." }, ""); diff --git a/roundcube/l10n/es_AR.json b/roundcube/l10n/es_AR.json index 54cb3a7..c1b64c9 100644 --- a/roundcube/l10n/es_AR.json +++ b/roundcube/l10n/es_AR.json @@ -1,30 +1,27 @@ { "translations": { "Webmail" : "Webmail", "Not submitted for us." : "No enviado para nosotros.", - "Maildir can't be an empty string." : "Maildir no puede estar vacía.", - "Host is not valid." : "El host no es válido.", - "Port must be a valid port number or left empty." : "El número de puerto debe ser válido o dejado vacío.", - "Internal address '%s' is not an URL" : "La dirección interna '%s' no es una URL.", + "Default RC installation path can't be an empty string." : "La ruta por defecto de la instalación del RC no puede ser vacía.", + "Default path must be a url relative to this server." : "La ruta por defecto debe ser una url relativa a este servidor.", + "A domain is not valid." : "Uno de los dominios no es válido.", + "A path is not valid." : "Una de las rutas no es válida.", + "Paths must be urls relative to this server." : "Las rutas deben ser urls relativas a este servidor.", + "Unpaired domains and paths." : "El número de dominios y rutas no es parejo.", "Some inputs are not valid." : "Algunas entradas no son válidas.", "Application settings successfully stored." : "Configuración de la aplicación guardada con éxito.", - "Usuario 'admin' no hace Auto-Login." : "Usuario 'admin' no hace Auto-Login.", "Unable to login into roundcube. There are login errors." : "No se puede hacer login en RoundCube. Hay errores de login.", - "Basic settings" : "Configuración básica", - "If you have \"http://example.com/roundcube\" enter \"/roundcube/\" here. Note that subdomains or URLs do not work, just absolute paths to the same domain ownCloud is running." : "Si se tiene \"http://example.com/roundcube\", ingresar \"/roundcube/\" aquí. Notar que subdominios o URLs no funcionan, sólo rutas absolutas al mismo dominio en el que está ejecutándose ownCloud.", - "Absolute path to RC installation" : "Ruta absoluta a la instalación del RC.", + "Username '%s' is not an email address." : "El usuario '%s' no es un email válido.", + "Default RC installation path" : "Ruta por defecto al RC", + "Default path relative to ownCloud server (%s)." : "Ruta por defecto relativa al servidor ownCloud (%s).", + "Per email domain RC installations" : "Rutas a RC por dominio de email", + "Enter your users' email domains and their corresponding paths if you have different RoundCube installations. For example: 'domain1.com':'roundcube1/', 'domain2.com':'roundcube2/'. Path relative to ownCloud server." : "Ingresar los dominios de los emails de sus usuarios y las correspondientes rutas si tiene diferentes instalaciones de RoundCube. Por ejemplo: 'domain1.com':'roundcube1/', 'domain2.com':'roundcube2/'. Rutas relativas al servidor ownCloud.", + "Remove" : "Quitar", + "Add" : "Agregar", "Advanced settings" : "Configuración avanzada", - "Show RoundCube control navigation menu items with currently logged in user information" : "Mostrar menú de control de navegación del RC con información del usuario logueado.", - "Show information bar on top of page" : "Mostrar barra de información arriba de la página.", - "Enable SSL verification, e.g. disable for self-signed certificates" : "Habilitar verificación SSL (deshabilitar para certificados auto-firmados).", - "Enable debug messages. RC tends to bloat the log-files." : "Habilitar mensajes de depuración. RC tiende a llenar los archivos de log.", - "Enable debug logging" : "Habilitar depuración.", - "Overwrite roundcube server hostname if not the same as owncloud, e.g. for (sub)domains which resides on the same server, e.g rc.domain.tld. But keep in mind that due to iFrame security constraints it will be only working on the same server, see HTML/JS same-origin policies." : "Sobreescribir el hostname del servidor de RC si no es el mismo que ownCloud, ej.: para (sub)dominios que residan en el mismo servidor (rc.dominio.tld). Tener en cuenta que sólo funcionará en el mismo servidor por las restricciones de seguridad del iFrame. Ver políticas de HTML/JS same-origin.", - "Overwrite RC server hostname" : "Sobreescribir el hostname del servidor de RC.", - "Overwrite roundcube server port (If not specified, ports 80/443 are used for HTTP/S)." : "Sobreescribir el puerto del servidor de RC. (Si no se especifica, se usan los puertos 80/443 para HTTP/S.", - "Overwrite RC server port" : "Sobreescribir el puerto del servidor de RC.", - "Internal RoundCube address (as seen by the OwnCloud server). Use this if the internal address, to which OwnCloud should connect when talking to RoundCube, does not match the host and port set above." : "Dirección interna del RC (como la ve el servidor ownCloud). Usar esto si la dirección interna, a la que el ownCloud se debería conectar cuando habla con RC, no concuerda con el host y puerto de arriba.", - "Internal RC address" : "Dirección interna del RC.", - "Saving..." : "Guardando...", - "Save" : "Guardar" + "Show RoundCube top information bar (shows logout button)." : "Mostrar barra de información de RoundCube arriba (muestra botón de logout).", + "Disable when debugging with self-signed certificates." : "Deshabilitar para depurar con certificados auto-firmados.", + "Enable SSL verification." : "Habilitar verificación SSL.", + "Save" : "Guardar", + "Saving..." : "Guardando..." },"pluralForm" :"" } \ No newline at end of file diff --git a/roundcube/l10n/es_AR/roundcube.po b/roundcube/l10n/es_AR/roundcube.po index bc2c22a..e93a6dd 100644 --- a/roundcube/l10n/es_AR/roundcube.po +++ b/roundcube/l10n/es_AR/roundcube.po @@ -2,133 +2,102 @@ msgid "Webmail" msgstr "Webmail" -#: lib/Controller/SettingsController.php:34 +#: lib/Controller/SettingsController.php:41 msgid "Not submitted for us." msgstr "No enviado para nosotros." -#: lib/Controller/SettingsController.php:49 -msgid "Maildir can't be an empty string." -msgstr "Maildir no puede estar vacía." +#: lib/Controller/SettingsController.php:55 +msgid "Default RC installation path can't be an empty string." +msgstr "La ruta por defecto de la instalación del RC no puede ser vacía." -#: lib/Controller/SettingsController.php:52 -msgid "Host is not valid." -msgstr "El host no es válido." +#: lib/Controller/SettingsController.php:57 +msgid "Default path must be a url relative to this server." +msgstr "La ruta por defecto debe ser una url relativa a este servidor." -#: lib/Controller/SettingsController.php:55 -msgid "Port must be a valid port number or left empty." -msgstr "El número de puerto debe ser válido o dejado vacío." +#: lib/Controller/SettingsController.php:63 +msgid "A domain is not valid." +msgstr "Uno de los dominios no es válido." -#: lib/Controller/SettingsController.php:59 -#, php-format -msgid "Internal address '%s' is not an URL" -msgstr "La dirección interna '%s' no es una URL." +#: lib/Controller/SettingsController.php:71 +msgid "A path is not valid." +msgstr "Una de las rutas no es válida." + +#: lib/Controller/SettingsController.php:76 +msgid "Paths must be urls relative to this server." +msgstr "Las rutas deben ser urls relativas a este servidor." -#: lib/Controller/SettingsController.php:65 +#: lib/Controller/SettingsController.php:83 +msgid "Unpaired domains and paths." +msgstr "El número de dominios y rutas no es parejo." + +#: lib/Controller/SettingsController.php:89 msgid "Some inputs are not valid." msgstr "Algunas entradas no son válidas." -#: lib/Controller/SettingsController.php:83 +#: lib/Controller/SettingsController.php:112 msgid "Application settings successfully stored." msgstr "Configuración de la aplicación guardada con éxito." -#: templates/part.error.admin.php:2 -msgid "Usuario 'admin' no hace Auto-Login." -msgstr "Usuario 'admin' no hace Auto-Login." - #: templates/part.error.login.php:2 msgid "Unable to login into roundcube. There are login errors." msgstr "No se puede hacer login en RoundCube. Hay errores de login." -#: templates/tpl.adminSettings.php:32 -msgid "Basic settings" -msgstr "Configuración básica" +#: templates/part.error.noemail.php:2 +#, php-format +msgid "Username '%s' is not an email address." +msgstr "El usuario '%s' no es un email válido." -#: templates/tpl.adminSettings.php:33 -msgid "" -"If you have \"http://example.com/roundcube\" enter \"/roundcube/\" here. " -"Note that subdomains or URLs do not work, just absolute paths to the same " -"domain ownCloud is running." -msgstr "Si se tiene \"http://example.com/roundcube\", ingresar \"/roundcube/\" " -"aquí. Notar que subdominios o URLs no funcionan, sólo rutas absolutas al " -"mismo dominio en el que está ejecutándose ownCloud." - -#: templates/tpl.adminSettings.php:33 -msgid "Absolute path to RC installation" -msgstr "Ruta absoluta a la instalación del RC." - -#: templates/tpl.adminSettings.php:38 -msgid "Advanced settings" -msgstr "Configuración avanzada" +#: templates/tpl.adminSettings.php:35 +msgid "Default RC installation path" +msgstr "Ruta por defecto al RC" #: templates/tpl.adminSettings.php:40 -msgid "Show RoundCube control navigation menu items with currently logged in " -"user information" -msgstr "Mostrar menú de control de navegación del RC con información del " -"usuario logueado." +#, php-format +msgid "Default path relative to ownCloud server (%s)." +msgstr "Ruta por defecto relativa al servidor ownCloud (%s)." #: templates/tpl.adminSettings.php:43 -msgid "Show information bar on top of page" -msgstr "Mostrar barra de información arriba de la página." - -#: templates/tpl.adminSettings.php:47 templates/tpl.adminSettings.php:50 -msgid "Enable SSL verification, e.g. disable for self-signed certificates" -msgstr "Habilitar verificación SSL (deshabilitar para certificados " -"auto-firmados)." +msgid "Per email domain RC installations" +msgstr "Rutas a RC por dominio de email" -#: templates/tpl.adminSettings.php:54 -msgid "Enable debug messages. RC tends to bloat the log-files." -msgstr "" -"Habilitar mensajes de depuración. RC tiende a llenar los archivos de log." +#: templates/tpl.adminSettings.php:44 +msgid "" +"Enter your users' email domains and their corresponding paths if you have " +"different RoundCube installations. For example: 'domain1.com':'roundcube1/', " +"'domain2.com':'roundcube2/'. Path relative to ownCloud server." +msgstr "Ingresar los dominios de los emails de sus usuarios y las " +"correspondientes rutas si tiene diferentes instalaciones de RoundCube. Por " +"ejemplo: 'domain1.com':'roundcube1/', 'domain2.com':'roundcube2/'. " +"Rutas relativas al servidor ownCloud." + +#: templates/tpl.adminSettings.php:51 templates/tpl.adminSettings.php:67 +msgid "Remove" +msgstr "Quitar" + +#: templates/tpl.adminSettings.php:78 +msgid "Add" +msgstr "Agregar" -#: templates/tpl.adminSettings.php:57 -msgid "Enable debug logging" -msgstr "Habilitar depuración." +#: templates/tpl.adminSettings.php:85 +msgid "Advanced settings" +msgstr "Configuración avanzada" -#: templates/tpl.adminSettings.php:61 -msgid "" -"Overwrite roundcube server hostname if not the same as owncloud, e.g. for " -"(sub)domains which resides on the same server, e.g rc.domain.tld. But keep " -"in mind that due to iFrame security constraints it will be only working on " -"the same server, see HTML/JS same-origin policies." -msgstr "" -"Sobreescribir el hostname del servidor de RC si no es el mismo que ownCloud, " -"ej.: para (sub)dominios que residan en el mismo servidor (rc.dominio.tld). " -"Tener en cuenta que sólo funcionará en el mismo servidor por las restricciones" -" de seguridad del iFrame. Ver políticas de HTML/JS same-origin." - -#: templates/tpl.adminSettings.php:62 -msgid "Overwrite RC server hostname" -msgstr "Sobreescribir el hostname del servidor de RC." - -#: templates/tpl.adminSettings.php:66 -msgid "" -"Overwrite roundcube server port (If not specified, ports 80/443 are used for " -"HTTP/S)." -msgstr "Sobreescribir el puerto del servidor de RC. (Si no se especifica, se " -"usan los puertos 80/443 para HTTP/S." +#: templates/tpl.adminSettings.php:89 +msgid "Show RoundCube top information bar (shows logout button)." +msgstr "Mostrar barra de información de RoundCube arriba (muestra botón de logout)." -#: templates/tpl.adminSettings.php:67 -msgid "Overwrite RC server port" -msgstr "Sobreescribir el puerto del servidor de RC." +#: templates/tpl.adminSettings.php:93 +msgid "Disable when debugging with self-signed certificates." +msgstr "Deshabilitar para depurar con certificados auto-firmados." -#: templates/tpl.adminSettings.php:72 -msgid "" -"Internal RoundCube address (as seen by the OwnCloud server). Use this if the " -"internal address, to which OwnCloud should connect when talking to " -"RoundCube, does not match the host and port set above." -msgstr "" -"Dirección interna del RC (como la ve el servidor ownCloud). Usar esto si la " -"dirección interna, a la que el ownCloud se debería conectar cuando habla con " -"RC, no concuerda con el host y puerto de arriba." - -#: templates/tpl.adminSettings.php:73 -msgid "Internal RC address" -msgstr "Dirección interna del RC." - -#: templates/tpl.adminSettings.php:81 -msgid "Saving..." -msgstr "Guardando..." +#: templates/tpl.adminSettings.php:96 +msgid "Enable SSL verification." +msgstr "Habilitar verificación SSL." -#: templates/tpl.adminSettings.php:85 +#: templates/tpl.adminSettings.php:100 msgid "Save" msgstr "Guardar" + +#: templates/tpl.adminSettings.php:101 +msgid "Saving..." +msgstr "Guardando..." diff --git a/roundcube/l10n/templates/roundcube.pot b/roundcube/l10n/templates/roundcube.pot index 922aa75..f7eccd1 100644 --- a/roundcube/l10n/templates/roundcube.pot +++ b/roundcube/l10n/templates/roundcube.pot @@ -6,13 +6,13 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: ownCloud roundcube 10.0.0\n" +"Project-Id-Version: ownCloud roundcube 10.0.1\n" "Report-Msgid-Bugs-To: translations@owncloud.org\n" -"POT-Creation-Date: 2019-03-26 11:41-0300\n" +"POT-Creation-Date: 2019-03-29 09:29-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"Last-Translator: Leonardo R. Morelli \n" "Language-Team: LANGUAGE \n" -"Language: \n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" @@ -21,121 +21,99 @@ msgstr "" msgid "Webmail" msgstr "" -#: lib/Controller/SettingsController.php:34 +#: lib/Controller/SettingsController.php:41 msgid "Not submitted for us." msgstr "" -#: lib/Controller/SettingsController.php:49 -msgid "Maildir can't be an empty string." +#: lib/Controller/SettingsController.php:55 +msgid "Default RC installation path can't be an empty string." msgstr "" -#: lib/Controller/SettingsController.php:52 -msgid "Host is not valid." +#: lib/Controller/SettingsController.php:57 +msgid "Default path must be a url relative to this server." msgstr "" -#: lib/Controller/SettingsController.php:55 -msgid "Port must be a valid port number or left empty." +#: lib/Controller/SettingsController.php:63 +msgid "A domain is not valid." msgstr "" -#: lib/Controller/SettingsController.php:59 -#, php-format -msgid "Internal address '%s' is not an URL" +#: lib/Controller/SettingsController.php:71 +msgid "A path is not valid." msgstr "" -#: lib/Controller/SettingsController.php:65 -msgid "Some inputs are not valid." +#: lib/Controller/SettingsController.php:76 +msgid "Paths must be urls relative to this server." msgstr "" #: lib/Controller/SettingsController.php:83 -msgid "Application settings successfully stored." -msgstr "" - -#: templates/part.error.admin.php:2 -msgid "Usuario 'admin' no hace Auto-Login." +msgid "Unpaired domains and paths." msgstr "" -#: templates/part.error.login.php:2 -msgid "Unable to login into roundcube. There are login errors." +#: lib/Controller/SettingsController.php:89 +msgid "Some inputs are not valid." msgstr "" -#: templates/tpl.adminSettings.php:32 -msgid "Basic settings" +#: lib/Controller/SettingsController.php:112 +msgid "Application settings successfully stored." msgstr "" -#: templates/tpl.adminSettings.php:33 -msgid "" -"If you have \"http://example.com/roundcube\" enter \"/roundcube/\" here. " -"Note that subdomains or URLs do not work, just absolute paths to the same " -"domain ownCloud is running." +#: templates/part.error.login.php:2 +msgid "Unable to login into roundcube. There are login errors." msgstr "" -#: templates/tpl.adminSettings.php:33 -msgid "Absolute path to RC installation" +#: templates/part.error.noemail.php:2 +#, php-format +msgid "Username '%s' is not an email address." msgstr "" -#: templates/tpl.adminSettings.php:38 -msgid "Advanced settings" +#: templates/tpl.adminSettings.php:35 +msgid "Default RC installation path" msgstr "" #: templates/tpl.adminSettings.php:40 -msgid "" -"Show RoundCube control navigation menu items with currently logged in user " -"information" +#, php-format +msgid "Default path relative to ownCloud server (%s)." msgstr "" #: templates/tpl.adminSettings.php:43 -msgid "Show information bar on top of page" +msgid "Per email domain RC installations" msgstr "" -#: templates/tpl.adminSettings.php:47 templates/tpl.adminSettings.php:50 -msgid "Enable SSL verification, e.g. disable for self-signed certificates" +#: templates/tpl.adminSettings.php:44 +msgid "" +"Enter your users' email domains and their corresponding paths if you have " +"different RoundCube installations. For example: 'domain1.com':'roundcube1/', " +"'domain2.com':'roundcube2/'. Path relative to ownCloud server." msgstr "" -#: templates/tpl.adminSettings.php:54 -msgid "Enable debug messages. RC tends to bloat the log-files." +#: templates/tpl.adminSettings.php:51 templates/tpl.adminSettings.php:67 +msgid "Remove" msgstr "" -#: templates/tpl.adminSettings.php:57 -msgid "Enable debug logging" +#: templates/tpl.adminSettings.php:78 +msgid "Add" msgstr "" -#: templates/tpl.adminSettings.php:61 -msgid "" -"Overwrite roundcube server hostname if not the same as owncloud, e.g. for " -"(sub)domains which resides on the same server, e.g rc.domain.tld. But keep " -"in mind that due to iFrame security constraints it will be only working on " -"the same server, see HTML/JS same-origin policies." +#: templates/tpl.adminSettings.php:85 +msgid "Advanced settings" msgstr "" -#: templates/tpl.adminSettings.php:62 -msgid "Overwrite RC server hostname" +#: templates/tpl.adminSettings.php:89 +msgid "Show RoundCube top information bar (shows logout button)." msgstr "" -#: templates/tpl.adminSettings.php:66 -msgid "" -"Overwrite roundcube server port (If not specified, ports 80/443 are used for " -"HTTP/S)." +#: templates/tpl.adminSettings.php:93 +msgid "Disable when debugging with self-signed certificates." msgstr "" -#: templates/tpl.adminSettings.php:67 -msgid "Overwrite RC server port" +#: templates/tpl.adminSettings.php:96 +msgid "Enable SSL verification." msgstr "" -#: templates/tpl.adminSettings.php:72 -msgid "" -"Internal RoundCube address (as seen by the OwnCloud server). Use this if the " -"internal address, to which OwnCloud should connect when talking to " -"RoundCube, does not match the host and port set above." -msgstr "" - -#: templates/tpl.adminSettings.php:73 -msgid "Internal RC address" +#: templates/tpl.adminSettings.php:100 +msgid "Save" msgstr "" -#: templates/tpl.adminSettings.php:81 +#: templates/tpl.adminSettings.php:101 msgid "Saving..." msgstr "" - -#: templates/tpl.adminSettings.php:85 -msgid "Save" -msgstr "" diff --git a/roundcube/lib/AuthHelper.php b/roundcube/lib/AuthHelper.php index 4f2abcc..aa1cf2d 100644 --- a/roundcube/lib/AuthHelper.php +++ b/roundcube/lib/AuthHelper.php @@ -1,6 +1,6 @@ getRequest()->getRequestUri(); if (preg_match( - '#(/ocs/v1.php|'. - '/apps/calendar/caldav.php|'. - '/apps/contacts/carddav.php|'. - '/remote.php/webdav)/#', $via) + '#(/ocs/v\d.php|'. + '/apps/calendar/caldav.php|'. + '/apps/contacts/carddav.php|'. + '/remote.php/webdav)/#', $via) ) { return false; } @@ -63,8 +63,16 @@ public static function postLogin($params) { $plainText = $params['password']; $b64crypted = Crypto::publicEncrypt($plainText, $pair['publicKey']); \OC::$server->getSession()->set(self::SESSION_RC_PRIVKEY, $pair['privateKey']); - setcookie(self::COOKIE_RC_TOKEN, $passphrase, 0, "", "", true, true); - setcookie(self::COOKIE_RC_STRING, $b64crypted, 0, "", "", true, true); + setcookie(self::COOKIE_RC_TOKEN, $passphrase, 0, "/", "", true, true); + setcookie(self::COOKIE_RC_STRING, $b64crypted, 0, "/", "", true, true); + + $app = new \OCP\AppFramework\App('roundcube'); + $rcIA = $app->getContainer()->query('OCA\RoundCube\InternalAddress'); + $rcAddress = $rcIA->getAddress(); + $rcServer = $rcIA->getServer(); + \OC::$server->getSession()->set(AuthHelper::SESSION_RC_ADDRESS, $rcAddress); + \OC::$server->getSession()->set(AuthHelper::SESSION_RC_SERVER, $rcServer); + return true; } @@ -89,15 +97,14 @@ public static function login() { public static function logout() { \OCP\App::checkAppEnabled('roundcube'); $user = \OC::$server->getUserSession()->getUser()->getUID(); - if ($user === 'admin') { - // admin no hace login/logout - Util::writeLog('roundcube', __METHOD__ . ": 'admin' no hace login/logout", Util::INFO); - return true; + if (strpos($user, '@') === false) { + Util::writeLog('roundcube', __METHOD__ . ": username ($user) is not an email address.", Util::WARN); + return false; } \OC::$server->getSession()->remove(self::SESSION_RC_PRIVKEY); // Expires cookies. - setcookie(self::COOKIE_RC_TOKEN, "-del-", 1, "", "", true, true); - setcookie(self::COOKIE_RC_STRING, "-del-", 1, "", "", true, true); + setcookie(self::COOKIE_RC_TOKEN, "-del-", 1, "/", "", true, true); + setcookie(self::COOKIE_RC_STRING, "-del-", 1, "/", "", true, true); setcookie(self::COOKIE_RC_SESSID, "-del-", 1, "/", "", true, true); setcookie(self::COOKIE_RC_SESSAUTH, "-del-", 1, "/", "", true, true); Util::writeLog('roundcube', __METHOD__ . ": Logout of user '$user' from RoundCube done.", Util::INFO); diff --git a/roundcube/lib/BackLogin.php b/roundcube/lib/BackLogin.php index f57daf5..e45f84b 100644 --- a/roundcube/lib/BackLogin.php +++ b/roundcube/lib/BackLogin.php @@ -1,6 +1,6 @@ username = $username; - $this->password = $password; - $this->config = \OC::$server->getConfig(); - $this->rcHost = $this->config->getAppValue('roundcube', 'rcHost', ''); - if ($this->rcHost === '') { - $this->rcHost = \OC::$server->getRequest()->getServerHost(); - } - $this->rcPort = $this->config->getAppValue('roundcube', 'rcPort', 0); - $this->hasSSLVerify = $this->config->getAppValue('roundcube', 'sslVerify', true); - $this->rcInternalAddress = $this->makeUrl(); - $this->ocServer = preg_replace("(^https?://|/.*)", "", \OC::$server->getURLGenerator()->getAbsoluteURL("/")); + $this->username = $username; + $this->password = $password; + $this->config = \OC::$server->getConfig(); + $this->enableSSLVerify = $this->config->getAppValue('roundcube', 'enableSSLVerify', true); + $this->rcServer = \OC::$server->getSession()->get(AuthHelper::SESSION_RC_SERVER, ''); + $this->rcInternalAddress = \OC::$server->getSession()->get(AuthHelper::SESSION_RC_ADDRESS, ''); } /** @@ -76,6 +69,10 @@ public function login() { setcookie(AuthHelper::COOKIE_RC_SESSAUTH, "-del-", 1, "/", "", true, true); // Get login page, extracts sessionID and token. $loginPageObj = $this->sendRequest("?_task=login", "GET"); + if ($loginPageObj === false) { + Util::writeLog('roundcube', __METHOD__ . ": Could not get login page.", Util::ERROR); + return false; + } $cookies = self::parseCookies($loginPageObj['headers']['set-cookie']); if (isset($cookies[AuthHelper::COOKIE_RC_SESSID])) { $this->rcSessionID = $cookies[AuthHelper::COOKIE_RC_SESSID]; @@ -93,6 +90,10 @@ public function login() { ); // Post login form. $loginAnswerObj = $this->sendRequest("?_task=login&_action=login", "POST", $data); + if ($loginAnswerObj === false) { + Util::writeLog('roundcube', __METHOD__ . ": Could not get login response.", Util::ERROR); + return false; + } // Set cookies sessauth and sessid. $cookiesLogin = self::parseCookies($loginAnswerObj['headers']['set-cookie']); if (isset($cookiesLogin[AuthHelper::COOKIE_RC_SESSID]) && @@ -107,7 +108,6 @@ public function login() { $this->rcSessionAuth = $cookiesLogin[AuthHelper::COOKIE_RC_SESSAUTH]; setcookie(AuthHelper::COOKIE_RC_SESSAUTH, $this->rcSessionAuth, 0, "/", "", true, true); - \OC::$server->getSession()->set(AuthHelper::SESSION_RC_ADDRESS, $this->rcInternalAddress); return true; } // Check again whether input fields of login form exist. @@ -120,30 +120,6 @@ public function login() { } } - /** - * Generate RoundCube server address on-the-fly based on public address - * @return string https?://server/maildir/ - */ - private function makeUrl() { - $rcInternalAddress = $this->config->getAppValue('roundcube', 'rcInternalAddress', ''); - if ($rcInternalAddress === "") { - $url = ""; - if ((isset($_SERVER['HTTPS']) && $_SERVER["HTTPS"] || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')) { - $url = "https://"; - } else { - $url = "http://"; - } - $url .= $this->rcHost; - if (is_numeric($this->rcPort) && $this->rcPort > 0 && $this->rcPort < 65536) { - $url .= ":{$this->rcPort}"; - } - $maildir = trim(CCTMaildir::getCCTMaildir($this->username), ' /'); - return "$url/$maildir/"; - } else { - return $rcInternalAddress; - } - } - /** * @param string $text The text where to look for input fields. * @return array [name => [key, value]] Input fields indexed by name. @@ -174,19 +150,21 @@ private static function parseInputs($text) { /** * Send request using cURL. * - * @param string $rcUrl To append to rcInternalAddress (no slash at begin). + * @param string $rcQuery Query string to append to rcInternalAddress + * (Example: "?_task=login"). * @param string $method POST or GET request. * @param string $data Data to send. * @return array ['headers' => [headers], 'html' => html] */ - private function sendRequest($rcUrl, $method, $data = null) { + private function sendRequest($rcQuery, $method, $data = null) { $response = false; - $rcUrl = $this->rcInternalAddress . "$rcUrl"; + $rcQuery = $this->rcInternalAddress . "$rcQuery"; + Util::writeLog('roundcube', __METHOD__ . ": URL: '$rcQuery'.", Util::DEBUG); try { $curl = curl_init(); // general settings $curlOpts = array( - CURLOPT_URL => $rcUrl, + CURLOPT_URL => $rcQuery, CURLOPT_HEADER => true, CURLOPT_FOLLOWLOCATION => false, CURLOPT_RETURNTRANSFER => true, @@ -218,7 +196,7 @@ private function sendRequest($rcUrl, $method, $data = null) { $cookies .= AuthHelper::COOKIE_RC_SESSAUTH . "={$this->rcSessionAuth}; "; } $curlOpts[CURLOPT_COOKIE] = rtrim($cookies, "; "); - if (!$this->hasSSLVerify) { + if (!$this->enableSSLVerify) { Util::writeLog('roundcube', __METHOD__ . ": Disabling SSL verification.", Util::WARN); $curlOpts[CURLOPT_SSL_VERIFYPEER] = false; $curlOpts[CURLOPT_SSL_VERIFYHOST] = 0; @@ -232,15 +210,15 @@ private function sendRequest($rcUrl, $method, $data = null) { $curlError = curl_error($curl); $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); $respHttpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); - Util::writeLog('roundcube', __METHOD__ . ": Got the following HTTP Status Code: ($respHttpCode) $curlError", Util::DEBUG); - if ($curlErrorNum === CURLE_OK) { + Util::writeLog('roundcube', __METHOD__ . ": Got the following HTTP Status Code: ($respHttpCode) $curlErrorNum: $curlError", Util::DEBUG); + if ($curlErrorNum === CURLE_OK && $respHttpCode < 400) { $response = self::splitResponse($rawResponse, $headerSize); } else { - Util::writeLog('roundcube', __METHOD__ . ": Opening url '$rcUrl' failed with '$curlError'", Util::WARN); + Util::writeLog('roundcube', __METHOD__ . ": Opening url '$rcQuery' failed with '$curlError'", Util::WARN); } curl_close($curl); } catch (Exception $e) { - Util::writeLog('roundcube', __METHOD__ . ": URL '$rcUrl' open failed.", Util::WARN); + Util::writeLog('roundcube', __METHOD__ . ": URL '$rcQuery' open failed.", Util::WARN); } return $response; } @@ -317,7 +295,6 @@ private static function parseCookies($cookieHeaders) { if ($match[1] !== "" && $match[2] !== "" && strlen($match[2]) > 5) { $cookies[$match[1]] = $match[2]; } - // Util::writeLog('roundcube', __METHOD__ . ": found cookie: {$match[1]}={$match[2]}.", Util::DEBUG); } } } diff --git a/roundcube/lib/CCTMaildir.php b/roundcube/lib/CCTMaildir.php deleted file mode 100644 index f736035..0000000 --- a/roundcube/lib/CCTMaildir.php +++ /dev/null @@ -1,79 +0,0 @@ -. - * - */ -namespace OCA\RoundCube; -/** - * - * USAGE - * The class provides one public method: - * - * - getCCTMaildir($domain) - * Devuelve el correcto maildir según el dominio del usuario. - * - */ -class CCTMaildir -{ - private static function getCCTMaildirOfDomain($domain) { - $mailDomains = array( - 'rosario-conicet.gov.ar', - 'ifir-conicet.gov.ar', - 'cifasis-conicet.gov.ar', - 'roscytec.org.ar', - 'iidefar-conicet.gob.ar', - 'ishir-conicet.gov.ar', - 'irice-conicet.gov.ar', - 'inv.rosario-conicet.gov.ar', - 'iech-conicet.gob.ar', - 'bec.rosario-conicet.gov.ar'); - - $mailbioqDomains = array( - 'ibr-conicet.gov.ar', - 'cefobi-conicet.gov.ar', - 'iquir-conicet.gov.ar', - 'idicer-conicet.gob.ar', - 'ifise-conicet.gov.ar', - 'iprobyq-conicet.gob.ar', - 'iicar-conicet.gob.ar'); - - // Si el dominio del usuario está en servidor mail - if (in_array($domain, $mailDomains)) { - return '/roundcube1/'; - } - // Si el dominio del usuario está en servidor mailbioq - if (in_array($domain, $mailbioqDomains)) { - return '/roundcube2/'; - } - \OCP\Util::writeLog('roundcube', 'CCTMaildir.php: Dominio desconocido: ' . $domain, \OCP\Util::DEBUG); - return \OC::$server->getConfig()->getAppValue('roundcube', 'maildir', ''); - } - - public static function getCCTMaildir($username = null) { - $user = $username; - if ($username === null) { - $user = \OC::$server->getUserSession()->getUser()->getUID(); - } - $user_domain = explode('@', $user); - if (count($user_domain) === 2) { - $dominio = $user_domain[1]; - return self::getCCTMaildirOfDomain($dominio); - } else { - return \OC::$server->getConfig()->getAppValue('roundcube', 'maildir', ''); - } - } -} diff --git a/roundcube/lib/Controller/PageController.php b/roundcube/lib/Controller/PageController.php index 83a393b..caf3660 100644 --- a/roundcube/lib/Controller/PageController.php +++ b/roundcube/lib/Controller/PageController.php @@ -1,6 +1,6 @@ getL10N($this->appName); \OC::$server->getNavigationManager()->setActiveEntry($this->appName); $user = \OC::$server->getUserSession()->getUser()->getUID(); - if ($user === 'admin') { - Util::writeLog($this->appName, __METHOD__ . ": 'admin' no hace login/logout.", Util::INFO); - return new TemplateResponse($this->appName, "part.error.admin", array()); + if (strpos($user, '@') === false) { + Util::writeLog($this->appName, __METHOD__ . ": username ($user) is not an email address.", Util::WARN); + return new TemplateResponse($this->appName, "part.error.noemail", array('user' => $user)); } if (!AuthHelper::login()) { return new TemplateResponse($this->appName, "part.error.login", array()); } $url = \OC::$server->getSession()->get(AuthHelper::SESSION_RC_ADDRESS); $tplParams = array( - 'appName' => $this->appName, - 'url' => $url, - 'loading' => \OC::$server->getURLGenerator()->imagePath($this->appName, 'loader.gif') + 'appName' => $this->appName, + 'url' => $url, + 'loading' => \OC::$server->getURLGenerator()->imagePath($this->appName, 'loader.gif'), + 'showTopLine' => \OC::$server->getConfig()->getAppValue('roundcube', 'showTopLine', false) ); $tpl = new TemplateResponse($this->appName, "tpl.mail", $tplParams); - // This is mandatory to embed a different subdomain in an iframe. - $csp = new ContentSecurityPolicy(); - $csp->addAllowedFrameDomain('*.rosario-conicet.gov.ar'); - $tpl->setContentSecurityPolicy($csp); - + // This is mandatory to embed a different server in an iframe. + $rcServer = \OC::$server->getSession()->get(AuthHelper::SESSION_RC_SERVER, ''); + if ($rcServer !== '') { + $csp = new ContentSecurityPolicy(); + $csp->addAllowedFrameDomain($rcServer); + // $csp->addAllowedScriptDomain($rcServer); + $csp->allowInlineScript(true)->allowEvalScript(true); + // Util::writeLog($this->appName, __METHOD__ . ": Added CSP frame: $rcServer", Util::DEBUG); + $tpl->setContentSecurityPolicy($csp); + } return $tpl; } } diff --git a/roundcube/lib/Controller/SettingsController.php b/roundcube/lib/Controller/SettingsController.php index c827b0a..b12683e 100644 --- a/roundcube/lib/Controller/SettingsController.php +++ b/roundcube/lib/Controller/SettingsController.php @@ -1,4 +1,23 @@ . + * + */ namespace OCA\RoundCube\Controller; use OCP\AppFramework\Http\JSONResponse; @@ -13,17 +32,24 @@ public function __construct($AppName, \OCP\IRequest $request) { public function adminSettings() { $config = \OC::$server->getConfig(); $tplParams = array( - 'maildir' => $config->getAppValue($this->appName, 'maildir', ''), + 'ocServer' => \OC::$server->getURLGenerator()->getAbsoluteURL("/"), + 'defaultRCPath' => $config->getAppValue($this->appName, 'defaultRCPath', ''), + 'domainPath' => json_decode($config->getAppValue($this->appName, 'domainPath', ''), true), 'showTopLine' => $config->getAppValue($this->appName, 'showTopLine', false), - 'enableSSLVerify' => $config->getAppValue($this->appName, 'enableSSLVerify', true), - 'enableDebug' => $config->getAppValue($this->appName, 'enableDebug', false), - 'rcHost' => $config->getAppValue($this->appName, 'rcHost', ''), - 'rcPort' => $config->getAppValue($this->appName, 'rcPort', ''), - 'rcInternalAddress' => $config->getAppValue($this->appName, 'rcInternalAddress', '') + 'enableSSLVerify' => $config->getAppValue($this->appName, 'enableSSLVerify', true) ); return new TemplateResponse($this->appName, 'tpl.adminSettings', $tplParams, 'blank'); } + /** + * Validates and stores RC admin settings. + * @return JSONResponse array( + * "status" => ..., + * "message" => ..., + * ["invalid" => array($msg1, $msg2, ...),] + * ["config" => array("key" => "value", ...)] + * ) + */ public function setAdminSettings() { $l = \OC::$server->getL10N('roundcube'); $req = \OC::$server->getRequest(); @@ -36,29 +62,46 @@ public function setAdminSettings() { } $config = \OC::$server->getConfig(); - $maildir = $req->getParam('maildir', ''); - $showTopLine = $req->getParam('showTopLine', null); - $enableSSLVerify = $req->getParam('enableSSLVerify', null); - $enableDebug = $req->getParam('enableDebug', null); - $rcHost = $req->getParam('rcHost', ''); - $rcPort = $req->getParam('rcPort', ''); - $rcInternalAddress = $req->getParam('rcInternalAddress', ''); + $defaultRCPath = $req->getParam('defaultRCPath', ''); + $rcDomains = $req->getParam('rcDomain', ''); + $rcPaths = $req->getParam('rcPath', ''); + $showTopLine = $req->getParam('showTopLine', null); + $enableSSLVerify = $req->getParam('enableSSLVerify', null); + // Validate and do a first fix of some values. $validation = array(); - if (!is_string($maildir) || $maildir === '') { - $validation[] = $l->t("Maildir can't be an empty string."); + if (!is_string($defaultRCPath) || $defaultRCPath === '') { + $validation[] = $l->t("Default RC installation path can't be an empty string."); + } elseif (preg_match('/^([a-zA-Z]+:)?\/\//', $path) === 1) { + $validation[] = $l->t("Default path must be a url relative to this server."); + } else { + $defaultRCPath = trim($defaultRCPath); } - if (!is_string($rcHost) || ($rcHost !== '' && strlen($rcHost) < 4)) { - $validation[] = $l->t("Host is not valid."); + foreach ($rcDomains as &$dom) { + if (!is_string($dom) || preg_match('/(@|\/)/', $dom) === 1) { + $validation[] = $l->t("A domain is not valid."); + break; + } else { + $dom = trim($dom); + } } - if (! ((is_numeric($rcPort) && $rcPort > 0 && $rcPort < 65536) || $rcPort === '')) { - $validation[] = $l->t("Port must be a valid port number or left empty."); + foreach ($rcPaths as &$path) { + if (!is_string($path)) { + $validation[] = $l->t("A path is not valid."); + break; + } + $path = trim($path); + if (preg_match('/^([a-zA-Z]+:)?\/\//', $path) === 1 || $path === '') { + $validation[] = $l->t("Paths must be urls relative to this server."); + break; + } else { + $path = ltrim($path, " /"); + } } - if (! ((is_string($rcInternalAddress) && strpos($rcInternalAddress, '://') > -1) - || $rcInternalAddress === '')) { - $validation[] = $l->t("Internal address '%s' is not an URL", - array($rcInternalAddress)); + if (count($rcDomains) !== count($rcPaths)) { + $validation[] = $l->t("Unpaired domains and paths."); } + // Won't change anything if validation fails. if (!empty($validation)) { return new JSONResponse(array( 'status' => 'error', @@ -68,20 +111,25 @@ public function setAdminSettings() { } // Passed validation. - $maildirFixed = "/" . trim($maildir, " /") . "/"; - $config->setAppValue($appName, 'maildir', $maildirFixed); - $checkBoxes = array('showTopLine', 'enableSSLVerify', 'enableDebug'); + $defaultRCPath = ltrim($defaultRCPath, " /"); + $config->setAppValue($appName, 'defaultRCPath', $defaultRCPath); + $domainPath = json_encode(array_filter( + array_combine($rcDomains, $rcPaths), + function($v, $k) { + return $k !== '' && $v !== ''; + }, + ARRAY_FILTER_USE_BOTH + )); + $config->setAppValue($appName, 'domainPath', $domainPath); + $checkBoxes = array('showTopLine', 'enableSSLVerify'); foreach ($checkBoxes as $c) { $config->setAppValue($appName, $c, $$c !== null); } - $config->setAppValue($appName, 'rcHost', $rcHost); - $config->setAppValue($appName, 'rcPort', $rcPort); - $config->setAppValue($appName, 'rcInternalAddress', $rcInternalAddress); return new JSONResponse(array( 'status' => 'success', 'message' => $l->t('Application settings successfully stored.'), - 'config' => array('maildir' => $maildirFixed) + 'config' => array('defaultRCPath' => $defaultRCPath) )); } } diff --git a/roundcube/lib/Crypto.php b/roundcube/lib/Crypto.php index cb4e62c..6741bcb 100644 --- a/roundcube/lib/Crypto.php +++ b/roundcube/lib/Crypto.php @@ -1,5 +1,7 @@ . + * + */ +namespace OCA\RoundCube; + +use \OCP\Util; + +/** + * The responsibility is to figure out the RC full address of logged in user, + * and provide computed values. + */ +class InternalAddress +{ + // DEFAULT_RC_PATH: When it's not yet set a default path, use this. + const DEFAULT_RC_PATH = '/roundcube/'; + + private $domain = null; + private $address = null; + private $protocol = null; + private $server = null; + private $type = null; + + public function __construct() { + $email = \OC::$server->getUserSession()->getUser()->getUID(); + $usrDom = explode('@', $email, 2); + if (count($usrDom) === 2 && strlen($usrDom[1]) > 3) { + $this->domain = $usrDom[1]; + $path = $this->getRCPath($this->domain); + $this->computeProperties($path); + } else { + Util::writeLog('roundcube', __METHOD__ . ": User ID is not an email.", Util::ERROR); + } + } + + public function getAddress() { + return $this->address; + } + + public function getServer() { + return $this->server; + } + + /** + * @param string $domain User's email domain. + * @return string RC installation path depending on user's email domain. + * Could be something like: + * - rcpath + * - https?://server/rcpath + */ + private function getRCPath($domain) { + $config = \OC::$server->getConfig(); + $defaultRCPath = $config->getAppValue('roundcube', 'defaultRCPath', self::DEFAULT_RC_PATH); + $jsonDomainPath = $config->getAppValue('roundcube', 'domainPath', ''); + if ($jsonDomainPath === '') { + return $defaultRCPath; + } + $domainPath = json_decode($jsonDomainPath, true); + if (!is_array($domainPath)) { + Util::writeLog('roundcube', __METHOD__ . ": Json decoded is not an array.", Util::WARN); + return $defaultRCPath; + } + if (isset($domainPath[$domain])) { + return $domainPath[$domain]; + } + return $defaultRCPath; + } + + /** + * Computes and modifies object's properties. + * @param string $path It'll always be either an absolute or relative path. + * @return bool Successed? + */ + private function computeProperties($path) { + $protocol = \OC::$server->getRequest()->getServerProtocol(); + if (preg_match('/^(https?):\/\/([^\/]*)/', $path, $matches) === 1) { + if ($matches[2] !== "") { + $this->type = 'absolute'; + // Can overwrite http with https but https stays https. + $this->protocol = ($protocol === 'https' ? $protocol : $matches[1]); + $this->server = $matches[2]; + $this->address = preg_replace('/^https?/', $this->protocol, $path); + return true; + } + } else { + $this->type = 'relative'; + $this->protocol = $protocol; + $this->server = preg_replace( + "(^https?://|/.*)", "", + \OC::$server->getURLGenerator()-> + getAbsoluteURL("/") + ); + $this->address = "$protocol://{$this->server}/".ltrim($path, ' /'); + return true; + } + Util::writeLog('roundcube', __METHOD__ . ": Invalid path.", Util::ERROR); + return false; + } +} diff --git a/roundcube/templates/part.error.admin.php b/roundcube/templates/part.error.admin.php deleted file mode 100644 index 090c007..0000000 --- a/roundcube/templates/part.error.admin.php +++ /dev/null @@ -1,3 +0,0 @@ -
-

t("Usuario 'admin' no hace Auto-Login.")); ?>

-
diff --git a/roundcube/templates/part.error.login.php b/roundcube/templates/part.error.login.php index 2414397..2d0f360 100644 --- a/roundcube/templates/part.error.login.php +++ b/roundcube/templates/part.error.login.php @@ -1,3 +1,26 @@ +. + * + */ +?>
-

t("Unable to login into roundcube. There are login errors.")); ?>

+

t("Unable to login into roundcube. There are login errors.")); ?>

diff --git a/roundcube/templates/part.error.noemail.php b/roundcube/templates/part.error.noemail.php new file mode 100644 index 0000000..0785509 --- /dev/null +++ b/roundcube/templates/part.error.noemail.php @@ -0,0 +1,24 @@ +. + * + */ +?> +
+

t("Username '%s' is not an email address.", $_['user'])); ?>

+
diff --git a/roundcube/templates/tpl.adminSettings.php b/roundcube/templates/tpl.adminSettings.php index 6e4cb30..1b39673 100644 --- a/roundcube/templates/tpl.adminSettings.php +++ b/roundcube/templates/tpl.adminSettings.php @@ -1,6 +1,6 @@ getURLGenerator()->imagePath('core', 'actions/delete.svg'); ?>
-
+

RoundCube

+ - + -

RoundCube

-

t('Basic settings')); ?>

- - -
-

t('Advanced settings')); ?>

- -
- -
- -
-
- - -
- - -
-
- -
- -
-
+ +
+

t('Default RC installation path')); ?>

+ +

t('Default path relative to ownCloud server (%s).', $_['ocServer'])); ?>

+
+
+

t('Per email domain RC installations')); ?>

+

t("Enter your users' email domains and their corresponding paths if you have different RoundCube installations. For example: 'domain1.com':'roundcube1/', 'domain2.com':'roundcube2/'. Path relative to ownCloud server.")); ?>

+ + + + $path) : ?> + + + + + + + + + + + + +
+ + + + + + + +
+ t('Add')); ?> +
+
+
+

t('Advanced settings')); ?>

+ +
+ +
+ diff --git a/roundcube/templates/tpl.mail.php b/roundcube/templates/tpl.mail.php index aaf4fad..56b50e0 100644 --- a/roundcube/templates/tpl.mail.php +++ b/roundcube/templates/tpl.mail.php @@ -1,6 +1,6 @@
- +