· 7 years ago · Apr 20, 2018, 02:44 PM
1<!-- Made with love by 16YELDARB -->
2<!-- https://www.spigotmc.org/members/16yeldarb.36673/ -->
3<!-- https://steamcommunity.com/id/16yeldarb/ -->
4
5<? include 'config.php'; ?>
6<? include 'PHPMailer\PHPMailer.php'; ?>
7<? include 'PHPMailer\SMTP.php'; ?>
8<? use PHPMailer\PHPMailer\PHPMailer; ?>
9<html>
10
11<head>
12 <meta name="viewport" content="width=device-width, initial-scale=1.0">
13 <title><?php echo $pagetitle;?></title>
14 <link href="assets/img/favicon-16x16.png" rel="icon" sizes="16x16" type="image/png">
15 <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet">
16 <link rel="stylesheet" href="assets/css/animate.css">
17 <link rel="stylesheet" type="text/css" href="assets/css/style.css">
18 <script src='https://www.google.com/recaptcha/api.js'></script>
19</head>
20
21<body>
22
23
24<div class="logocontainer">
25
26 <a href="<?php echo $logolink;?>"><img src="assets/img/logo.png" class="logo"/></a>
27
28</div>
29
30<?php
31
32include 'config.php';
33$version = 1.3;
34$versionget = file_get_contents('http://mcpluginsdev.com/spigotunbanversion.txt');
35
36$appealreplyheaders = "MIME-Version: 1.0" . "\r\n";
37$appealreplyheaders .= "Content-type:text/html;charset=UTF-8" . "\r\n";
38$appealreplyheaders .= "From: " . $sendfrom . "\r\n";
39
40if(isset($_GET["accept"])) {
41
42 if ($_GET['key'] == $replykey) {
43
44 echo "<div class='return' style='background-color:green'>Accepted appeal E-Mail sent.</div>";
45 mail($_GET["accept"],"Ban Appeal Accepted",$appealaccepted,$_GET["accept"]);
46
47 } else {
48
49 echo "<div class='return' style='background-color:red'>Admin key is incorrect</div>";
50
51 }
52
53
54} else if (isset($_GET["deny"])) {
55
56 if ($_GET['key'] == $replykey) {
57
58 echo "<div class='return' style='background-color:green'>Rejected appeal E-Mail sent.</div>";
59 send($_GET["deny"],"Ban Appeal Denied",$appealdenied,$_GET["deny"]);
60
61 } else {
62
63 echo "<div class='return' style='background-color:red'>Admin key is incorrect</div>";
64
65 }
66
67}
68
69//It is recommended you don't edit the below unless you're familiar with php
70//Below is the core code for the E-Mail/Form system
71
72function submittedForm($successnotice, $minecrafthead, $provideip, $providelocation, $providetime, $providedate, $version, $versionget, $sendto, $sendfrom, $sendconfirmation, $checkupdate, $confirmsubject, $confirmmsg, $replykey, $acceptbutton, $denybutton) {
73
74 $username = htmlspecialchars($_POST['username']);
75 $reason = htmlspecialchars($_POST['reason']);
76
77 $emailbodyextra = ""; //Here for later updates
78 $confirmmsgextra = "" . file_get_contents('http://mcpluginsdev.com/spigotunbanextra.txt'); //Here for later updates
79 $successextra = ""; //Here for later updates
80
81 echo $successnotice . $successextra;
82
83 $ip = $_SERVER['REMOTE_ADDR'];
84 $location = json_decode(file_get_contents("http://ipinfo.io/{$ip}"));
85
86 $headers = "MIME-Version: 1.0" . "\r\n";
87 $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
88 $headers .= "From: " . $_POST['email'] . "\r\n";
89
90 if ($minecrafthead == true){$emailimage = "<img src='https://cravatar.eu/helmhead/" . $username . "' width='90px'/><br>";}else{$emailimage = "";}
91 $emailbody = $emailimage . "<strong>" . $username . "</strong><br><br>Reason:<br>" . $reason . "<br><br>----------------------------------------";
92 $emailbody = str_replace("\n.", "\n..", $emailbody); //Security check
93
94 if ($provideip == true){$emailbody .= "<br><br><strong>IP Address:</strong> " . $ip;}
95 if ($providelocation == true){$emailbody .= "<br><strong>Location:</strong> " . $location->country;}
96 if ($providetime == true){$emailbody .= "<br><strong>Time Submitted:</strong> " . date("h:i:sa");}
97 if ($providedate == true){$emailbody .= "<br><strong>Date Submitted:</strong> " . date("Y/m/d");}
98 if (($version < $versionget) && $checkupdate == true) {$versionoutwarning = "<br><br><strong>Your current version of MC Ban Appeal is out of date!<br>Please get the new version here: <a href='https://goo.gl/Xjavfs'>https://goo.gl/Xjavfs</a>";}else{$versionoutwarning = "";}
99 if ($acceptbutton == true){$emailbody .= "<br><br><a href='http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "?accept=" . $_POST['email'] . "&key=" . $replykey . "'><img src='https://i.imgur.com/lm867A1.png' style='width: 114px; height: 29px;'/></a>";}
100 if ($denybutton == true){$emailbody .= " <a href='http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . "?deny=" . $_POST['email'] . "&key=" . $replykey . "'><img src='https://i.imgur.com/AlyMFBm.png'/></a>";}
101
102 send($sendto,"Unban Appeal",$emailbody . $versionoutwarning . $emailbodyextra,$username);
103
104 $confirmheaders = "MIME-Version: 1.0" . "\r\n";
105 $confirmheaders .= "Content-type:text/html;charset=UTF-8" . "\r\n";
106 $confirmheaders .= "From: " . $sendfrom . "\r\n";
107
108 if ($sendconfirmation == true){send($_POST['email'],$confirmsubject,$confirmmsg ,$username);}
109
110
111
112
113}
114function send($to,$title,$message,$username){
115 $mail = new PHPMailer();
116$mail->IsSMTP(); // telling the class to use SMTP
117
118// SMTP Configuration
119$mail->SMTPAuth = true; // enable SMTP authentication
120$mail->Host = ""; // SMTP server
121$mail->Username = "";
122$mail->Password = "";
123//$mail->Port = 465; // optional if you don't want to use the default
124
125$mail->From = "my@email.com";
126$mail->FromName = "My Name";
127$mail->Subject = $title;
128$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
129$mail->MsgHTML($message);
130
131// Add as many as you want
132$mail->AddAddress($to, $username);
133
134// If you want to attach a file, relative path to it
135//$mail->AddAttachment("images/phpmailer.gif"); // attachment
136
137$response= NULL;
138if(!$mail->Send()) {
139 $response = "Mailer Error: " . $mail->ErrorInfo;
140} else {
141 $response = "Message sent!";
142}
143
144
145
146
147}
148
149if(isset($_POST['submit'])){
150
151 if ($captcha == true) {
152
153 $sender_username = stripslashes($_POST["username"]);
154 $sender_email = stripslashes($_POST["email"]);
155 $sender_reason = stripslashes($_POST["reason"]);
156 $response = $_POST["g-recaptcha-response"];
157 $url = 'https://www.google.com/recaptcha/api/siteverify';
158 $data = array(
159 'secret' => $secretkey,
160 'response' => $_POST["g-recaptcha-response"]
161 );
162 $options = array(
163 'http' => array (
164 'header' => "Content-Type: application/x-www-form-urlencoded\r\n".
165 "User-Agent:MyAgent/1.0\r\n",
166 'method' => 'POST',
167 'content' => http_build_query($data)
168 )
169 );
170 $context = stream_context_create($options);
171 $verify = file_get_contents($url, false, $context);
172 $captcha_success=json_decode($verify);
173
174 if ($captcha_success->success==false) {
175
176 echo "<div class='return' style='background-color:red'>CAPTCHA Failed. <a href='index.php' style='color:white;'>Click to retry</a></div>";
177
178 } else if ($captcha_success->success==true) {
179
180 // Security / Valid Email Check
181 $email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
182
183 if ($email === FALSE) {
184
185 echo "<div class='return' style='background-color:red'>Invalid E-Mail. Failed to submit ban appeal. Click the back button to go back.</div>";
186
187 } else {
188
189 submittedForm($successnotice, $minecrafthead, $provideip, $providelocation, $providetime, $providedate, $version, $versionget, $sendto, $sendfrom, $sendconfirmation, $checkupdate, $confirmsubject, $confirmmsg, $replykey, $acceptbutton, $denybutton);
190
191 }
192 }
193 } else {
194
195 $email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
196
197 if ($email === FALSE) {
198
199 echo "<div class='return' style='background-color:red'>Invalid E-Mail. Failed to submit ban appeal.</div>";
200
201 } else {
202
203 submittedForm($successnotice, $minecrafthead, $provideip, $providelocation, $providetime, $providedate, $version, $versionget, $sendto, $sendfrom, $sendconfirmation, $checkupdate, $confirmsubject, $confirmmsg, $replykey, $acceptbutton, $denybutton);
204
205 }
206 }
207}
208
209?>
210
211</body>
212
213
214</html>
215
216<!-- Covered by the MIT License Copyright (c) 2018 16YELDARB -->