PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Troubleshooting (http://www.phpdig.net/forum/forumdisplay.php?f=22)
-   -   Little fix: Message on unathorized spider attempt (http://www.phpdig.net/forum/showthread.php?t=2450)

shockfreezer 05-14-2006 11:06 PM

Little fix: Message on unathorized spider attempt
 
Hi there,

in the last days I was a little fighting with phpDig 1.8.9 RC1 :P
I've found out that no message is displayed if phpDig is unauthorized to spider a site.
Because of this behavior I lost some time, ok also because of my bad capacity for remembering ;) I really had forgotten that we had secured our server with .htaccess.
And I was wondering why phpDig can't spider our site....
So now i had written a little fix that helps prevent things like that. It displays a message if phpDig is unauthorized to spider a site. You have just to replace some code in the file admin/spider.php.
Go to line 511 in the file admin/spider.php.
Replace following code:
PHP Code:

else {
 
$ok_for_index 1;
 if (
$content_type == 'HTML') {
      
$ok_for_spider 1;
 }


with this code:

PHP Code:

   else {
     
$ok_for_index 1;
     if(
$content_type == "UNAUTH"){
        
//print phpdigMsg('not_authorized_toindex').$br;
        
print "<strong>You're unauthorized to spider this site:</strong>".$br;
     }
     if (
$content_type == 'HTML') {
          
$ok_for_spider 1;
     }
   } 

Sure it's quick and dirty, especially the part without localisation, but it's a workaround for the moment. An implementation in RC2, including the localisation wouldn't be to hard ;)

That's it, I hope I can someone save some time with this code :yes:

Greez
shockfreezer


All times are GMT -8. The time now is 04:54 AM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.