/
sendmail.php
80 lines (64 loc) · 3.14 KB
/
sendmail.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
<?php
// As of January 1st this project has changed CeresCP for
// my distrobution purposes. I have rewritten major componets
// to fit my needs of the software.
session_start();
include_once 'config.php'; // loads config variables
include_once 'query.php'; // imports queries
include_once 'functions.php';
if (check_ban())
redir("motd.php", "main_div", "Disabled");
if ($CONFIG_sendmail == 0) {
redir("motd.php", "main_div", "Character Mailing is Disabled");
}
if (isset($POST_opt)) {
if ($POST_opt == 1 && isset($POST_frm_name) && !strcmp($POST_frm_name, "sendmail")) {
$session = $_SESSION[$CONFIG_name.'sessioncode'];
if ($CONFIG_auth_image && function_exists("gd_info")
&& strtoupper($POST_code) != substr(strtoupper(md5("Mytext".$session['sendmail'])), 0,6))
alert($lang['INCORRECT_CODE']);
if (strlen($POST_title) < 3 )
alert("A better Title is needed");
$query = sprintf(SENDMAIL, $POST_send_name, $POST_dest_name, $POST_title, $POST_message);
$result = execute_query($query, 'sendmail.php');
redir("motd.php", "main_div", 'Mail Sent Successfully');
}
}
if (isset($_SESSION[$CONFIG_name.'sessioncode']))
$session = $_SESSION[$CONFIG_name.'sessioncode'];
$session['sendmail'] = rand(12345, 99999);
$_SESSION[$CONFIG_name.'sessioncode'] = $session;
$var = rand(10, 9999999);
opentable("In Game Character Mailing");
echo "<div style=\"width:490px;\">
<form id=\"sendmail\" onSubmit=\"return POST_ajax('sendmail.php','main_div','sendmail');\"><table>
<tr><td align=\"right\">Senders Name:</td><td align=\"left\">
<input type=\"text\" name=\"send_name\" maxlength=\"23\" size=\"23\" onKeyPress=\"return force(this.name,this.form.id,event);\">
</td></tr>
<tr><td align=\"right\">Receivers Name:</td><td align=\"left\">
<input type=text name=\"dest_name\" maxlength=\"23\" size=\"23\" onKeyPress=\"return force(this.name,this.form.id,event);\">
</td></tr>
<tr><td align=\"right\">Message Title:</td><td align=\"left\">
<input type=text name=\"title\" maxlength=\"23\" size=\"23\" onKeyPress=\"return force(this.name,this.form.id,event);\">
</td></tr>
<tr><td align=\"right\">Message:</td><td align=\"left\">
<textarea name=\"message\" rows=\"8\" cols=\"40\" onKeyPress=\"return force(this.name,this.form.id,event);\"></textarea>
<input type=\"hidden\" name=\"opt\" value=\"1\"></td></tr>";
if ($CONFIG_auth_image && function_exists("gd_info")) {
echo "<tr><td></td><td align=left><img src=\"img.php?img=sendmail&var=$var\" alt=\"".$lang['SECURITY_CODE']."\">
</td></tr><tr><td align=right>".$lang['CODE'].":</td>
<td align=\"left\">
<input type=\"text\" name=\"code\" maxlength=\"6\" size=\"6\" onKeyPress=\"return force(this.name,this.form.id,event);\">
</td></tr>";
}
echo "
<tr><td> </td><td><input type=\"submit\" name=\"send\" value=\"Send\"></td></tr>
</table></form>
";
echo "
<h1>Instructions</h1>
This is used as a substitute mailer for messages only. You must know how to spell the receivers name exactly as it appears in-game.<br>
This will not send items, zeny, or any combination of the 2. Use of this system is entirely up to the administrators who installed this.</div>";
closetable();
ending();
?>