cacert-webdb/stamp/report.php
2006-11-27 23:10:08 +00:00

95 lines
3.6 KiB
PHP

<?
function clean($key)
{
return(mysql_real_escape_string(strip_tags(trim($_REQUEST[$key]))));
}
$arr = explode("//", mysql_real_escape_string(trim($_REQUEST['refer'])), 2);
$arr = explode("/", $arr['1'], 2);
$ref = $arr['0'];
$refer = clean('refer');
$name = clean('name');
$email = clean('email');
$comment = clean('comment');
$reason = clean('reason');
$process = clean('process');
if($process != "")
{
$checkemail = checkEmail($email);
if($checkemail != "OK")
{
$errmsg = $checkemail;
$process = "";
}
}
if($process != "")
{
$IP = mysql_real_escape_string(trim($_SERVER['REMOTE_ADDR']));
$iplong = ip2long($IP);
mysql_query("insert into `abusereports` set `when`=NOW(), `IP`='$iplong', `url`='$refer', `name`='$name', `email`='$email',
`comment`='$comment', `reason`='$reason'");
$id = mysql_insert_id();
$body = "New Abuse Report has been lodged via the the Stamp Interface:\n\n";
$body .= "Reported ID: $id\n";
$body .= "Reported IP: $IP\n";
$body .= "From: $name <$email>\n";
$body .= "URL: $refer\n";
$body .= "Reason: $reason\n";
$body .= "Comment: $comment\n";
sendmail("cacert-abuse@lists.cacert.org", "[CAcert.org] Abuse Report.", $body, "website@cacert.org", "", "", "CAcert Website");
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>CAcert.org Abuse Report!</title>
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div id="pagecell1">
<div id="pageName"><br>
<h2><a href="http<? if($_SERVER['HTTPS']=="on") { echo "s"; } ?>://www.cacert.org">
<img src="http<? if($_SERVER['HTTPS']=="on") { echo "s"; } ?>://www.cacert.org/images/cacert3.png" border="0" alt="CAcert.org logo"></a></h2>
<? if($_SERVER['HTTPS']!="on") { ?>
<div id="googlead"><br><script type="text/javascript"><!--
google_ad_client = "pub-0959373285729680";
google_alternate_color = "ffffff";
google_ad_width = 234;
google_ad_height = 60;
google_ad_format = "234x60_as";
google_ad_type = "text";
google_ad_channel = "";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>
<? } ?>
</div>
<div id="content">
<div class="story">
<h3>Report abuse for <?=$ref?></h3>
<? if($process == "") { ?>
<? if($errmsg != "") { ?><p style="color:red"><?=$errmsg?></p><? } else { ?><br /><? } ?>
<form method="post" action="report.php">
<label for="refer">URL: </label><input type="text" name="refer" value="<?=$refer?>" readonly="1" /><br />
<label for="name">Name: </label><input type="text" name="name" value="<?=$name?>" /><br />
<label for="email">Email: </label><input type="text" name="email" value="<?=$email?>" /><br />
<label for="reason">Reason: </label><select name="reason">
<option value='invalid'<? if($reason == "invalid") { echo " selected"; } ?>>Invalid Domain</option>
<option value='phishing'<? if($reason == "phishing") { echo " selected"; } ?>>Phishing Site</option>
<option value='spam'<? if($reason == "spam") { echo " selected"; } ?>>Spam</option>
<option value='other'<? if($reason == "other") { echo " selected"; } ?>>Other</option>
</select><br />
<label for="comment">Comment/Other: </label><input type="text" name="comment" value="<?=$comment?>" /><br /><br />
<label for="sub">&nbsp;</label><input type="submit" name="process" value="Report Site"><br />
</form>
<? } else { ?>
<p>We thank you for your attention to detail, your report has been accepted and we will tend to your report as soon as humanly possible.</p>
<? } ?>
</div>
</div>
</body>
</html>