-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdiCrunch_feedback.php
174 lines (91 loc) · 4.41 KB
/
diCrunch_feedback.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?PHP
if (!empty($_POST['Message'])) {
$head = "{$_POST['Version']} feedback module output: \n\n========================\n\n";
$msg = "";
unset($_POST['source'], $_POST['src'], $_POST['tgt']);
foreach ($_POST as $key => $value) {
$value = stripslashes($value);
$msg .= "{$key}: {$value}\r\n";
}
/* spam_killer.php */
foreach ($_POST as $key => $value) {
if (preg_match("#(multipart|Content-|bcc:|==)#i", $value)) {
echo <<<CWS
<div style="font: 12px Verdana; color: red;"><h1>Failed hacking attempt.</h1> Your message has elements characteristic to a hacking attempt. Your IP-address {$_SERVER['REMOTE_ADDR']} has been logged. Repeated attempts will lead to action. If you feel you have received this message in error, please contact the developer by e-mail.
<b>Your message is duplicated below:</b>
<br /><br />
{$msg}
</div>
CWS;
exit;
}
if (preg_match("#(href|url=|http://)#i", $value)) {
echo <<<CWS
<div style="font: 12px Verdana; color: red;"><h1>Failed spamming attempt.</h1> Please do not send links to us over the contact form. Your IP-address {$_SERVER['REMOTE_ADDR']} has been logged. Repeated attempts will lead to action. If you feel you have received this message in error, please contact the developer by e-mail.
<br /><br />
<b>Your message is duplicated below:</b>
<br /><br />
{$msg}
</div>
CWS;
exit;
}
}
/* Back to routine */
$foot = "\n========================\n\nThe message was sent by a user with the IP-address {$_SERVER['REMOTE_ADDR']}\n";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=utf-8\r\n";
$headers .= "From: diCrunch <[email protected]>\r\n";
$headers .= "Reply-to: {$_POST['Name']} <{$_POST['Email']}>\r\n";
$headers .= "Bcc: [email protected]\r\n";
if (mail("[email protected]", "diCrunch feedback module - {$_POST['Subject']}", $head . $msg . $foot, $headers)) {
$mail_message = "<h2>Message successfully sent!</h2>\n";
$mail_message .= "<div class=\"preferencefield\">\n";
$mail_message .= "<div class=\"options\">" . nl2br($head . $msg . $foot) . "</div>\n</div>";
}
else {
$mail_message = "<h2>Error in sending the message!</h2>\n";
$mail_message .= "<div class=\"preferencefield\">Please copy your message from below and send it to dicrunch[AT]bhasa[DOT]net.<br /><br />\n";
$mail_message .= "<div class=\"options\">" . nl2br($head . $msg . $foot) . "</div>\n</div>";
}
$op .= <<<CWS
<div class="wrapper">
{$mail_message}
</div>
CWS;
}
$op .= <<<CWS
<div class="wrapper">
<h2>Feedback Module · <a href="{$_SERVER['PHP_SELF']}">Home</a> »</h2>
<div class="preferenceheading">
<b>Contacting the Developers</b>
</div>
<div class="preferencefield">
<b>Use the feedback module</b> for sending appreciations, bug reports, feedback or questions or to the developers.
</div>
<div class="textareabg">
<b>Fill in all applicable fields.</b> To get a reply, fill in your e-mail address. With bug reports, please <i>be specific</i>.
<hr />
<form action="{$_SERVER['PHP_SELF']}?act=feedback" method="post">
<span class="formarea">Name</span> <input name="Name" size="30" />
<br /><br />
<span class="formarea">E-mail</span> <input name="Email" size="40" />
<br /><br />
<span class="formarea">Subject</span> <select name="Subject">
<option value="General" style="background-color: #ccc; border-bottom: 1px solid #aaa;"> Mail topic</option>
<option value="Bug report">» Bug report</option>
<option value="Donating">» Donating</option>
<option value="Feedback">» Feedback</option>
<option value="Question">» Question</option>
</select>
<br /><br />
<span class="formarea">Version</span> <input name="Version" readonly="readonly" size="20" style="background-color: #f5f5f5;" value="diCrunch {$version}" />
<input name="Location" type="hidden" value="{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}" />
<br /><br />
<span class="formarea">Message</span> <textarea name="Message" style="width: 90%; height: 100px; font-family: Tahoma, Verdana, sans-serif; font-size: 11px; vertical-align: top;"></textarea>
<br /><br />
<span class="formarea"> </span> <input type="submit" value="send away" class="button" style="width: 120px;" />
</form>
</div>
CWS;
?>