All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Goirand <thomas@goirand.fr>
To: mlmmj@mlmmj.org
Subject: Re: Web based moderation system for MLMMJ
Date: Wed, 04 Mar 2009 23:38:27 +0000	[thread overview]
Message-ID: <49AF10F3.10106@goirand.fr> (raw)
In-Reply-To: <498C406B.9070200@goirand.fr>

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

Morten K. Poulsen wrote:
> Thanks for the code - I've committed it to CVS, and it will be included
> in the next release of mlmmj :)

Cheers!

> For the impatient souls out there, it can also be downloaded from
> http://mlmmj.mmj.dk/~mortenp/mlmmj-php-moderation-cvs20090304.tar.bz2
> 
> There is a few notices. Could you take care of them? It's not urgent.

Outch! I normally work with error reporting E_ALL, my bad...

By the way, I did it right away, because otherwise I will forget.

> These can only be provoked by a malformed mail, but it would be nice to
> get rid of them anyway:

I didn't even think a mail could ever be sent with no From:, Date: or
such header. How nasty can it be that a mail server is accepting such
email? :(

Attached is a diff to apply. It seems you missed my README, can you
re-add it in the folder? The notes are quite important for the setup,
especially the things about the .htaccess. Also, why the .htaccess in
the translation folder has been renamed to dot.htaccess? Is that because
you are using CVS? To me, it would be wise to switch to Git. You would
never regret it!!!

Thomas


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mlmmj-web-moderation.diff --]
[-- Type: text/x-diff; name="mlmmj-web-moderation.diff", Size: 5627 bytes --]

diff -u -r mlmmj.orig/contrib/web/php-moderation/mlmmj-moderation.php mlmmj/contrib/web/php-moderation/mlmmj-moderation.php
--- mlmmj.orig/contrib/web/php-moderation/mlmmj-moderation.php	2009-02-08 20:43:11.000000000 +0800
+++ mlmmj/contrib/web/php-moderation/mlmmj-moderation.php	2009-03-05 07:25:14.000000000 +0800
@@ -151,14 +151,24 @@
 		}
 		$out .= "<tr>";
 		$out .= "<td $cls>" . "<input type=\"checkbox\" name=\"msg_id[]\" value=\"". $all_msg[$i]["filename"] ."\">" . "</td>";
-		$out .= "<td $cls>" . htmlspecialchars($all_msg[$i]["headers"]["date"]) . "</td>";
-		if( strlen($all_msg[$i]["headers"]["subject"]) == 0){
+		if( isset($all_msg[$i]["headers"]["date"]) ){
+			$mydate = htmlspecialchars($all_msg[$i]["headers"]["date"]);
+		}else{
+			$mydate = _("No date");
+		}
+		$out .= "<td $cls>" . $mydate . "</td>";
+		if( !isset($all_msg[$i]["headers"]["subject"]) || strlen($all_msg[$i]["headers"]["subject"]) == 0){
 			$subject = _("No subject");
 		}else{
 			$subject = $all_msg[$i]["headers"]["subject"];
 		}
 		$out .= "<td $cls><a href=\"". $_SERVER["PHP_SELF"] ."?action=show_message&msgid=". $all_msg[$i]["filename"] ."\">" . htmlspecialchars($subject) . "</a></td>";
-		$out .= "<td $cls>" . htmlspecialchars($all_msg[$i]["headers"]["from"]) . "</td>";
+		if( isset($all_msg[$i]["headers"]["from"]) ){
+			$myfrom = htmlspecialchars($all_msg[$i]["headers"]["from"]);
+		}else{
+			$myfrom = _("No from in headers");
+		}
+		$out .= "<td $cls>" . $myfrom . "</td>";
 		$out .= "</tr>\n";
 	}
 	$out .= "</table>\n";
@@ -234,7 +244,7 @@
 <h3>MLMMJ "._("moderation web interface")."</h3>
 <a href=\"".$_SERVER["PHP_SELF"]."\">"._("Refresh page")."</a>";
 
