Changeset 48115 in spip-zone
- Timestamp:
- May 25, 2011, 8:24:25 PM (10 years ago)
- Location:
- _plugins_/nospam
- Files:
-
- 1 added
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
_plugins_/nospam/nospam_pipelines.php
r43661 r48115 2 2 /** 3 3 * Plugin No-SPAM 4 * (c) 2008 Cedric Morin Yterium.net4 * (c) 2008-2011 Cedric Morin Yterium.net 5 5 * Licence GPL 6 6 * 7 7 */ 8 8 9 // pour verifier le nobot et le jeton sur un formulaire, l'ajouter a cette globale 10 $GLOBALS['formulaires_no_spam'][] = 'forum'; 11 $GLOBALS['formulaires_no_spam'][] = 'ecrire_auteur'; 12 $GLOBALS['formulaires_no_spam'][] = 'signature'; 13 9 /** 10 * Lister les formulaires a prendre en charge contre le SPAM 11 * pour verifier le nobot et le jeton sur un formulaire, l'ajouter a cette liste 12 * par le pipeline nospam_lister_formulaires 13 * @return void 14 */ 15 function nospam_lister_formulaires(){ 16 if (!isset($GLOBALS['formulaires_no_spam'])) 17 $GLOBALS['formulaires_no_spam'] = array(); 18 $formulaires = array_merge($GLOBALS['formulaires_no_spam'],array('forum','ecrire_auteur','signature')); 19 return pipeline('nospam_lister_formulaires',$formulaires); 20 } 14 21 15 22 /** … … 24 31 if (false !== $pos = strpos($fond, 'formulaires/')) { 25 32 $form = substr($fond, $pos + 12); 26 if (in_array($form, $GLOBALS['formulaires_no_spam'])){33 if (in_array($form, nospam_lister_formulaires())){ 27 34 // on ajoute le champ 'nobot' si pas present dans le formulaire 28 35 $texte = &$flux['data']['texte']; … … 45 52 function nospam_formulaire_charger($flux){ 46 53 $form = $flux['args']['form']; 47 if (in_array($form, $GLOBALS['formulaires_no_spam'])){54 if (in_array($form, nospam_lister_formulaires())){ 48 55 include_spip("inc/nospam"); 49 56 $jeton = creer_jeton($form); … … 61 68 function nospam_formulaire_verifier($flux){ 62 69 $form = $flux['args']['form']; 63 if (in_array($form, $GLOBALS['formulaires_no_spam'])){70 if (in_array($form, nospam_lister_formulaires())){ 64 71 include_spip("inc/nospam"); 65 72 $jeton = _request('_jeton'); -
_plugins_/nospam/plugin.xml
r44933 r48115 2 2 <nom>NoSPAM</nom> 3 3 <auteur>Cedric Morin pour [Yterium->www.yterium.net] + Superyms (Traduction)</auteur> 4 <icon>im g_pack/nospam.png</icon>4 <icon>images/nospam-32.png</icon> 5 5 <licence>(c) 2008 GPL</licence> 6 <version>0.8. 4</version>6 <version>0.8.5</version> 7 7 <etat>stable</etat> 8 8 <description><multi> … … 31 31 <inclure>nospam_pipelines.php</inclure> 32 32 </pipeline> 33 <pipeline> 34 <nom>nospam_lister_formulaires</nom> 35 <action></action> 36 </pipeline> 33 37 <categorie>performance</categorie> 34 <necessite id="SPIP" version="[2.0.0; ]" />38 <necessite id="SPIP" version="[2.0.0;3.1.0)" /> 35 39 </plugin>
Note: See TracChangeset
for help on using the changeset viewer.