source: spip-zone/_plugins_/mailsuscribers/mailsubscribers_fonctions.php @ 67853

Last change on this file since 67853 was 67853, checked in by cedric@…, 7 years ago

Un seul b vous manque et tout est ancal (bennyb)

(pas de gestion de l'upgrade de base sur ce commit où tout est renommé : les eventuels testeurs de ce plugin très en chantier doivent desinstaller, upgrader le plugin, puis reinstaller)

File size: 1.1 KB
Line 
1<?php
2/**
3 * Plugin mailsubscribers
4 * (c) 2012 Cédric Morin
5 * Licence GNU/GPL v3
6 */
7
8if (!defined('_ECRIRE_INC_VERSION')) return;
9
10
11function mailsubscriber_cle_action($action,$email,$jeton){
12        $arg = "$action-$email-$jeton";
13        include_spip("inc/securiser_action");
14        $hash = calculer_cle_action($arg);
15        return $hash;
16}
17
18function mailsubscriber_url_subscribe($email,$jeton,$sep="&amp;"){
19        $url = generer_url_action("subscribe_mailsubscriber","email=".urlencode($email),false,true);
20        $url = parametre_url($url,"arg",mailsubscriber_cle_action("subscribe",$email,$jeton),$sep);
21        return $url;
22}
23
24function mailsubscriber_url_unsubscribe($email,$jeton,$sep="&amp;"){
25        $url = generer_url_action("unsubscribe_mailsubscriber","email=".urlencode($email),false,true);
26        $url = parametre_url($url,"arg",mailsubscriber_cle_action("unsubscribe",$email,$jeton),$sep);
27        return $url;
28}
29
30function mailsubscriber_url_confirm($email,$jeton,$sep="&amp;"){
31        $url = generer_url_action("confirm_mailsubscriber","email=".urlencode($email),false,true);
32        $url = parametre_url($url,"arg",mailsubscriber_cle_action("confirm",$email,$jeton),$sep);
33        return $url;
34}
35
36?>
Note: See TracBrowser for help on using the repository browser.