-if( isset($_REQUEST["action"]) && $_REQUEST["action"] == show_message){
+if( isset($_REQUEST["action"]) && $_REQUEST["action"] == "show_message"){
 	if( !ereg("^([0-9a-f]+)\$",$_REQUEST["msgid"]) ){
 		echo "<span class=\"errorMessages\">"._("Message ID format is wrong: can't display!")."</span>";
 	}else{
diff -u -r mlmmj.orig/contrib/web/php-moderation/translations/fr_FR.po mlmmj/contrib/web/php-moderation/translations/fr_FR.po
--- mlmmj.orig/contrib/web/php-moderation/translations/fr_FR.po	2009-02-08 19:46:34.000000000 +0800
+++ mlmmj/contrib/web/php-moderation/translations/fr_FR.po	2009-03-05 07:29:30.000000000 +0800
@@ -7,15 +7,15 @@
 msgstr ""
 "Project-Id-Version: 0.1\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-02-08 11:46+0000\n"
-"PO-Revision-Date: 2009-02-08 11:15+0000\n"
+"POT-Creation-Date: 2009-03-05 07:25+0800\n"
+"PO-Revision-Date: 2009-03-05 07:29+0800\n"
 "Last-Translator: Thomas Goirand <thomas@goirand.fr>\n"
 "Language-Team: Thomas Goirand <thomas@goirand.fr>\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: mlmmj-moderation.php:249
+#: mlmmj-moderation.php:259
 msgid "Back to messages list"
 msgstr "Retour a la liste des messages"
 
@@ -23,27 +23,27 @@
 msgid "Date"
 msgstr "Date"
 
-#: mlmmj-moderation.php:251
+#: mlmmj-moderation.php:261
 msgid "Date:"
 msgstr "Date :"
 
-#: mlmmj-moderation.php:167
+#: mlmmj-moderation.php:177
 msgid "Delete"
 msgstr "Effacer"
 
-#: mlmmj-moderation.php:246
+#: mlmmj-moderation.php:256
 msgid "Error: could not read"
 msgstr "Erreur: impossible de lire"
 
-#: mlmmj-moderation.php:165
+#: mlmmj-moderation.php:175
 msgid "For the selection:"
-msgstr "Pour la selection :"
+msgstr "Pour la sélection :"
 
 #: mlmmj-moderation.php:144
 msgid "From"
 msgstr "De"
 
-#: mlmmj-moderation.php:250
+#: mlmmj-moderation.php:260
 msgid "From:"
 msgstr "De:"
 
@@ -51,27 +51,35 @@
 msgid "Inverse selection"
 msgstr "Inverser la selection"
 
-#: mlmmj-moderation.php:239
+#: mlmmj-moderation.php:249
 msgid "Message ID format is wrong: can't display!"
 msgstr "Le format de l'ID du message est faux: affichage impossible !"
 
-#: mlmmj-moderation.php:254
+#: mlmmj-moderation.php:264
 msgid "Message body:"
 msgstr "Corp du message :"
 
-#: mlmmj-moderation.php:184
+#: mlmmj-moderation.php:194
 msgid "Moderation ID not found in the moderation folder!"
-msgstr "ID de moderation non trouve dans le dossier de moderation!"
+msgstr "ID de modération non trouve dans le dossier de modération!"
 
-#: mlmmj-moderation.php:174
+#: mlmmj-moderation.php:157
+msgid "No date"
+msgstr "Pas de date"
+
+#: mlmmj-moderation.php:169
+msgid "No from in headers"
+msgstr "Pas de from dans les entêtes"
+
+#: mlmmj-moderation.php:184
 msgid "No message selected!"
-msgstr "Pas de message selectionne !"
+msgstr "Pas de message sélectionné !"
 
-#: mlmmj-moderation.php:156
+#: mlmmj-moderation.php:161
 msgid "No subject"
 msgstr "Pas de sujet"
 
-#: mlmmj-moderation.php:235
+#: mlmmj-moderation.php:245
 msgid "Refresh page"
 msgstr "Rafraichir la page"
 
@@ -79,22 +87,23 @@
 msgid "Subject"
 msgstr "Sujet"
 
-#: mlmmj-moderation.php:253
+#: mlmmj-moderation.php:263
 msgid "Subject:"
 msgstr "Sujet :"
 
-#: mlmmj-moderation.php:252
+#: mlmmj-moderation.php:262
 msgid "To:"
 msgstr "Pour :"
 
-#: mlmmj-moderation.php:166
+#: mlmmj-moderation.php:176
 msgid "Validate"
 msgstr "Valider"
 
 #: mlmmj-moderation.php:122
 msgid "Warning: could not read"
-msgstr "Warning : impossible de lire"
+msgstr "Alerte : impossible de lire"
 
-#: mlmmj-moderation.php:234
+#: mlmmj-moderation.php:244
 msgid "moderation web interface"
 msgstr "interface web de moderation"
+
Only in mlmmj/contrib/web/php-moderation/translations: templates.pot

  parent reply	other threads:[~2009-03-04 23:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06 13:51 Web based moderation system for MLMMJ Thomas Goirand
2009-02-07  8:30 ` Mads Martin Joergensen
2009-02-07  9:17 ` Thomas Goirand
2009-02-07 10:46 ` Mads Martin Joergensen
2009-02-07 13:10 ` Thomas Goirand
2009-02-07 13:34 ` Mads Martin Joergensen
2009-02-07 13:43 ` Christian Laursen
2009-02-08 12:54 ` Thomas Goirand
2009-03-01  6:54 ` Thomas Goirand
2009-03-01 23:53 ` James Scott
2009-03-02  6:27 ` Thomas Goirand
2009-03-04 20:20 ` Morten K. Poulsen
2009-03-04 20:37 ` Morten K. Poulsen
2009-03-04 23:38 ` Thomas Goirand [this message]
2009-03-06 16:43 ` Morten K. Poulsen
2009-03-06 19:36 ` Thomas Goirand
2009-03-06 20:40 ` Morten K. Poulsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49AF10F3.10106@goirand.fr \
    --to=thomas@goirand.fr \
    --cc=mlmmj@mlmmj.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.