protection
French 
CrawlTrack, webmaster dashboard.
Web analytic, SEO and protection

CrawlProtect, your website safety.
Reinforced protection

Two php/MySQL scripts, free and easy to install
The tools you need to manage and keep control of your site.





diable

CrawlTrack and CrawlProtect support forum

You are not logged in.


#1 04-01-2011 15:28:30

snoopy-virtual
Nouveau membre
Registered: 04-01-2011
Posts: 1

crawltrack script not finishing after redirection

Hi

First of all congratulations and thanks for creating this brilliant program. I have been using it already for a few months and found out it's a lot better than what I expected in the first place.

I had a small problem with it though.

After installing it in my server, I added these couple of lines to my SMF forum (as I saw in your docs) at the top of my index.php file:


Code:

<?php
$crawltsite=1;
require_once("/home/*****/public_html/crawltrack/crawltrack.php");
//all the rest of the SMF script follows here

So now, every time my visitors hit hxxp://www.mysite.com/myforum/index.php they are first redirected to my crawltrack installation. If they are trying to hack something they get into this IF statement at the end of the file ctawltrack.php:

Code:

elseif($crawltattack==1 && $crawltblockattack==1)
{
    $GLOBALS = array();
    $_COOKIES = array();
    $_FILES = array();
    $_ENV = array();
    $_REQUEST = array();
    $_POST = array();
    $_GET = array();
    $_SERVER = array();
    $_SESSION = array();
    [*at*]session_destroy();
    [*at*]mysql_close();
    [*at*]header("Location: hxxp://www.mysite.com/crawltrack/html/noacces.php");
    echo "<head>";
    echo "<META HTTP-EQUIV='Refresh' CONTENT='0;URL=hxxp://www.mysite.com/crawltrack/html/noacces.php'>";
    echo "</head>";
}

// EDIT START
Trying to post this I got 2 warnings telling me I cannot have inside the post any [*at*] signs or any URL links, so I have edited the code changing the URLs to hxxp and the [*at*] signs to [*at*]. But you can see what the code is saying. wink
// EDIT ENDS

So all the globals, session and connexion with DB are destroyed and closed, and they are redirected to my /crawltrack/html/noacces.php page.

So far so good, but the script doesn't end there.

As the require_once for crawltrack is at the beginning of all the SMF script, and the redirection to the noacces.php file is not something that takes place instantly (need maybe 1 or 2 seconds to actually redirect the visitors) the SMF script continue loading.

I don't know exactly how many seconds needs the redirection to actually work, and I don't know exactly how many lines of the SMF script can be executed in that amount of time, but at least a few thousands of them for sure.

I found that because I wrote a small mod for SMF 2 years ago (called mod httpBL) to stop spammers entering the forum. Every now and then (since I installed crawltrack) I was getting in the mod httpBL logs some entries with a few errors. For example the IP (that I get using $_SERVER["REMOTE_ADDR"]) was blank.

Then I realized what was happening. Those entries with blank IPs were caused by visitors stopped by crawltrack (that's why $_SERVER was empty) and redirected to my noacces.php page but, as the script hasn't ended there they had continue (before being redirected) and ending up hitting my mod.

I sorted that just adding inside the file ctawltrack.php (after the redirection) the line:

Code:

    exit();

So now I have the IF statement at the end of the file ctawltrack.php like this:

Code:

elseif($crawltattack==1 && $crawltblockattack==1)
{
    $GLOBALS = array();
    $_COOKIES = array();
    $_FILES = array();
    $_ENV = array();
    $_REQUEST = array();
    $_POST = array();
    $_GET = array();
    $_SERVER = array();
    $_SESSION = array();
    [*at*]session_destroy();
    [*at*]mysql_close();
    [*at*]header("Location: hxxp://www.mysite.com/crawltrack/html/noacces.php");
    echo "<head>";
    echo "<META HTTP-EQUIV='Refresh' CONTENT='0;URL=hxxp://www.mysite.com/crawltrack/html/noacces.php'>";
    echo "</head>";
    exit();
}

Now, when the visitors are redirected to the noacces.php page, the script doesn't continue working, but stop there and wait until the actual redirection take place.

I think it would be a good idea to add that line to all crawltrack installations. What do you think?

==============

Another thing:

Since I started using crawltrack I saw that the Spanish translation is not finished, so I wrote in my TODO list I need one day to finish it and send it to you, I am very sorry I haven't done it yet (always too busy with too many urgent things to do) but eventually I will do it one day. (I hope).

Anyway, if there are any other people already working in finishing that Spanish tramslation, Could you send me their contact info? (Or send them my email address and ask them to contact me).

If there aren't any and I need to do it on my own it's not a big deal (I have done it before with a lot of programs) but if there is somebody there and we can work together it would be nice. It's always better to do team work than work alone. wink

Thanks again for creating and maintaining CrawlTrack.

Keep the good work.

Offline

 

#2 04-01-2011 22:27:45

Jidébé
Administrateur
Registered: 30-10-2005
Posts: 2945

Re: crawltrack script not finishing after redirection

Hi,

Thanks for your feed back, I will take your suggestion into account for the futur.

Regarding spanish translation, you are more than welcome to work on it as unfortunnatly I have no more contact from the earlier translator.

Jean-Denis


CrawlTrack & CrawlProtect developer

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB