forked from yunasc/tbdev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactus.php
140 lines (126 loc) · 5.23 KB
/
contactus.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
<?php
/*
// +--------------------------------------------------------------------------+
// | Project: TBDevYSE - TBDev Yuna Scatari Edition |
// +--------------------------------------------------------------------------+
// | This file is part of TBDevYSE. TBDevYSE is based on TBDev, |
// | originally by RedBeard of TorrentBits, extensively modified by |
// | Gartenzwerg. |
// | |
// | TBDevYSE is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or |
// | (at your option) any later version. |
// | |
// | TBDevYSE is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
// | GNU General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with TBDevYSE; if not, write to the Free Software Foundation, |
// | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +--------------------------------------------------------------------------+
// | Do not remove above lines! |
// +--------------------------------------------------------------------------+
*/
require_once('include/bittorrent.php');
dbconn();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($use_captcha) {
$b = get_row_count('captcha', 'WHERE imagehash = '.sqlesc($_POST['imagehash']).' AND imagestring = '.sqlesc($_POST['imagestring']));
sql_query('DELETE FROM captcha WHERE imagehash = '.sqlesc($_POST['imagehash'])) or die(mysql_error());
if ($b == 0)
stderr($tracker_lang['error'], 'Âû ââåëè íåïðàâèëüíûé êîä ïîäòâåðæäåíèÿ.');
}
if (!mkglobal('useremail:subject:message'))
stderr($tracker_lang['error'], 'Âû íå çàïîëíèëè âñå ïîëÿ ôîðìû! Âåðíèòåñü íàçàä è ïîïðîáóéòå åùå ðàç.');
if (!validemail($useremail))
stderr($tracker_lang['error'], 'Ýòî íå ïîõîæå íà ðåàëüíûé email àäðåñ.');
$ip = getip();
$username = $CURUSER['username'] ? $CURUSER['username'] : 'unregged';
if ($CURUSER)
$userid = $CURUSER['id'];
else
$userid = 0;
$body = <<<EOD
Ñîîáùåíèå ÷åðåç îáðàòíóþ ñâÿçü íà {$website_name}:
--------------------------------
$message
--------------------------------
IP Àäðåñ: {$ip}
Èìÿ ïîëüçîâàòåëÿ: {$username}
Êîä ïîëüçîâàòåëÿ: {$userid}
EOD;
stdhead();
if (sent_mail($admin_email, $useremail, $useremail, 'Îáðàòíàÿ ñâÿçü íà '.$website_name.' - ' . $subject, $body, false))
stdmsg('Óñïåøíî', 'Âàøå ñîîáùåíèå îòïðàâëåíî àäìèíèñòðàöèè.', 'success');
else
stdmsg('Îøèáêà', 'Âàøå ñîîáùåíèå <b>ÍÅ</b> áûëî îòïðàâëåíî àäìèíèñòðàöèè, èç-çà íåïðåäâèäåííîé îøèáêè ñåðâåðà.', 'error');
stdfoot();
} else {
stdhead('Ñâÿçàòüñÿ ñ íàìè');
if ($use_captcha) {
include_once("include/captcha.php");
$hash = create_captcha();
}
?>
<form method="post" name="contactus" action="contactus.php" onsubmit="document.contactus.cbutton.value='Ïîæàëóéñòà ïîäîæäèòå ...';document.contactus.cbutton.disabled=true">
<input type="hidden" name="do" value="process">
<table class="main" border="1" cellspacing="0" cellpadding="5" width="100%">
<tr>
<td align="left" class="colhead" colspan="2">
Ñâÿçàòüñÿ ñ íàìè
</td>
</tr>
<tr>
<td align="right" width="20%" valign="top">
<b>Âàø Email:</b>
</td>
<td align="left" width="80%" valign="top">
<input type="text" name="useremail" value="" size="30">
</td>
</tr>
<tr>
<td align="right" width="20%" valign="top">
<b>Òåìà:</b>
</td>
<td align="left" width="80%" valign="top">
<input type="text" name="subject" value="" size="30">
</td>
</tr>
<tr>
<td align="right" width="20%" valign="top">
<b>Ñîîáùåíèå:</b>
</td>
<td align="left" width="80%" valign="top">
<textarea name="message" cols="100" rows="10"></textarea>
</td>
</tr>
<? if ($use_captcha) { ?>
<tr>
<td align="right" width="20%" valign="top">
<b>Êîä áåçîïàñíîñòè:</b>
</td>
<td align="left" width="80%" valign="top">
<input type="text" name="imagestring" value="" size="30">
<p>Ïîæàëóéñòà, ââåäèòå òåêñò èçîáðàæåííûé íà êàðòèíêå âíèçó.<br />Ýòîò ïðîöåññ ïðåäîòâðàùàåò àâòîìàòè÷åñêóþ ðåãèñòðàöèþ.</p>
<img id="captcha" src="captcha.php?imagehash=<?=$hash; ?>" alt="Captcha" ondblclick="document.getElementById('captcha').src = 'captcha.php?imagehash=<?=$hash; ?>&' + Math.random();" /><br />
<font color="red">Êîä ÷óâñòâèòåëåí ê ðåãèñòðó</font><br />
Êëèêíèòå äâà ðàçà íà êàðòèíêå, ÷òî-áû îáíîâèòü êàðòèíêó.
<input type="hidden" name="imagehash" value="<?=$hash; ?>" />
</td>
</tr>
<? } ?>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Îòïðàâèòü" name="cbutton">
<input type="reset" value="Ñáðîñèòü">
</td>
</tr>
</table>
</form>
<?
stdfoot();
}
?>