From: Thomas Citharel Date: Fri, 13 Feb 2015 18:10:22 +0000 (+0100) Subject: improvements to internal registration and translations X-Git-Tag: 1.9beta~7^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=6cb5e1c9f511996d52b45b459bb26047f0dead38;p=github%2Fwallabag%2Fwallabag.git improvements to internal registration and translations --- diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index b26826f1..8ade91b4 100755 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -81,25 +81,40 @@ class Poche $email = filter_var($email, FILTER_SANITIZE_STRING); if (!$this->store->userExists($newUsername)){ if ($this->store->install($newUsername, Tools::encodeString($password . $newUsername), $email)) { - if (SEND_CONFIRMATION_EMAIL && function_exists('mail')) { - // if internal registration - $body_internal = "Hi,\r\n\r\nSomeone just created an account for you on " . Tools::getPocheUrl() . ".\r\nHave fun with it !"; - // if external (public) registration - $body = "Hi, \r\n\r\nYou've just created an account on " . Tools::getPocheUrl() . ".\r\nHave fun with it !"; - $body = $internalRegistration ? $body_internal : $body; - $body = wordwrap($body, 70, "\r\n"); // cut lines with more than 70 caracters (MIME standard) - if (mail($email, sprintf(_('Your new wallabag account on '), Tools::getPocheUrl()), $body, 'X-Mailer: PHP/' . phpversion())) { - Tools::logm('The user ' . $newUsername . ' has been emailed'); - $this->messages->add('i', sprintf(_('The new user %1$s has been sent an email at %2$s.'), $newUsername, $email)); + if ($email != "") { // if email is filled + if (SEND_CONFIRMATION_EMAIL && function_exists('mail')) { + + // if internal registration + $body_internal = _('Hi,') . "\r\n\r\n" . sprintf(_('Someone just created a wallabag account for you on %1$s.'), Tools::getPocheUrl()) . + "\r\n\r\n" . sprintf(_('Your login is %1$s.'), $newUsername) ."\r\n\r\n" . + _('Note : The password has been chosen by the person who created your account. Get in touch with that person to know your password and change it as soon as possible') . "\r\n\r\n" . + _('Have fun with it !') . "\r\n\r\n" . + _('This is an automatically generated message, no one will answer if you respond to it.'); + // if external (public) registration + $body = "Hi, " . $newUsername . "\r\n\r\nYou've just created a wallabag account on " . Tools::getPocheUrl() . ".\r\nHave fun with it !"; + $body = $internalRegistration ? $body_internal : $body; + + $body = wordwrap($body, 70, "\r\n"); // cut lines with more than 70 caracters (MIME standard) + if (mail($email, sprintf(_('Your new wallabag account on %1$s'), Tools::getPocheUrl()), $body, + 'X-Mailer: PHP/' . phpversion() . "\r\n" . + 'Content-type: text/plain; charset=UTF-8' . "\r\n" . + "From: " . $newUsername . "@" . gethostname() . "\r\n")) { + Tools::logm('The user ' . $newUsername . ' has been emailed'); + $this->messages->add('i', sprintf(_('The new user %1$s has been sent an email at %2$s. You may have to check spam folder.'), $newUsername, $email)); + + } else { + Tools::logm('A problem has been encountered while sending an email'); + $this->messages->add('e', _('A problem has been encountered while sending an email')); + } } else { - Tools::logm('A problem has been encountered while sending an email'); - $this->messages->add('e', _('A problem has been encountered while sending an email')); + Tools::logm('The user has been created, but the server did not authorize sending emails'); + $this->messages->add('i', _('The server did not authorize sending a confirmation email')); } - } else { - Tools::logm('The user has been created, but the server did not authorize sending emails'); - $this->messages->add('i', _('The server did not authorize sending an email')); - } + } else { + Tools::logm('The user has been created, but no email was saved, so no confimation email was sent'); + $this->messages->add('i', _('The user was created, but no email was sent because email was not filled in')); + } Tools::logm('The new user ' . $newUsername . ' has been installed'); $this->messages->add('s', sprintf(_('The new user %s has been installed. Do you want to logout ?'), $newUsername)); Tools::redirect(); diff --git a/inc/poche/config.inc.default.php b/inc/poche/config.inc.default.php index 91b50c24..fbf4ae9a 100755 --- a/inc/poche/config.inc.default.php +++ b/inc/poche/config.inc.default.php @@ -59,6 +59,9 @@ @define ('MOBI', FALSE); @define ('PDF', FALSE); +// registration +@define ('SEND_CONFIRMATION_EMAIL', TRUE); + // display or not print link in article view @define ('SHOW_PRINTLINK', '1'); // display or not percent of read in article view. Affects only default theme. diff --git a/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.mo b/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.mo index 77dee070..02523125 100644 Binary files a/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.mo and b/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.mo differ diff --git a/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.po b/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.po index 579d1aca..75dad661 100644 --- a/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.po +++ b/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.po @@ -663,6 +663,56 @@ msgstr "Download the articles from this search in an EPUB" msgid "Download the articles from this category in an epub" msgstr "Download the articles from this category in an EPUB" +# registration +msgid "Hi," +msgstr "Hi," + +msgid "Hi, %1$s" +msgstr "Hi, %1$s" + +msgid "Someone just created a wallabag account for you on %1$s." +msgstr "Someone just created a wallabag account for you on %1$s." + +msgid "Your login is %1$s." +msgstr "Your login is %1$s." + +msgid "Have fun with it !" +msgstr "Have fun with it !" + +msgid "" +"This is an automatically generated message, no one will answer if you " +"respond to it." +msgstr "" +"This is an automatically generated message, no one will answer if you " +"respond to it." + +msgid "" +"Note : The password has been chosen by the person who created your account. " +"Get in touch with that person to know your password and change it as soon as " +"possible" +msgstr "" +"Note : The password has been chosen by the person who created your account. " +"Get in touch with that person to know your password and change it as soon as " +"possible" + +msgid "" +"The new user %1$s has been sent an email at %2$s. You may have to check spam " +"folder." +msgstr "" +"The new user %1$s has been sent an email at %2$s. You may have to check spam " +"folder." + +msgid "A problem has been encountered while sending the confirmation email" +msgstr "A problem has been encountered while sending an confirmation email" + +msgid "The server did not authorize sending a confirmation email" +msgstr "The server did not authorize sending a confirmation email" + +msgid "" +"The user was created, but no email was sent because email was not filled in" +msgstr "" +"The user was created, but no email was sent because email was not filled in" + #~ msgid "poche it!" #~ msgstr "poche it!" diff --git a/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo b/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo index 83f397a0..b3b2f6fe 100644 Binary files a/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo and b/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo differ diff --git a/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po b/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po index fef31208..948a8356 100644 --- a/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po +++ b/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po @@ -789,6 +789,58 @@ msgstr "" msgid "Produced by wallabag with PHPMobi" msgstr "Produit par wallabag avec PHPMobi" +# registration +msgid "Hi," +msgstr "Salut," + +msgid "Hi, %1$s" +msgstr "Salut, %1$s" + +msgid "Someone just created a wallabag account for you on %1$s." +msgstr "" +"Quelqu'un vient juste de créer un compte wallabag pour vous à l'adresse %1$s." + +msgid "Your login is %1$s." +msgstr "Votre identifiant is %1$s." + +msgid "Have fun with it !" +msgstr "Amusez-vous bien !" + +msgid "" +"This is an automatically generated message, no one will answer if you " +"respond to it." +msgstr "" +"Ceci est un message généré automatiquement, personne ne vous répondra si " +"vous y répondez." + +msgid "" +"Note : The password has been chosen by the person who created your account. " +"Get in touch with that person to know your password and change it as soon as " +"possible" +msgstr "" +"Note : Votre mot de passe a été défini par la personne ayant créé votre " +"compte. Vous devriez entrer en contact avec cette personne pour connaître " +"votre mot de passe et le changer dès que possible" + +msgid "" +"The new user %1$s has been sent an email at %2$s. You may have to check spam " +"folder." +msgstr "" +"Un email a été envoyé au nouvel utiliateur %1$s à l'adresse %2$s. Il peut " +"être nécessaire de vérifier le dossier des spams." + +msgid "A problem has been encountered while sending the confirmation email" +msgstr "Un problème a été rencontré lors de l'envoi de l'email de confirmation" + +msgid "The server did not authorize sending a confirmation email" +msgstr "Le serveur n'autorise pas l'envoi d'un email de confirmation" + +msgid "" +"The user was created, but no email was sent because email was not filled in" +msgstr "" +"L'utilisateur a été créé, mais aucun mail n'a été envoyé car l'email n'était " +"pas renseigné" + msgid "Mail function is disabled. You can't send emails from your server" msgstr "" "La fonction mail est désactivée. Vous ne pouvez pas envoyer d'E-mails depuis "