[PLUGINS] ~maj des plugins
[lhc/web/www.git] / www / plugins / nospam / nospam / verifier_formulaire_forum.php
index 7edc683..853b4d3 100644 (file)
@@ -49,6 +49,38 @@ function nospam_verifier_formulaire_forum_dist($flux){
                        }
                }
 
+               // on prend en compte la checkbox de confirmation
+               // si le flag en session est bien leve
+               if (_request('notabuse')){
+                       session_start();
+                       if ($_SESSION['notabuse_check']){
+                               unset($_SESSION['notabuse_check']);
+                               $_SESSION['notabuse_checked'] = true;
+                               // on leve une globale pour la fin de ce hit, a toute fin utile (puisque plus rien en $_SESSION)
+                               $GLOBALS['notabuse_checked'] = true;
+                       }
+               }
+               if (!count($flux['data'])){
+                       if (nospam_check_ip_status($GLOBALS['ip'])!=='ok'){
+                               session_start();
+                               if ($_SESSION['notabuse_checked']){
+                                       // ok on retire de la session le check qui ne sert qu'une fois
+                                       unset($_SESSION['notabuse_checked']);
+                                       // et on laisse passer
+                               }
+                               else {
+                                       $flux['data']['texte'] = _T('nospam:info_ip_suspecte')."<br />
+                                       <span class='choix'>
+                                       <input type='checkbox' name='notabuse' value='1' id='notabuse'/> <label for='notabuse'>"
+                                       ._T('nospam:label_message_licite')."</label>
+                                       </span>";
+                                       $_SESSION['notabuse_check'] = true;
+                                       spip_log("notabuse_check sur IP ".$GLOBALS['ip'],"nospam");
+                               }
+                       }
+               }
+
+
                if (isset($flux['data']['texte']))
                        unset($flux['data']['previsu']);
        }