-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathchallenge.php
43 lines (39 loc) · 918 Bytes
/
challenge.php
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
<?php
session_id($_GET["id"]);
session_start();
$message = "";
function sendEvent($title, $content){
global $message;
$rcv = array(
"OpenData" => "[email protected]", //[email protected]
"c3d2" => "[email protected]", //[email protected]
);
$to = $rcv[$_SESSION["type"]];
$header = "From: ".$_SESSION["mail"]."\r\nReply-To: ".$_SESSION["mail"]."\r\nX-Mailer: PHP/".phpversion();
if(mail($to, $title, $content, $header)){
$message = "Ihr Event wurde eingereicht.";
}else{
$message = "Es ist leider ein Fehler aufgetreten.";
}
}
$challenge = $_GET["code"];
if($challenge == $_SESSION["challenge"]){
sendEvent($_SESSION["title"], $_SESSION["xml"]);
}else{ /* todo:move formatting tags to the receiver or drop 'em */
$message = "Der Link ist ungültig.";
}
session_destroy();
?>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<p>
<?php
global $message;
echo $message;
?>
</p>
</body>
</html>