source: spip-zone/_plugins_/mailsubscribers/trunk/action/confirm_mailsubscriber.php @ 69533

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

Certains fichiers PHP n'étaient pas en UTF-8

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
11/**
12 * Confirmer l'inscription d'un email deja en base
13 * (appelle lors du double-optin : delegue a subscribe le changement de statut en valide)
14 *
15 * @param string $email
16 */
17function action_confirm_mailsubscriber_dist($email=null){
18        include_spip('mailsubscribers_fonctions');
19        if (is_null($email)){
20                $email = _request('email');
21                $arg = _request('arg');
22                $row = sql_fetsel('id_mailsubscriber,email,jeton,lang,statut','spip_mailsubscribers','email='.sql_quote($email));
23                if (!$row
24                        OR $arg!==mailsubscriber_cle_action("confirm",$row['email'],$row['jeton'])){
25                        $row = false;
26                }
27        }
28        else {
29                $row = sql_fetsel('id_mailsubscriber,email,jeton,statut','spip_mailsubscribers','email='.sql_quote($email));
30        }
31        if (!$row){
32                include_spip('inc/minipres');
33                echo minipres();
34                exit;
35        }
36
37        // il suffit de rejouer subscribe en forcant le simple-optin
38        $subscribe_mailsubscriber = charger_fonction("subscribe_mailsubscriber","action");
39        $subscribe_mailsubscriber($email,false);
40
41}
Note: See TracBrowser for help on using the repository browser.