[PLUGINS] +set de base
[lhc/web/www.git] / www / plugins / notifications2 / notifications / petitionsignee.php
1 <?php
2 /*
3 * Plugin Notifications
4 * (c) 2009-2012 SPIP
5 * Distribue sous licence GPL
6 *
7 */
8
9 if (!defined("_ECRIRE_INC_VERSION")) return;
10
11 /**
12 * insertion d'une nouvelle signature => mail aux moderateurs
13 *
14 * @param string $quoi
15 * @param int $id_forum
16 */
17 function notifications_petitionsignee_dist($quoi, $id_signature, $options) {
18 if (!isset($GLOBALS['notifications']['moderateurs_signatures'])
19 OR !$GLOBALS['notifications']['moderateurs_signatures'])
20 return;
21
22 // creer la cle de suppression de la signature
23 // old style ...
24 // il faudrait passer par une action et une redirection
25 // ce qui necessite de pouvoir generer une action pour un autre auteur que celui connecte
26 // grml
27 include_spip('inc/securiser_action');
28 $cle = _action_auteur("supprimer signature $id_signature", '', '', 'alea_ephemere');
29
30 $envoyer_mail = charger_fonction('envoyer_mail','inc'); // pour nettoyer_titre_email
31 $texte = recuperer_fond("notifications/petition_signee",array('id_signature'=>$id_signature,'cle'=>$cle));
32
33 notifications_envoyer_mails($GLOBALS['notifications']['moderateurs_signatures'],$texte);
34 }
35 ?>