This repository was archived by the owner on May 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdesabonnement.php
More file actions
67 lines (57 loc) · 2.16 KB
/
desabonnement.php
File metadata and controls
67 lines (57 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
$ajoutCommentaires = FALSE;
$desactiverCache = TRUE;
$desactiverCachePartiel = TRUE;
$infosPublication = FALSE;
$licence = '';
$lienPage = FALSE;
$partageCourriel = FALSE;
$partageReseaux = FALSE;
$robots = 'noindex, nofollow, noarchive';
include 'inc/premier.inc.php';
$courrielDesabonnement = '';
$urlDesabonnement = '';
$abonnementTrouve = FALSE;
$desabonnementReussi = FALSE;
if (!empty($_GET['url']) && !empty($_GET['id']))
{
$urlDesabonnement = $urlRacine . '/' . supprimeUrlRacine($urlRacine, decodeTexteGet($_GET['url']));
$cheminConfigCommentaires = cheminConfigCommentaires($racine, $urlRacine, $urlDesabonnement, TRUE);
$cheminConfigAbonnementsCommentaires = cheminConfigAbonnementsCommentaires($cheminConfigCommentaires);
$listeAbonnements = super_parse_ini_file($cheminConfigAbonnementsCommentaires, TRUE);
if (!empty($listeAbonnements))
{
$contenuConfigAbonnements = '';
foreach ($listeAbonnements as $courrielAbonnement => $infosAbonnement)
{
if (!empty($infosAbonnement['idAbonnement']) && $infosAbonnement['idAbonnement'] == $_GET['id'])
{
$abonnementTrouve = TRUE;
$courrielDesabonnement = $courrielAbonnement;
}
else
{
$contenuConfigAbonnements .= "[$courrielAbonnement]\n";
foreach ($infosAbonnement as $cle => $valeur)
{
$contenuConfigAbonnements .= "$cle=$valeur\n";
}
$contenuConfigAbonnements .= "\n";
}
}
if ($abonnementTrouve && @file_put_contents($cheminConfigAbonnementsCommentaires, $contenuConfigAbonnements, LOCK_EX) !== FALSE)
{
$desabonnementReussi = TRUE;
}
}
}
if ($desabonnementReussi)
{
echo '<p>' . sprintf(T_("Le désabonnement a été effectué pour le courriel %1\$s à l'adresse %2\$s."), '<code>' . securiseTexte($courrielDesabonnement) . '</code>', '<code>' . securiseTexte($urlDesabonnement) . '</code>') . "</p>\n";
}
else
{
echo '<p class="erreur">' . T_("Le désabonnement n'a pu être effectué. Veuillez vérifier votre URL de désabonnement dans le courriel de notification reçu. Si le problème persiste, vous pouvez faire la demande de désabonnement par le formulaire de contact du site.") . "</p>\n";
}
include $racine . '/inc/dernier.inc.php';
?>