diff --git a/Dockerfile b/Dockerfile index e6a0fc4c..5e89dc24 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,9 +33,9 @@ RUN curl -sL https://apt.verdnatura.es/conf/verdnatura.gpg | apt-key add - \ > /etc/apt/sources.list.d/vn.list \ && apt-get update \ && apt-get install -y --no-install-recommends \ + php-apcu \ php-image-text \ php-text-captcha \ - php-apcu \ php-zip \ hedera-web \ cron diff --git a/debian/changelog b/debian/changelog index 87edd34d..389511fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -hedera-web (22.48.5) stable; urgency=low +hedera-web (22.48.10) stable; urgency=low * Initial Release. diff --git a/debian/control b/debian/control index 46b92b74..99dddf1b 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Vcs-Git: https://gitea.verdnatura.es/verdnatura/hedera-web Package: hedera-web Architecture: all Depends: apache2 | httpd, nodejs, php-cli, php-vn-lib, php-apcu, php-imap, php-soap, libphp-phpmailer, php-gd, php-pear -Suggests: php-text-captcha, php-zip, cron +Suggests: php-image-text, php-text-captcha, php-zip, cron Section: misc Priority: optional Description: Verdnatura's web page diff --git a/debian/cron.d b/debian/cron.d index 1037bb2c..846174c7 100755 --- a/debian/cron.d +++ b/debian/cron.d @@ -1,6 +1,5 @@ MAILTO=webmaster */1 * * * * root hedera-web.php -m misc/mail -*/4 * * * * root hedera-web.php -m tpv/confirm-mail */2 * * * * root hedera-web.php -m edi/load 0 23 * * * root hedera-web.php -m edi/clean 0 5 * * * root hedera-web.php -m edi/update diff --git a/forms/account/conf/index.js b/forms/account/conf/index.js index 1cd8855a..c603b618 100644 --- a/forms/account/conf/index.js +++ b/forms/account/conf/index.js @@ -28,45 +28,54 @@ export default new Class({ } ,async onPassModifyClick() { - var oldPassword = this.$.oldPassword.value; - var newPassword = this.$.newPassword.value; - var repeatedPassword = this.$.repeatPassword.value; - - if (newPassword == '' && repeatedPassword == '') - throw new Error(_('Passwords empty')); - if (newPassword !== repeatedPassword) - throw new Error(_('Passwords doesn\'t match')); - - var verificationToken = this.hash.$.verificationToken; - var params = {newPassword}; - - let err; + const form = this.$.changePassword.node; + Vn.Node.disableInputs(form); try { - if (verificationToken) { - params.verificationToken = verificationToken; - await this.conn.send('user/restore-password', params); - } else { - let userId = this.gui.user.id; - params.oldPassword = oldPassword; - await this.conn.patch( - `Accounts/${userId}/changePassword`, params); + const oldPassword = this.$.oldPassword.value; + const newPassword = this.$.newPassword.value; + const repeatedPassword = this.$.repeatPassword.value; + + try { + if (newPassword == '' && repeatedPassword == '') + throw new Error(_('Passwords empty')); + if (newPassword !== repeatedPassword) + throw new Error(_('Passwords doesn\'t match')); + } catch (err) { + return Htk.Toast.showError(err.message); } - } catch(e) { - err = e; - Htk.Toast.showError(err.message); + + const verificationToken = this.hash.$.verificationToken; + const params = {newPassword}; - if (this.hash.$.verificationToken) - this.$.newPassword.select(); - else - this.$.oldPassword.select(); + try { + if (verificationToken) { + params.verificationToken = verificationToken; + await this.conn.send('user/restore-password', params); + } else { + let userId = this.gui.user.id; + params.oldPassword = oldPassword; + await this.conn.patch( + `Accounts/${userId}/changePassword`, params); + } + } catch(err) { + Htk.Toast.showError(err.message); - return; + if (verificationToken) + this.$.newPassword.select(); + else + this.$.oldPassword.select(); + + return; + } + + this.hash.unset('verificationToken'); + await this.conn.open(this.gui.user.name, newPassword); + this.$.changePassword.hide(); + } finally { + Vn.Node.disableInputs(form, false); } - - this.$.changePassword.hide(); - this.hash.unset('verificationToken'); + Htk.Toast.showMessage(_('Password changed!')); - this.$.userForm.refresh(); } ,onPassInfoClick() { diff --git a/forms/account/conf/ui.xml b/forms/account/conf/ui.xml index cc60d89a..86d7c29b 100644 --- a/forms/account/conf/ui.xml +++ b/forms/account/conf/ui.xml @@ -89,11 +89,13 @@ + placeholder="_New password" + autocomplete="new-password"/> + placeholder="_Repeat password" + autocomplete="new-password"/>
diff --git a/forms/ecomerce/checkout/style.scss b/forms/ecomerce/checkout/style.scss index cb95cfab..84448043 100644 --- a/forms/ecomerce/checkout/style.scss +++ b/forms/ecomerce/checkout/style.scss @@ -1,54 +1,55 @@ -.checkout .bar { - margin-bottom: 16px; -} +.hedera-checkout { + .bar { + margin-bottom: 16px; + } -/* Step */ + /* Step */ -.answers button, -.answers p, -.radio > div { - font-size: 1.2rem; + .answers button, + .answers p, + .radio > div { + font-size: 1.2rem; + } + .answers .htk-select { + max-width: 15em; + margin: 0 auto; + font-size: 1.4rem; + } + .answers p { + margin: 0.3em 0; + } + .target { + max-width: 28em; + margin: 0 auto; + } + .address { + border-radius: 0.1em; + padding: 0.6em 1.4em; + } + .address.selected { + background-color: rgba(1, 1, 1, .1); + } + .address:hover { + cursor: pointer; + background-color: rgba(1, 1, 1, .05); + } + .address p.consignee { + font-weight: bold; + } + .radio { + max-width: 20em; + margin: 0 auto; + } + .radio > div { + padding: 0.5em; + } + .thin-calendar { + max-width: 24em; + margin: 0 auto; + box-shadow: none; + } + .htk-assistant .thin { + float: right; + } } -.answers .htk-select { - max-width: 15em; - margin: 0 auto; - font-size: 1.4rem; -} -.answers p { - margin: 0.3em 0; -} -.target { - max-width: 28em; - margin: 0 auto; -} -.address { - border-radius: 0.1em; - padding: 0.6em 1.4em; -} -.address.selected { - background-color: rgba(1, 1, 1, .1); -} -.address:hover { - cursor: pointer; - background-color: rgba(1, 1, 1, .05); -} -.address p.consignee { - font-weight: bold; -} -.radio { - max-width: 20em; - margin: 0 auto; -} -.radio > div { - padding: 0.5em; -} -.thin-calendar { - max-width: 24em; - margin: 0 auto; - box-shadow: none; -} -.htk-assistant .thin { - float: right; -} - diff --git a/forms/ecomerce/checkout/ui.xml b/forms/ecomerce/checkout/ui.xml index f9a32719..a62d37cc 100644 --- a/forms/ecomerce/checkout/ui.xml +++ b/forms/ecomerce/checkout/ui.xml @@ -54,7 +54,7 @@ tip="_Cancel" on-click="onCancelClick"/>
- =s('Press on the following link to change your password.')?> + =s('pressLinkToRecoverPassword')?>
- =s('Recover password')?> + =s('recoverPassword')?> diff --git a/rest/client/supplant.php b/rest/client/supplant.php index 4ef83402..87715601 100644 --- a/rest/client/supplant.php +++ b/rest/client/supplant.php @@ -10,7 +10,7 @@ class Supplant extends Vn\Web\JsonRequest { 'SELECT id FROM account.user WHERE `name` = #', [$_REQUEST['supplantUser']] ); - +/* $isClient = $db->getValue( 'SELECT COUNT(*) > 0 FROM vn.client WHERE id = #', [$userId] @@ -24,7 +24,7 @@ class Supplant extends Vn\Web\JsonRequest { ); if ($hasAccount) throw new Web\ForbiddenException(s('The user is not impersonable')); - +*/ return $this->service->createToken($_REQUEST['supplantUser']); } } diff --git a/rest/core/locale/ca.json b/rest/core/locale/ca.json deleted file mode 100644 index 3bc546a6..00000000 --- a/rest/core/locale/ca.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "InvalidAction": "Acció invàlida" - - ,"EmptyQuery": "Consulta buida" -} diff --git a/rest/core/locale/ca.yml b/rest/core/locale/ca.yml new file mode 100644 index 00000000..fd0c7306 --- /dev/null +++ b/rest/core/locale/ca.yml @@ -0,0 +1,2 @@ +InvalidAction: Acció invàlida +EmptyQuery: Consulta buida diff --git a/rest/core/locale/en.json b/rest/core/locale/en.json deleted file mode 100644 index 75f9e384..00000000 --- a/rest/core/locale/en.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "InvalidAction": "Invalid action" - - ,"EmptyQuery": "Empty query" -} diff --git a/rest/core/locale/en.yml b/rest/core/locale/en.yml new file mode 100644 index 00000000..9418df77 --- /dev/null +++ b/rest/core/locale/en.yml @@ -0,0 +1,2 @@ +InvalidAction: Invalid action +EmptyQuery: Empty query diff --git a/rest/core/locale/es.json b/rest/core/locale/es.json deleted file mode 100644 index f33bd628..00000000 --- a/rest/core/locale/es.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "InvalidAction": "Acción inválida" - ,"EmptyQuery": "Consulta vacía" - ,"Invalid password": "Contraseña inválida" - ,"Password does not meet requirements": - "La nueva contraseña no reune los requisitos de seguridad necesarios" -} diff --git a/rest/core/locale/es.yml b/rest/core/locale/es.yml new file mode 100644 index 00000000..b795f758 --- /dev/null +++ b/rest/core/locale/es.yml @@ -0,0 +1,2 @@ +InvalidAction: Acción inválida +EmptyQuery: Consulta vacía diff --git a/rest/core/locale/fr.json b/rest/core/locale/fr.json deleted file mode 100644 index a9a18625..00000000 --- a/rest/core/locale/fr.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "InvalidAction": "Action non valide" - - ,"EmptyQuery": "Requête vide" -} diff --git a/rest/core/locale/fr.yml b/rest/core/locale/fr.yml new file mode 100644 index 00000000..d34f2b44 --- /dev/null +++ b/rest/core/locale/fr.yml @@ -0,0 +1,2 @@ +InvalidAction: Action non valide +EmptyQuery: Requête vide diff --git a/rest/core/locale/pt.json b/rest/core/locale/pt.json deleted file mode 100644 index 90823f48..00000000 --- a/rest/core/locale/pt.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "InvalidAction": "Ação Inválida" - - ,"EmptyQuery": "Consulta vazía" -} diff --git a/rest/core/locale/pt.yml b/rest/core/locale/pt.yml new file mode 100644 index 00000000..e1e7d8a5 --- /dev/null +++ b/rest/core/locale/pt.yml @@ -0,0 +1,2 @@ +InvalidAction: Ação Inválida +EmptyQuery: Consulta vazía diff --git a/rest/core/query.php b/rest/core/query.php index fb09ab27..4d398e93 100644 --- a/rest/core/query.php +++ b/rest/core/query.php @@ -22,53 +22,34 @@ class Query extends Vn\Web\JsonRequest { function run($db) { $results = []; + $db->multiQuery($_REQUEST['sql']); - try { - $db->multiQuery($_REQUEST['sql']); + do { + $result = $db->storeResult(); - do { - $result = $db->storeResult(); + if ($result !== FALSE) { + $results[] = $this->transformResult($result); + $result->free(); + } else + $results[] = TRUE; + } + while ($db->moreResults() && $db->nextResult()); - if ($result !== FALSE) { - $results[] = $this->transformResult($result); - $result->free(); - } else - $results[] = TRUE; + if ($db->checkWarnings() + &&($result = $db->query('SHOW WARNINGS'))) { + $sql = 'SELECT `description`, @warn `code` + FROM `message` WHERE `code` = @warn'; + + while ($row = $result->fetch_object()) { + if ($row->Code == 1265 + &&($warning = $db->getObject($sql))) + trigger_error("{$warning->code}: {$warning->description}", E_USER_WARNING); + else + trigger_error("{$row->Code}: {$row->Message}", E_USER_WARNING); } - while ($db->moreResults() && $db->nextResult()); - - // Checks for warnings - - if ($db->checkWarnings() - &&($result = $db->query('SHOW WARNINGS'))) { - $sql = 'SELECT `description`, @warn `code` - FROM `message` WHERE `code` = @warn'; - - while ($row = $result->fetch_object()) { - if ($row->Code == 1265 - &&($warning = $db->getObject($sql))) - trigger_error("{$warning->code}: {$warning->description}", E_USER_WARNING); - else - trigger_error("{$row->Code}: {$row->Message}", E_USER_WARNING); - } - } - - // Checks for errors - - $db->checkError(); - } catch (Vn\Db\Exception $e) { - if ($e->getCode() == 1644) { - $dbMessage = $e->getMessage(); - $sql = 'SELECT `description` FROM `message` WHERE `code` = #'; - $message = $db->getValue($sql, [$dbMessage]); - - if ($message) - throw new Lib\UserException($message, $dbMessage); - } - - throw $e; } + $db->checkError(); return $results; } diff --git a/rest/image/locale/en.json b/rest/image/locale/en.json deleted file mode 100644 index 4ce990a4..00000000 --- a/rest/image/locale/en.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Cant lock cache": "The cache could not be blocked" - ,"Bad file format": "Unrecognized file format" - ,"File not choosed": "You have not selected any file" - ,"Permission denied": "You are not allowed to upload the file" - ,"File upload error": "Failed to upload the file, check that size is not too large" - ,"File save error": "Failed to save the file: %s" - ,"File size error": "The file must be no longer than %.2f MB" - ,"Bad file name": "The file name must contain only lowercase letters, digits or the '_' character" - ,"Bad collection name": "Invalid collection name" - ,"Collection not exists": "Collection does not exist" - ,"Unreferenced file": "The file is not referenced by the database" - ,"Cannot update matching id": "Cannot update matching id" - ,"Com error": "Error communicating with the server" - ,"Image open error": "Error opening the image file" - ,"Operation disabled": "Operation disabled for security" - ,"Image added": "Image added correctly" - - ,"ErrIniSize": "File exceeds the upload_max_filesize directive in php.ini" - ,"ErrFormSize": "File exceeds the MAX_FILE_SIZE specified in the HTML form" - ,"ErrPartial": "File was partially uploaded" - ,"ErrNoFile": "No file was uploaded" - ,"ErrNoTmpDir": "Missing a temporary folder" - ,"ErrCantWrite": "Failed to write file to disk" - ,"ErrExtension": "File upload stopped by extension" - ,"ErrDefault": "Unknown upload error" - - ,"Sync complete": "Synchronization complete" -} diff --git a/rest/image/locale/en.yml b/rest/image/locale/en.yml new file mode 100644 index 00000000..4a18391e --- /dev/null +++ b/rest/image/locale/en.yml @@ -0,0 +1,27 @@ +Cant lock cache: The cache could not be blocked +Bad file format: Unrecognized file format +File not choosed: You have not selected any file +Permission denied: You are not allowed to upload the file +File upload error: Failed to upload the file, check that size is not too large +File save error: 'Failed to save the file: %s' +File size error: The file must be no longer than %.2f MB +Bad file name: 'The file name must contain only lowercase letters, digits or the ''_'' character' +Bad collection name: Invalid collection name +Collection not exists: Collection does not exist +Unreferenced file: The file is not referenced by the database +Cannot update matching id: Cannot update matching id +Com error: Error communicating with the server +Image open error: Error opening the image file +Operation disabled: Operation disabled for security +Image added: Image added correctly + +ErrIniSize: File exceeds the upload_max_filesize directive in php.ini +ErrFormSize: File exceeds the MAX_FILE_SIZE specified in the HTML form +ErrPartial: File was partially uploaded +ErrNoFile: No file was uploaded +ErrNoTmpDir: Missing a temporary folder +ErrCantWrite: Failed to write file to disk +ErrExtension: File upload stopped by extension +ErrDefault: Unknown upload error + +Sync complete: Synchronization complete diff --git a/rest/image/locale/es.json b/rest/image/locale/es.json deleted file mode 100644 index 181acc65..00000000 --- a/rest/image/locale/es.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Cant lock cache": "La caché no pudo ser bloqueada" - ,"Bad file format": "Formato de archivo no reconocido" - ,"File not choosed": "No has seleccionado ningún archivo" - ,"Permission denied": "No tienes permiso para subir el fichero" - ,"File upload error": "Error al subir el fichero, comprueba que su tamaño no sea demasiado grande" - ,"File save error": "Error al guardar el fichero: %s" - ,"File size error": "El fichero no debe ocupar más de %.2f MB" - ,"Bad file name": "El nombre del archivo solo debe contener letras minúsculas, dígitos o el carácter '_'" - ,"Bad collection name": "Nombre de colección no válido" - ,"Collection not exists": "La colección no existe" - ,"Unreferenced file": "El archivo no está referenciado por la base de datos" - ,"Cannot update matching id": "No es posible actualizar los ítems con id coincidente" - ,"Com error": "Error en la comunicación con el servidor" - ,"Image open error": "Error al abrir el archivo de imagen" - ,"Operation disabled": "Operación deshabilitada por seguridad" - ,"Image added": "Imagen añadida correctamente" - - ,"ErrIniSize": "File exceeds the upload_max_filesize directive in php.ini" - ,"ErrFormSize": "File exceeds the MAX_FILE_SIZE specified in the HTML form" - ,"ErrPartial": "File was partially uploaded" - ,"ErrNoFile": "No file was uploaded" - ,"ErrNoTmpDir": "Missing a temporary folder" - ,"ErrCantWrite": "Failed to write file to disk" - ,"ErrExtension": "File upload stopped by extension" - ,"ErrDefault": "Unknown upload error" - - ,"Sync complete": "Sincronización completada" -} diff --git a/rest/image/locale/es.yml b/rest/image/locale/es.yml new file mode 100644 index 00000000..54bdcee4 --- /dev/null +++ b/rest/image/locale/es.yml @@ -0,0 +1,27 @@ +Cant lock cache: La caché no pudo ser bloqueada +Bad file format: Formato de archivo no reconocido +File not choosed: No has seleccionado ningún archivo +Permission denied: No tienes permiso para subir el fichero +File upload error: Error al subir el fichero, comprueba que su tamaño no sea demasiado grande +File save error: 'Error al guardar el fichero: %s' +File size error: El fichero no debe ocupar más de %.2f MB +Bad file name: 'El nombre del archivo solo debe contener letras minúsculas, dígitos o el carácter ''_''' +Bad collection name: Nombre de colección no válido +Collection not exists: La colección no existe +Unreferenced file: El archivo no está referenciado por la base de datos +Cannot update matching id: No es posible actualizar los ítems con id coincidente +Com error: Error en la comunicación con el servidor +Image open error: Error al abrir el archivo de imagen +Operation disabled: Operación deshabilitada por seguridad +Image added: Imagen añadida correctamente + +ErrIniSize: File exceeds the upload_max_filesize directive in php.ini +ErrFormSize: File exceeds the MAX_FILE_SIZE specified in the HTML form +ErrPartial: File was partially uploaded +ErrNoFile: No file was uploaded +ErrNoTmpDir: Missing a temporary folder +ErrCantWrite: Failed to write file to disk +ErrExtension: File upload stopped by extension +ErrDefault: Unknown upload error + +Sync complete: Sincronización completada diff --git a/rest/image/locale/pt.json b/rest/image/locale/pt.json deleted file mode 100644 index 52f2936c..00000000 --- a/rest/image/locale/pt.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "Cant lock cache": "O cache não pôde ser bloqueado" - ,"Bad file format": "Formato de arquivo inválido" - ,"File not choosed": "Não selecionastes nenhum arquivo" - ,"Permission denied": "Não estas autorizado a subir o arquivo" - ,"File upload error": "Erro ao subir o arquivo, verifique o tamanho" - ,"File save error": "Erro ao salvar o arquivo: %s" - ,"File size error": "O arquivo não deve ser maior que: %.2f MB" - ,"Bad file name": "O nome do arquivo deve conter somente letras minusculas, numeros ou '_' " - ,"Bad collection name": "Nome de coleção inválido" - ,"Collection not exists": "Coleção não existe" - ,"Unreferenced file": "O arquivo não é referenciado pelo banco de dados" - ,"Cannot update matching id": "Não é possível atualizar os itens com id coincidente" - ,"Com error": "Erro de comunicação com o servidor" - ,"Image open error": "Erro ao abrir a imagem" - ,"Operation disabled": "Operação desativada por segurança" - ,"Image added": "Imagem adicionada corretamente" - - ,"ErrIniSize": "Arquivo supera o tamanho maximo de protocolo em php.ini" - ,"ErrFormSize": "Arquivo supera o tamanho maximo de protocolo em HTML form" - ,"ErrPartial": "Arquivo subido parcialmente" - ,"ErrNoFile": "Nenhum arquivo subido" - ,"ErrNoTmpDir": "Falta a pasta de arquivo temporal" - ,"ErrCantWrite": "Erro ao gravar arquivo no disco" - ,"ErrExtension": "Erro de extensão do arquivo" - ,"ErrDefault": "Erro desconhecido ao subir arquivo" - - ,"Sync complete": "Sincronização completa" -} diff --git a/rest/image/locale/pt.yml b/rest/image/locale/pt.yml new file mode 100644 index 00000000..a4986bf0 --- /dev/null +++ b/rest/image/locale/pt.yml @@ -0,0 +1,27 @@ +Cant lock cache: O cache não pôde ser bloqueado +Bad file format: Formato de arquivo inválido +File not choosed: Não selecionastes nenhum arquivo +Permission denied: Não estas autorizado a subir o arquivo +File upload error: Erro ao subir o arquivo, verifique o tamanho +File save error: 'Erro ao salvar o arquivo: %s' +File size error: O arquivo não deve ser maior que %.2f MB +Bad file name: 'O nome do arquivo deve conter somente letras minusculas, numeros ou ''_''' +Bad collection name: Nome de coleção inválido +Collection not exists: Coleção não existe +Unreferenced file: O arquivo não é referenciado pelo banco de dados +Cannot update matching id: Não é possível atualizar os itens com id coincidente +Com error: Erro de comunicação com o servidor +Image open error: Erro ao abrir a imagem +Operation disabled: Operação desativada por segurança +Image added: Imagem adicionada corretamente + +ErrIniSize: Arquivo supera o tamanho maximo de protocolo em php.ini +ErrFormSize: Arquivo supera o tamanho maximo de protocolo em HTML form +ErrPartial: Arquivo subido parcialmente +ErrNoFile: Nenhum arquivo subido +ErrNoTmpDir: Falta a pasta de arquivo temporal +ErrCantWrite: Erro ao gravar arquivo no disco +ErrExtension: Erro de extensão do arquivo +ErrDefault: Erro desconhecido ao subir arquivo + +Sync complete: Sincronização completa diff --git a/rest/misc/locale/es.json b/rest/misc/locale/es.json deleted file mode 100644 index c6fa7ca3..00000000 --- a/rest/misc/locale/es.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "An automated message could not be delivered": "Un mensaje automatizado no se ha podido entregar" - ,"Notification from IT department about problem.": "Desde el departamento de informática te enviamos este correo porque ha habido un problema al intentar entregar un correo automatizado." - ,"If you have questions, resend this email to cau@verdnatura.es.": "Si tienes dudas, reenvia este correo a cau@verdnatura.es." - ,"The response from the remote server was:": "La respuesta del servidor remoto ha sido:" -} \ No newline at end of file diff --git a/rest/misc/locale/es.yml b/rest/misc/locale/es.yml new file mode 100644 index 00000000..6e5a631e --- /dev/null +++ b/rest/misc/locale/es.yml @@ -0,0 +1,4 @@ +automatedMessageNotDelivered: Un mensaje automatizado no se ha podido entregar +ITProblemNotification: Desde el departamento de informática te enviamos este correo porque ha habido un problema al intentar entregar un correo automatizado. +ifQuestionsResendEmailToIT: Si tienes dudas, reenvia este correo a cau@verdnatura.es. +'The response from the remote server was:': 'La respuesta del servidor remoto ha sido:' diff --git a/rest/misc/mail.php b/rest/misc/mail.php index 6e075932..a2955200 100644 --- a/rest/misc/mail.php +++ b/rest/misc/mail.php @@ -48,13 +48,13 @@ class Mail extends Vn\Lib\Method { if ($row->replyTo) { Vn\Lib\Locale::set('es'); $errorMsg = - ''. s('Notification from IT department about problem.') .'
' - .''. s('If you have questions, resend this email to cau@verdnatura.es.') .'
' + ''. s('ITProblemNotification') .'
' + .''. s('ifQuestionsResendEmailToIT') .'
' .''. $status .'
'; $errorMail = $mailer->createObject($row->replyTo, $errorMsg, - s('An automated message could not be delivered') + s('automatedMessageNotDelivered') ); $errorMail->AddStringAttachment( $mail->getSentMIMEMessage(), diff --git a/rest/tpv/confirm-mail.php b/rest/tpv/confirm-mail.php deleted file mode 100644 index 719bfed1..00000000 --- a/rest/tpv/confirm-mail.php +++ /dev/null @@ -1,98 +0,0 @@ -getObject( - 'SELECT host, user, pass, cleanPeriod, successFolder, errorFolder - FROM tpvImapConfig' - ); - - $mailbox = sprintf('{%s/imap/ssl/novalidate-cert}', - $imapConf->host); - - $imap = imap_open($mailbox - ,$imapConf->user - ,base64_decode($imapConf->pass) - ); - - if (!$imap) - throw new Exception(imap_last_error()); - - // Fetchs and confirms new transaction mails - - $count = 0; - $inbox = imap_search($imap, 'ALL'); - - if ($inbox) - foreach ($inbox as $msg) { - // Decodes the mail body - - $params = []; - $body = imap_fetchbody($imap, $msg, '1'); - $strings = explode(';', $body); - - foreach ($strings as $string) { - $x = explode(':', $string); - $params[trim($x[0])] = trim($x[1]); - } - - // Confirms the transaction - - $success = FALSE; - - try { - $success = Tpv::confirm($db, $params); - } catch (\Exception $e) { - trigger_error($e->getMessage(), E_USER_WARNING); - } - - // Moves the processed mail to another folder - - if ($success) - $folder = $imapConf->successFolder; - else - $folder = $imapConf->errorFolder; - - if (!imap_mail_move($imap, $msg, "$folder")) - trigger_error(imap_last_error(), E_USER_WARNING); - - $count++; - } - - imap_expunge($imap); - - // Cleans the old mails - - $deleted = 0; - - if (rand(1, 20) == 1) { - $folders = array( - $imapConf->successFolder - ,$imapConf->errorFolder - ); - - $date = new \DateTime(NULL); - $date->sub(new \DateInterval($imapConf->cleanPeriod)); - $filter = sprintf('BEFORE "%s"', $date->format('D, j M Y')); - - foreach ($folders as $folder) - if (imap_reopen($imap, $mailbox.$folder)) - if ($messages = imap_search($imap, $filter)) { - foreach ($messages as $message) - imap_delete($imap, $message); - - imap_expunge($imap); - $deleted += count($messages); - } - } - - echo "$count mails processed, $deleted mails deleted.\n"; - } -} - diff --git a/rest/tpv/confirm-post.php b/rest/tpv/confirm-post.php deleted file mode 100644 index 20d3cb79..00000000 --- a/rest/tpv/confirm-post.php +++ /dev/null @@ -1,13 +0,0 @@ -addFunction('procesaNotificacionSIS'); - $server->handle(); - } -} - -function procesaNotificacionSIS($XML) { - global $tpvConfirmSoap; - - $db = $tpvConfirmSoap->app->getSysConn(); - - $status = 'OK'; - $requestString = $XML; - - // Processes the request - - try { - $xml = new SimpleXMLElement($requestString); - $params =(array) $xml->{'Request'}; - - if (!(isset($params['Ds_Amount']) - && isset($params['Ds_Order']) - && isset($params['Ds_MerchantCode']) - && isset($params['Ds_Currency']) - && isset($params['Ds_Response']))) - throw new Exception('Missing required parameters'); - - // Checks the signature - - $start = strpos($requestString, '-
=htmlentities($result)?>- -
- Calculated: =$shaHash?> -
-- Valid: /> -
- - diff --git a/rest/tpv/soap.wsdl b/rest/tpv/soap.wsdl deleted file mode 100644 index bd85821d..00000000 --- a/rest/tpv/soap.wsdl +++ /dev/null @@ -1,51 +0,0 @@ - - -