diff options
author | Thomas Citharel <tcit@tcit.fr> | 2015-02-13 19:10:22 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2015-02-13 19:10:22 +0100 |
commit | 6cb5e1c9f511996d52b45b459bb26047f0dead38 (patch) | |
tree | 841dc5acaa92127a37332c4cde4f395a2b1daab4 | |
parent | 57068585c0a1164f1ae7ae399f3d5a68a4e9d46d (diff) | |
download | wallabag-6cb5e1c9f511996d52b45b459bb26047f0dead38.tar.gz wallabag-6cb5e1c9f511996d52b45b459bb26047f0dead38.tar.zst wallabag-6cb5e1c9f511996d52b45b459bb26047f0dead38.zip |
improvements to internal registration and translations
-rwxr-xr-x | inc/poche/Poche.class.php | 47 | ||||
-rwxr-xr-x | inc/poche/config.inc.default.php | 3 | ||||
-rw-r--r-- | locale/en_US.utf8/LC_MESSAGES/en_US.utf8.mo | bin | 15793 -> 17302 bytes | |||
-rw-r--r-- | locale/en_US.utf8/LC_MESSAGES/en_US.utf8.po | 50 | ||||
-rw-r--r-- | locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo | bin | 21037 -> 22690 bytes | |||
-rw-r--r-- | locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.po | 52 |
6 files changed, 136 insertions, 16 deletions
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 | |||
81 | $email = filter_var($email, FILTER_SANITIZE_STRING); | 81 | $email = filter_var($email, FILTER_SANITIZE_STRING); |
82 | if (!$this->store->userExists($newUsername)){ | 82 | if (!$this->store->userExists($newUsername)){ |
83 | if ($this->store->install($newUsername, Tools::encodeString($password . $newUsername), $email)) { | 83 | if ($this->store->install($newUsername, Tools::encodeString($password . $newUsername), $email)) { |
84 | if (SEND_CONFIRMATION_EMAIL && function_exists('mail')) { | 84 | if ($email != "") { // if email is filled |
85 | // if internal registration | 85 | if (SEND_CONFIRMATION_EMAIL && function_exists('mail')) { |
86 | $body_internal = "Hi,\r\n\r\nSomeone just created an account for you on " . Tools::getPocheUrl() . ".\r\nHave fun with it !"; | 86 | |
87 | // if external (public) registration | 87 | // if internal registration |
88 | $body = "Hi, \r\n\r\nYou've just created an account on " . Tools::getPocheUrl() . ".\r\nHave fun with it !"; | 88 | $body_internal = _('Hi,') . "\r\n\r\n" . sprintf(_('Someone just created a wallabag account for you on %1$s.'), Tools::getPocheUrl()) . |
89 | $body = $internalRegistration ? $body_internal : $body; | 89 | "\r\n\r\n" . sprintf(_('Your login is %1$s.'), $newUsername) ."\r\n\r\n" . |
90 | $body = wordwrap($body, 70, "\r\n"); // cut lines with more than 70 caracters (MIME standard) | 90 | _('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" . |
91 | if (mail($email, sprintf(_('Your new wallabag account on '), Tools::getPocheUrl()), $body, 'X-Mailer: PHP/' . phpversion())) { | 91 | _('Have fun with it !') . "\r\n\r\n" . |
92 | Tools::logm('The user ' . $newUsername . ' has been emailed'); | 92 | _('This is an automatically generated message, no one will answer if you respond to it.'); |
93 | $this->messages->add('i', sprintf(_('The new user %1$s has been sent an email at %2$s.'), $newUsername, $email)); | ||
94 | 93 | ||
94 | // if external (public) registration | ||
95 | $body = "Hi, " . $newUsername . "\r\n\r\nYou've just created a wallabag account on " . Tools::getPocheUrl() . ".\r\nHave fun with it !"; | ||
96 | $body = $internalRegistration ? $body_internal : $body; | ||
97 | |||
98 | $body = wordwrap($body, 70, "\r\n"); // cut lines with more than 70 caracters (MIME standard) | ||
99 | if (mail($email, sprintf(_('Your new wallabag account on %1$s'), Tools::getPocheUrl()), $body, | ||
100 | 'X-Mailer: PHP/' . phpversion() . "\r\n" . | ||
101 | 'Content-type: text/plain; charset=UTF-8' . "\r\n" . | ||
102 | "From: " . $newUsername . "@" . gethostname() . "\r\n")) { | ||
103 | Tools::logm('The user ' . $newUsername . ' has been emailed'); | ||
104 | $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)); | ||
105 | |||
106 | } else { | ||
107 | Tools::logm('A problem has been encountered while sending an email'); | ||
108 | $this->messages->add('e', _('A problem has been encountered while sending an email')); | ||
109 | } | ||
95 | } else { | 110 | } else { |
96 | Tools::logm('A problem has been encountered while sending an email'); | 111 | Tools::logm('The user has been created, but the server did not authorize sending emails'); |
97 | $this->messages->add('e', _('A problem has been encountered while sending an email')); | 112 | $this->messages->add('i', _('The server did not authorize sending a confirmation email')); |
98 | } | 113 | } |
99 | } else { | 114 | } else { |
100 | Tools::logm('The user has been created, but the server did not authorize sending emails'); | 115 | Tools::logm('The user has been created, but no email was saved, so no confimation email was sent'); |
101 | $this->messages->add('i', _('The server did not authorize sending an email')); | 116 | $this->messages->add('i', _('The user was created, but no email was sent because email was not filled in')); |
102 | } | 117 | } |
103 | Tools::logm('The new user ' . $newUsername . ' has been installed'); | 118 | Tools::logm('The new user ' . $newUsername . ' has been installed'); |
104 | $this->messages->add('s', sprintf(_('The new user %s has been installed. Do you want to <a href="?logout">logout ?</a>'), $newUsername)); | 119 | $this->messages->add('s', sprintf(_('The new user %s has been installed. Do you want to <a href="?logout">logout ?</a>'), $newUsername)); |
105 | Tools::redirect(); | 120 | 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 @@ | |||
59 | @define ('MOBI', FALSE); | 59 | @define ('MOBI', FALSE); |
60 | @define ('PDF', FALSE); | 60 | @define ('PDF', FALSE); |
61 | 61 | ||
62 | // registration | ||
63 | @define ('SEND_CONFIRMATION_EMAIL', TRUE); | ||
64 | |||
62 | // display or not print link in article view | 65 | // display or not print link in article view |
63 | @define ('SHOW_PRINTLINK', '1'); | 66 | @define ('SHOW_PRINTLINK', '1'); |
64 | // display or not percent of read in article view. Affects only default theme. | 67 | // 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 --- a/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.mo +++ b/locale/en_US.utf8/LC_MESSAGES/en_US.utf8.mo | |||
Binary files 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" | |||
663 | msgid "Download the articles from this category in an epub" | 663 | msgid "Download the articles from this category in an epub" |
664 | msgstr "Download the articles from this category in an EPUB" | 664 | msgstr "Download the articles from this category in an EPUB" |
665 | 665 | ||
666 | # registration | ||
667 | msgid "Hi," | ||
668 | msgstr "Hi," | ||
669 | |||
670 | msgid "Hi, %1$s" | ||
671 | msgstr "Hi, %1$s" | ||
672 | |||
673 | msgid "Someone just created a wallabag account for you on %1$s." | ||
674 | msgstr "Someone just created a wallabag account for you on %1$s." | ||
675 | |||
676 | msgid "Your login is %1$s." | ||
677 | msgstr "Your login is %1$s." | ||
678 | |||
679 | msgid "Have fun with it !" | ||
680 | msgstr "Have fun with it !" | ||
681 | |||
682 | msgid "" | ||
683 | "This is an automatically generated message, no one will answer if you " | ||
684 | "respond to it." | ||
685 | msgstr "" | ||
686 | "This is an automatically generated message, no one will answer if you " | ||
687 | "respond to it." | ||
688 | |||
689 | msgid "" | ||
690 | "Note : The password has been chosen by the person who created your account. " | ||
691 | "Get in touch with that person to know your password and change it as soon as " | ||
692 | "possible" | ||
693 | msgstr "" | ||
694 | "Note : The password has been chosen by the person who created your account. " | ||
695 | "Get in touch with that person to know your password and change it as soon as " | ||
696 | "possible" | ||
697 | |||
698 | msgid "" | ||
699 | "The new user %1$s has been sent an email at %2$s. You may have to check spam " | ||
700 | "folder." | ||
701 | msgstr "" | ||
702 | "The new user %1$s has been sent an email at %2$s. You may have to check spam " | ||
703 | "folder." | ||
704 | |||
705 | msgid "A problem has been encountered while sending the confirmation email" | ||
706 | msgstr "A problem has been encountered while sending an confirmation email" | ||
707 | |||
708 | msgid "The server did not authorize sending a confirmation email" | ||
709 | msgstr "The server did not authorize sending a confirmation email" | ||
710 | |||
711 | msgid "" | ||
712 | "The user was created, but no email was sent because email was not filled in" | ||
713 | msgstr "" | ||
714 | "The user was created, but no email was sent because email was not filled in" | ||
715 | |||
666 | #~ msgid "poche it!" | 716 | #~ msgid "poche it!" |
667 | #~ msgstr "poche it!" | 717 | #~ msgstr "poche it!" |
668 | 718 | ||
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 --- a/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo +++ b/locale/fr_FR.utf8/LC_MESSAGES/fr_FR.utf8.mo | |||
Binary files 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 "" | |||
789 | msgid "Produced by wallabag with PHPMobi" | 789 | msgid "Produced by wallabag with PHPMobi" |
790 | msgstr "Produit par wallabag avec PHPMobi" | 790 | msgstr "Produit par wallabag avec PHPMobi" |
791 | 791 | ||
792 | # registration | ||
793 | msgid "Hi," | ||
794 | msgstr "Salut," | ||
795 | |||
796 | msgid "Hi, %1$s" | ||
797 | msgstr "Salut, %1$s" | ||
798 | |||
799 | msgid "Someone just created a wallabag account for you on %1$s." | ||
800 | msgstr "" | ||
801 | "Quelqu'un vient juste de créer un compte wallabag pour vous à l'adresse %1$s." | ||
802 | |||
803 | msgid "Your login is %1$s." | ||
804 | msgstr "Votre identifiant is %1$s." | ||
805 | |||
806 | msgid "Have fun with it !" | ||
807 | msgstr "Amusez-vous bien !" | ||
808 | |||
809 | msgid "" | ||
810 | "This is an automatically generated message, no one will answer if you " | ||
811 | "respond to it." | ||
812 | msgstr "" | ||
813 | "Ceci est un message généré automatiquement, personne ne vous répondra si " | ||
814 | "vous y répondez." | ||
815 | |||
816 | msgid "" | ||
817 | "Note : The password has been chosen by the person who created your account. " | ||
818 | "Get in touch with that person to know your password and change it as soon as " | ||
819 | "possible" | ||
820 | msgstr "" | ||
821 | "Note : Votre mot de passe a été défini par la personne ayant créé votre " | ||
822 | "compte. Vous devriez entrer en contact avec cette personne pour connaître " | ||
823 | "votre mot de passe et le changer dès que possible" | ||
824 | |||
825 | msgid "" | ||
826 | "The new user %1$s has been sent an email at %2$s. You may have to check spam " | ||
827 | "folder." | ||
828 | msgstr "" | ||
829 | "Un email a été envoyé au nouvel utiliateur %1$s à l'adresse %2$s. Il peut " | ||
830 | "être nécessaire de vérifier le dossier des spams." | ||
831 | |||
832 | msgid "A problem has been encountered while sending the confirmation email" | ||
833 | msgstr "Un problème a été rencontré lors de l'envoi de l'email de confirmation" | ||
834 | |||
835 | msgid "The server did not authorize sending a confirmation email" | ||
836 | msgstr "Le serveur n'autorise pas l'envoi d'un email de confirmation" | ||
837 | |||
838 | msgid "" | ||
839 | "The user was created, but no email was sent because email was not filled in" | ||
840 | msgstr "" | ||
841 | "L'utilisateur a été créé, mais aucun mail n'a été envoyé car l'email n'était " | ||
842 | "pas renseigné" | ||
843 | |||
792 | msgid "Mail function is disabled. You can't send emails from your server" | 844 | msgid "Mail function is disabled. You can't send emails from your server" |
793 | msgstr "" | 845 | msgstr "" |
794 | "La fonction mail est désactivée. Vous ne pouvez pas envoyer d'E-mails depuis " | 846 | "La fonction mail est désactivée. Vous ne pouvez pas envoyer d'E-mails depuis " |