-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathws_email.php
More file actions
71 lines (59 loc) · 2.23 KB
/
ws_email.php
File metadata and controls
71 lines (59 loc) · 2.23 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
68
69
70
71
<?php
error_reporting(E_ERROR | E_PARSE);
class Email
{
public $destinataire = "";
public $emetteur = "no-reply@assoedc.com";
public $objet = "";
public $message = "";
public function __construct()
{
}
private function GetHeader()
{
$texte = "";
return $texte;
}
private function GetFooter()
{
$texte = "";
return $texte;
}
public function Send()
{
if ($this->objet == "") {
die("Pas d'objet dans le mail");
}
if ($this->message == "") {
die("Pas de message dans le mail");
}
if ($this->destinataire == "") {
die("Pas de destinataire");
}
$this->message = $this->GetHeader() . $this->message . $this->GetFooter();
$url = 'https://www.assoedc.com/wp-content/plugins/edc_adherent/sendMail.php';
$data = array('email' => json_encode($this));
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data),
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
}
}
$e = new Email();
$e->destinataire = $_GET['email'];
$e->objet = "EDC - Renouvellement du mot de passe";
$e->message = "Bonjour,<br /><br />";
$e->message .= "Quelqu'un a demandé le renouvellement de son mot de passe pour le compte suivant :<br /><br />
<a href=\"https://www.assoedc.com/\">https://www.assoedc.com/</a><br /><br />
Identifiant : " . $user_login . "<br /><br />
S'il s'agit d'une erreur, ignorez ce message et la demande ne sera pas prise en compte.<br /><br />
Pour renouveler votre mot de passe, cliquez sur le lien suivant :<br /><br />
<a href=\"https://www.assoedc.com/adherent-mot-de-passe_oublie/?key=" . md5($user_login . date('md') . 'qRV~uo}l-oXu;g:Mb{O@uy0|ofZWr`3*hV^H~`)%;Ke-yOR(vh3{e`&G$10`+`&:') . "&login=" . $user_login . "&p=1\">https://www.assoedc.com/adherent-mot-de-passe_oublie/?key=" . md5($user_login . date('md') . 'qRV~uo}l-oXu;g:Mb{O@uy0|ofZWr`3*hV^H~`)%;Ke-yOR(vh3{e`&G$10`+`&:') . "&login=" . $user_login . "&p=1</a>";
$e->Send();
$response = array('statut' => 'OK', 'message' => '');
echo json_encode($response);