]> git.mxchange.org Git - mailer.git/blob - guestbook/forbid.php
Added local files.
[mailer.git] / guestbook / forbid.php
1 <?php
2 /**
3 * $Id: forbid.php,v 1.0 2005/31/12 12:00:00 thomasz Exp $
4 *
5 * @author       Thomas Zeithaml <info@spider-trap.de>
6 * @copyright    (c) 2005-2006 Spider-Trap Team
7
8 * The contents of this file are subject to the Mozilla Public License
9 * Version 1.1 (the "License"); you may not use this file except in
10 * compliance with the License. You may obtain a copy of the License at
11 * http://www.mozilla.org/MPL/
12
13 * Software distributed under the License is distributed on an "AS IS"
14 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
15 * License for the specific language governing rights and limitations
16 * under the License.
17 */
18 require 'settings.php';
19 include trap_core_path."core.inc.php";
20
21 function ts_gfx($ts_random) {
22 $rcode = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . $_SERVER['SERVER_SOFTWARE'] . $_SERVER['HTTP_ACCEPT_CHARSET'] . sitekey . $ts_random . datekey . filemtime("settings.php")));
23 $code = substr($rcode, 2, 6);
24
25 setCaptchaId($code);
26
27 $circles=5;
28 $width=100;
29 $height=40;
30 $font=5;
31
32 $fontwidth = ImageFontWidth($font) * strlen($code);
33 $fontheight = ImageFontHeight($font);
34
35 $max_lines = $fontheight / 4;
36 if (random_lines == true)
37 {
38         $lines = rand(1, $max_lines);
39 }
40  else
41 {
42         $lines=2;
43 }
44 if ($lines > $max_lines) $lines = $max_lines;
45
46 $im = @imagecreate ($width,$height);
47 $background_color = imagecolorallocate ($im, rand(0,100),rand(0,100),rand(0,100));
48 $text_color = imagecolorallocate ($im, rand(200,255),rand(200,255),rand(200,255)); // Random Text
49
50 $r=0.01;$g=0.51;$b=0.87;
51 for ($i=1;$i<=$circles;$i++) {
52         $value=rand(200, 255);
53         $randomcolor = imagecolorallocate ($im , $value*$r, $value*$g,$value*$b);
54         imagefilledellipse($im,rand(0,$width-10),rand(0,$height-3),
55         rand(20,70),rand(20,70),$randomcolor);
56 }
57
58 imagerectangle($im,0,0,$width-1,$height-1,$text_color);
59
60 $w_pos = rand(5, abs($width - $fontwidth));
61 $h_pos = rand(5, abs($height - 1 - $fontheight));
62 imagestring ($im, $font, $w_pos, $h_pos, $code, $text_color);
63
64 $y2 = 0; $y = 0;
65 for ($i=0;$i<$lines;$i++) {
66         while(abs($y2 - $y) < 2)
67         {
68                 $y=rand($h_pos, ($h_pos + $fontheight));
69         }
70         $y2 = $y;
71         $randomcolor=imagecolorallocate($im, 0,0, rand(100, 255));
72         imageline($im, 0, $y, $width, $y, $randomcolor);
73 }
74
75 header ("Content-type: image/jpeg");
76 imagejpeg ($im,'',80);
77 ImageDestroy($im);
78 die();
79 }
80 $ts_random=rand();
81 $pos= strpos($_SERVER['REQUEST_URI'], '?');
82 $basename = basename(substr($_SERVER['REQUEST_URI'], 0, $pos));
83 if($basename==basename(__FILE__))
84 ts_gfx($_GET['ts_random']);
85
86 $value = getCaptchaId();
87 if($_POST['unbanme'] == $value ){
88     remove_blacklist(getip(), $_SERVER["HTTP_USER_AGENT"]);
89         header("Location: ../");
90         exit;
91 } else {
92 ?>
93 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
94 <html><head>
95 <meta name="robots" content="noindex,nofollow" />
96 <title>403 - Zugriff verboten</title>
97 </head><body>
98 <h1><font face="Verdana, Arial, Helvetica, sans-serif">Zugriff auf diese Website k&ouml;nnen Sie hier freischalten </font><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
99     </font>
100 </h1>
101 <?php
102 if($_POST['unbanme'] != '' && $_POST['unbanme'] != $value){
103         echo "<h2>Falsche Eingabe - Sperre nicht aufgehoben !</h2>";
104 }
105 ?>
106 <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> <strong>Diese Seite dient zum Schutz vor sogenannten &quot;b&ouml;sen&quot; Spambots.</strong>  Oft ist es der Fall, dass man persönliche Daten wie z.B. die Bankverbindung 
107     auf einer Webseite angibt. Damit diese Daten nicht in den Suchmaschinen auftauchen 
108     hat man sich auf einen Standard geeinigt, wie man Websiten vor der Indexierung ausschließen kann.*<br>
109
110     <br>
111     <strong>Sie sind einem Link gefolgt der für diesen Spambot gedacht war und haben dadurch eine Sperre Ihrer IP-Adresse ausgelöst. </strong></font>
112 <p><font color="#FF0000" size="2" face="Verdana, Arial, Helvetica, sans-serif"> <strong>Um
113       diese Sperre aufzuheben, müssen Sie in das folgende Formular den unten
114       angezeigten Wert eintragen und danach abschicken - dann haben Sie sofort
115       wieder Zugriff auf diese Website.</strong></font>
116 <p>
117 <img src="forbid.php?ts_random=<?php echo $ts_random."\""; ?> />
118 <FORM METHOD="post" ACTION="forbid.php">
119 <label for="unbanme">Bitte Wert eingeben:</label>
120 <input name="unbanme" id="unbanme" style="width: 165px;" />
121 <input class="submit" type="submit" value="Speichern" name="save" />
122 </form>
123 <?php
124   }
125 ?>
126 <font size="2" face="Verdana, Arial, Helvetica, sans-serif">
127 </font>
128 <p>&nbsp;</p>
129 <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">* Dazu legt man eine Datei mit Namen robots.txt in das Root Verzeichnis des Webspaces und hinterlegt darin, welche Seiten indexiert werden d&uuml;rfen und welche nicht. Suchmaschinen wie MSN, Yahoo oder Google halten sich an diese Regeln. Spambots aber lesen Internetseiten aus ohne dabei auf diese Richtlinien zu achten. Um dies zu unterbinden und damit die Webseiten zu sch&uuml;tzen, werden diese Spambots ausgesperrt. Mehr Informationen &uuml;ber Webcrawler gibt es z.B: bei <a href="http://www.robotstxt.org/wc/robots.html">http://www.robotstxt.org/wc/robots.html</a><br>
130 &nbsp;</font></p>
131 <p><?php include ("randlink.php"); ?></p>
132 <font size="2" face="Verdana, Arial, Helvetica, sans-serif">powered by Spider-trap.de
133 </font>
134 </body>
135 </html>