]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
improvements to internal registration and translations 1022/head
authorThomas Citharel <tcit@tcit.fr>
Fri, 13 Feb 2015 18:10:22 +0000 (19:10 +0100)
committerThomas Citharel <tcit@tcit.fr>
Fri, 13 Feb 2015 18:10:22 +0000 (19:10 +0100)
inc/poche/Poche.class.php
inc/poche/config.inc.default.php
locale/en_US.utf8/LC_MESSAGES/en_US.utf8.mo
locale/en_US.utf8/LC_MESSAGES/en_US.utf8.po
locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo
locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po

index b26826f169bf526ba4dd5e01dc4527c57c1871c1..8ade91b4852900e8b20da18666d02bfb60d2a1d8 100755 (executable)
@@ -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 <a href="?logout">logout ?</a>'), $newUsername));
                 Tools::redirect();
index 91b50c2443d84f5da0b59b6c2a25b9b70631179a..fbf4ae9a54dd19b0baf42de4b012f02e90ba0fcd 100755 (executable)
@@ -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.
index 77dee0708e05000ddd0974f722d78e7aa7d22960..025231250ebaa376d2b3c3a7a067d9351810e2be 100644 (file)
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
index 579d1acad746094155e6faad03e9270431d84405..75dad661e762ec1a88d4a30aaf2591b63a8f629d 100644 (file)
@@ -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!"
 
index 83f397a05d37afd64e4e148c7340b97ae3144b2e..b3b2f6fed9ebafeba0bb90d7c8216628720f3ec4 100644 (file)
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
index fef3120830babae6879352445f19b1dc2c775fb9..948a835643ddbe3bd9fa8ade5458a1cd2daa3960 100644 (file)
@@ -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 "