forked from yunasc/tbdev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemail-gateway.php
More file actions
92 lines (78 loc) · 4.48 KB
/
Copy pathemail-gateway.php
File metadata and controls
92 lines (78 loc) · 4.48 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?
/*
// +--------------------------------------------------------------------------+
// | 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 "include/bittorrent.php";
dbconn();
$id = intval($_GET["id"]);
if (!$id)
stderr($tracker_lang['error'], $tracker_lang['invalid_id']);
$res = sql_query("SELECT username, class, email FROM users WHERE id=$id");
$arr = mysql_fetch_assoc($res) or stderr($tracker_lang['error'], "Íåò òàêîãî ïîëüçîâàòåëÿ.");
$username = $arr["username"];
if ($arr["class"] < UC_MODERATOR)
stderr($tracker_lang['error'], $tracker_lang['access_denied']);
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$to = $arr["email"];
$from = substr(trim($_POST["from"]), 0, 80);
if ($from == "") $from = "Àíîíèìíî";
$from_email = substr(trim($_POST["from_email"]), 0, 80);
if ($from_email == "") $from_email = $SITEEMAIL;
if (!strpos($from_email, "@")) stderr($tracker_lang['error'], "Ââåäåíûé e-mail àäðåñ íå ïîõîæ íà âåðíûé.");
$from = "$from <$from_email>";
$subject = substr(trim($_POST["subject"]), 0, 80);
if ($subject == "") $subject = "(Áåç òåìû)";
$subject = "Fwd: $subject";
$message = trim($_POST["message"]);
if ($message == "") stderr($tracker_lang['error'], "Âû íå ââåëè ñîîáùåíèå!");
$message = "Ñîîáùåíèå îòïðàâëåíî ñ IP àäðåñà $_SERVER[REMOTE_ADDR] â " . date("Y-m-d H:i:s") . " GMT.\n" .
"Âíèìàíèå: Îòâå÷àÿ íà ýòî ïèñüìî, âû ðàñêðîåòå âàì e-mail àäðåñ.\n" .
"---------------------------------------------------------------------\n\n" .
$message . "\n\n" .
"---------------------------------------------------------------------\n$SITENAME E-Mail Øëþç\n";
$success = @mail($to, $subject, $message, "From: $from", "-f$SITEEMAIL");
if ($success)
stderr($tracker_lang['success'], "E-mail óñïåøíî îòïðàâëåí.");
else
stderr($tracker_lang['error'], "Ïèñüìî íå ìîæåò áûòü îòïðàâëåíî. Ïîæàëóéñòà, ïîïðîáóéòå ïîçæå.");
}
stdhead("E-mail øëþç");
?>
<table border=1 cellspacing=0 cellpadding=5>
<tr><td class=colhead colspan=2>Îòïðàâèòü e-mail ïîëüçîâàòåëþ <?=$username;?></td></tr>
<form method=post action=email-gateway.php?id=<?=$id?>>
<tr><td class=rowhead>Âàøå èìÿ</td><td><input type=text name=from size=80></td></tr>
<tr><td class=rowhead>Âàø e-mail</td><td><input type=text name=from_email size=80></td></tr>
<tr><td class=rowhead>Òåìà</td><td><input type=text name=subject size=80></td></tr>
<tr><td class=rowhead>Ñîîáùåíèå</td><td><textarea name=message cols=80 rows=20></textarea></td></tr>
<tr><td colspan=2 align=center><input type=submit value="Send" class=btn></td></tr>
</form>
</table>
<p>
<font class=small><b>Âíèìàíèå:</b> Âàø IP-àäðåñ áóäåò çàïèñàí è áóäåò âèäåí ïîëó÷àòåëþ, äëÿ ïðåäîòâðàùåíèÿ îáìàíà.<br />
Óáåäèòåñü ÷òî âû ââåëè ïðàâèëüíûé e-mail àäðåñ åñëè âû îæèäàåòå îòâåòà.</font>
</p>
<? stdfoot(); ?>