Show server error message if posting failed...
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Sun, 16 Jul 2006 15:46:36 +0000 (15:46 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:35:03 +0000 (00:35 +0100)
Very useful to know what to change

git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@117 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/banana.inc.php.in
css/style.css

index 362dbc4..5836172 100644 (file)
@@ -352,6 +352,9 @@ class Banana
                                 $this->post->headers['followup-to'] : $this->post->headers['newsgroups'];
                 $followup = null;
             }
+        } else {
+            $subject = $target = $followup = null;
+            $body = $this->profile['sig'] ? "\n\n-- \n". $this->profile['sig'] : '';
         }
 
         $this->nntp->quit();
@@ -373,7 +376,7 @@ class Banana
                . '<td>' . $this->profile['org'] . '</td></tr>'
                . '<tr><th colspan="2">' . _b_('Corps') . '</th></tr>'
                . '<tr><td colspan="2"><textarea name="body" cols="74" rows="16">'
-               .  to_entities($body) . '</textarea></td></tr>';
+               .  $body . '</textarea></td></tr>';
         if ($this->can_attach) {
             $html .= '<tr><th colspan="2">' . _b_('Pièce jointe') . '</th></tr>'
                   . '<tr><td colspan="2">'
@@ -475,7 +478,8 @@ class Banana
             }
             redirectInBanana($dir);
         } else {
-            return '<p class="error">' . _b_('Impossible de poster le message') . '</p>'
+            return '<p class="error">' . _b_('Impossible de poster le message. Le serveur a retourné l\'erreur :') . '</p>'
+                   . '<pre class="error">' . utf8_encode($this->nntp->lasterrortext) .'</pre>'
                    . $this->action_newFup($group, $artid);
         }
     }
index 9b48a5c..4afdc31 100644 (file)
@@ -78,4 +78,9 @@ table.banana_msg blockquote blockquote blockquote {
 
 div.center { text-align: center; padding: 1em; }
 p.error { color: red; background: inherit; }
+pre.error {
+    color: red;
+    margin-left: 2em;
+    font-size: 90%;
+}