include trap_core_path . 'core.inc.php';
function ts_gfx($ts_random) {
-$rcode = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . $_SERVER['SERVER_SOFTWARE'] . $_SERVER['HTTP_ACCEPT_CHARSET'] . sitekey . $ts_random . datekey . filemtime('settings.php')));
-$code = substr($rcode, 2, 6);
+ $rcode = hexdec(md5($_SERVER['HTTP_USER_AGENT'] . $_SERVER['SERVER_SOFTWARE'] . $_SERVER['HTTP_ACCEPT_CHARSET'] . sitekey . $ts_random . datekey . filemtime('settings.php')));
+ $code = substr($rcode, 2, 6);
-setCaptchaId($code);
+ setCaptchaId($code);
-$circles=5;
-$width=100;
-$height=40;
-$font=5;
+ $circles = 5;
+ $width = 100;
+ $height = 40;
+ $font = 5;
-$fontwidth = ImageFontWidth($font) * strlen($code);
-$fontheight = ImageFontHeight($font);
+ $fontWidth = ImageFontWidth($font) * strlen($code);
+ $fontHeight = ImageFontHeight($font);
-$max_lines = $fontheight / 4;
-if (random_lines == true)
-{
- $lines = rand(1, $max_lines);
-}
- else
-{
- $lines=2;
-}
-if ($lines > $max_lines) $lines = $max_lines;
-
-$im = @imagecreate ($width,$height);
-$background_color = imagecolorallocate ($im, rand(0,100),rand(0,100),rand(0,100));
-$text_color = imagecolorallocate ($im, rand(200,255),rand(200,255),rand(200,255)); // Random Text
-
-$r=0.01;$g=0.51;$b=0.87;
-for ($i=1;$i<=$circles;$i++) {
- $value=rand(200, 255);
- $randomcolor = imagecolorallocate ($im , $value*$r, $value*$g,$value*$b);
- imagefilledellipse($im,rand(0,$width-10),rand(0,$height-3),
- rand(20,70),rand(20,70),$randomcolor);
-}
+ $max_lines = $fontHeight / 4;
+
+ if (random_lines == true) {
+ $lines = rand(1, $max_lines);
+ } else {
+ $lines = 2;
+ }
+
+ if ($lines > $max_lines) {
+ $lines = $max_lines;
+ }
+
+ $im = @imagecreate ($width,$height);
+ $background_color = imagecolorallocate ($im, rand(0,100),rand(0,100),rand(0,100));
+ $text_color = imagecolorallocate ($im, rand(200,255),rand(200,255),rand(200,255)); // Random Text
-imagerectangle($im,0,0,$width-1,$height-1,$text_color);
+ $r = 0.01; $g = 0.51; $b = 0.87;
-$w_pos = rand(5, abs($width - $fontwidth));
-$h_pos = rand(5, abs($height - 1 - $fontheight));
-imagestring ($im, $font, $w_pos, $h_pos, $code, $text_color);
+ for ($i = 1;$i <= $circles; $i++) {
+ $value = rand(200, 255);
+ $randomcolor = imagecolorallocate ($im , $value*$r, $value*$g,$value*$b);
-$y2 = 0; $y = 0;
-for ($i=0;$i<$lines;$i++) {
- while(abs($y2 - $y) < 2)
- {
- $y=rand($h_pos, ($h_pos + $fontheight));
+ imagefilledellipse(
+ $im,
+ rand(0, $width - 10),
+ rand(0, $height - 3),
+ rand(20, 70),
+ rand(20, 70), $randomcolor
+ );
}
- $y2 = $y;
- $randomcolor=imagecolorallocate($im, 0,0, rand(100, 255));
- imageline($im, 0, $y, $width, $y, $randomcolor);
-}
-header ('Content-type: image/jpeg');
-imagejpeg ($im,'',80);
-ImageDestroy($im);
-die();
+ imagerectangle($im, 0, 0, $width - 1, $height - 1, $text_color);
+
+ $w_pos = rand(5, abs($width - $fontWidth));
+ $h_pos = rand(5, abs($height - 1 - $fontHeight));
+ imagestring($im, $font, $w_pos, $h_pos, $code, $text_color);
+
+ $y2 = 0; $y = 0;
+ for ($i = 0; $i < $lines; $i++) {
+ while (abs($y2 - $y) < 2) {
+ $y = rand($h_pos, ($h_pos + $fontHeight));
+ }
+ $y2 = $y;
+ $randomcolor = imagecolorallocate($im, 0,0, rand(100, 255));
+ imageline($im, 0, $y, $width, $y, $randomcolor);
+ }
+
+ header('Content-type: image/jpeg');
+ imagejpeg($im,'',80);
+ ImageDestroy($im);
+ die();
}
-$ts_random=rand();
-$pos= strpos($_SERVER['REQUEST_URI'], '?');
+
+$ts_random = rand();
+$pos = strpos($_SERVER['REQUEST_URI'], '?');
$basename = basename(substr($_SERVER['REQUEST_URI'], 0, $pos));
-if($basename==basename(__FILE__))
-ts_gfx($_GET['ts_random']);
+if ($basename == basename(__FILE__)) {
+ ts_gfx($_GET['ts_random']);
+}
$value = getCaptchaId();
-if($_POST['unbanme'] == $value ){
- remove_blacklist(getip(), $_SERVER['HTTP_USER_AGENT']);
+if ($_POST['unbanme'] == $value ){
+ remove_blacklist(getip(), $_SERVER['HTTP_USER_AGENT']);
header('Location: ../');
exit;
} else {
* License for the specific language governing rights and limitations
* under the License.
*/
+
// Schreibrechte CHMOD 777
error_reporting(0);
-$htaccess_file = dirname(dirname(__FILE__))."/.htaccess";
-if (!is_writeable($htaccess_file)) die("Cannot write ".$htaccess_file." !");
-$blacklist_file = dirname(dirname(__FILE__))."/blacklist.txt";
-if (!is_writeable($blacklist_file)) die("Cannot write ".$blacklist_file." !");
-$whitelist_file = dirname(dirname(__FILE__))."/whitelist.txt";
-if (!is_writeable($whitelist_file)) die("Cannot write ".$whitelist_file." !");
+$htaccess_file = dirname(dirname(__FILE__)) . '/.htaccess';
+
+if (!is_writeable($htaccess_file)) die('Cannot write ' . $htaccess_file . ' !');
+$blacklist_file = dirname(dirname(__FILE__)) . '/blacklist.txt';
+
+if (!is_writeable($blacklist_file)) die('Cannot write ' . $blacklist_file . ' !');
+$whitelist_file = dirname(dirname(__FILE__)) . '/whitelist.txt';
+
+if (!is_writeable($whitelist_file)) die('Cannot write ' . $whitelist_file . ' !');
// Email fuer Benachrichtigungen
-$alert_email = "webmaster@mxchange.org";
+$alert_email = 'webmaster@mxchange.org';
// Email senden wenn neue Sperre
-$mail_on_add = true;
+$mail_on_add = true;
// Email senden wenn Sperre fuer jemand aufgehoben wurde ?
-$mail_on_remove = true;
+$mail_on_remove = true;
-$trap_path = "guestbook/"; // path of the trap - must end with a "/"
+// path of the trap - must end with a "/"
+$trap_path = 'guestbook/';
$sleep_min = 30; $sleep_max = 300;
-$captcha_file = dirname(dirname(__FILE__))."/".$trap_path."captcha.txt";
-if (!is_writeable($captcha_file)) die("Cannot write ".$captcha_file." !");
+$captcha_file = dirname(dirname(__FILE__)) . '/' . $trap_path . 'captcha.txt';
+if (!is_writeable($captcha_file)) {
+ die('Cannot write ' . $captcha_file . ' !');
+}
// Bitte randomizen Sie diesen String etwas selber! ;-)
-define('sitekey', "spider-trap_yh34yh=3h3542u5y458=h34t73h=h24yhj2q4-h2");
+define('sitekey', 'spider-trap_yh34yh=3h3542u5y458=h34t73h=h24yhj2q4-h2');
/*
* Hier koennen Sie auch das deutsche Datumsformat nehmen, Uhrzeit nicht, da