Difference between revisions of "TNG Rip Prevention"

From Genwiki

Jump to: navigation, search
Line 55: Line 55:
  
 
# backup your existing TNG v5.1.4 begin.php and admin/leftbanner.php file
 
# backup your existing TNG v5.1.4 begin.php and admin/leftbanner.php file
# download this zip {[[Media:TNG Rip Prevention Rev 0.zip|TNG Rip Prevention Rev 0.zip]]}
+
# download this zip {[[Media:TNG Rip Prevention Rev 1.zip|TNG Rip Prevention Rev 1.zip]]}
 
# unzip it, examine the contents
 
# unzip it, examine the contents
 
# open the rip_warning.html file and edit the contents (you can use something like notepad or wordpad)
 
# open the rip_warning.html file and edit the contents (you can use something like notepad or wordpad)

Revision as of 21:29, 18 September 2006

If you are not comfortable with html and php editing, this page may not be for you


Overview

This TNG modification will help deter some of the automated processes that simply rip (copy) our sites for potential comercial gain. It monitors the time interval between visitor accesses. If the accesses are rapid and repeated, a warning is issued. If the accesses continue rapid and repeatedly, the visitor is banned and an explanation page is displayed.

In addition to the warning and ban pages, a simple access stats page is available on the admin page. The left banner will include an entry (in English) "Show Access" which will display the current stored access information. I have sorted it by Bans, Warnings, Total fast page access, and Total accesses. A button is included to optionally sort the information using alternate columns.

To view an example of this, you may access my site and simply hit the refresh quickly. A few rapid accesses will result in a warning page. Simply wait a few seconds and operation will return to normal. Repeated rapid access will result in a 60 second ban where an explanation page is displayed.

To view an example of the admin summary page you may use Admin Access Page. This page has had the login check temporarily disabled until Friday for those on the TNG user list who wish to view this. (Sep 18, 2006 - Sep 22)


Rev 0 Aug 29, 2006 - Initial Release.
Rev 1 Sep 18, 2006 - Updated the admin display page with a couple of sort buttons to view the data in different orders. If you have already installed Rev 0, you only need to copy in the new admin/showaccess.php file. Don't forget to update the configurable table name in the file if you had choosen a name other than the default.


Requirements

  1. A working TNG installation - see The Next Generation of Genealogy Sitebuilding
  2. A backup of your TNG files
    • begin.php
    • admin/leftbanner.php


Side Effects

  1. As with any modification to a TNG file, this modification will get lost during your next TNG version update and you will need to re-implement the mod. However, it is only a single line addition to each of the files.


TNG Modifications

The following zip file contains the necessary files to allow the addition of this feature.

  • The zip file TNG Rip Prevention Rev 1.zip contains:
    • the two display pages: rip_warning.html and rip_ban.html
    • begin.php - a modified TNG 5.1.4 file
    • admin/leftbanner.php - a modified TNG 5.1.4 file
    • check_access.php - the visitor monitor code
    • admin/showaccess.php - the visitor access display code


  • IF you are running v 5.1.4 then

If you have previously modified your TNG begin.php or admin/leftbanner.php file, do not continue. You WILL lose any changes to that file you have previously made.

  1. backup your existing TNG v5.1.4 begin.php and admin/leftbanner.php file
  2. download this zip {TNG Rip Prevention Rev 1.zip}
  3. unzip it, examine the contents
  4. open the rip_warning.html file and edit the contents (you can use something like notepad or wordpad)
    • personalize the text with your name, or modify to suit
  5. open the rip_ban.html file and edit the contents (you can use something like notepad or wordpad)
    • personalize the text with your name, or modify to suit
  6. copy your version of rip_ban.html and rip_warning.html to the base TNG folder (where the begin.php file is)
  7. copy check_access.php and the begin.php file to the same base TNG folder
  8. copy showaccess.php and leftbanner.php to the admin folder in the base TNG folder
  9. check it out


  • IF you are NOT running v5.1.4 or you HAVE made changes to either of the above files then, you must add the single include line to the begin.php file on your own and the link to the showaccess.php file in the leftbanner.php file. Follow the instructions above, except open and edit the begin.php and admin/leftbanner.php files, do not copy them.
  1. before following the instructions above
    • open and edit your begin.php from:
 include("config.php");
  • to
 include("config.php");
 include($cms[tngpath] . "check_access.php");
  • open your admin/leftbanner.php and edit the following:
 <tr><td><a href="reports.php" target="main" class="lightlink"><?php echo $admtext[reports]; ?></a></td></tr>
 <tr><td><a href="languages.php" target="main" class="lightlink"><?php echo $admtext[languages]; ?></a></td></tr>


  • to
 <tr><td><a href="reports.php" target="main" class="lightlink"><?php echo $admtext[reports]; ?></a></td></tr>
 <tr><td><a href="showaccess.php" target="main" class="lightlink">Show Access</a></td></tr>
 <tr><td><a href="languages.php" target="main" class="lightlink"><?php echo $admtext[languages]; ?></a></td></tr>



Customizations

Although the default values in the check_access.php file work well for me, the parameters may be customized

  • visitor access speed detection
  • number of fast accesses before a warning is displayed
  • number of fast accesses before a ban is displayed
  • length of time for a visitor ban
  • names of valid search engine indexers


In the event of a problem with your TNG site

  1. copy your backup begin.php to your base TNG folder
  2. copy your backup leftbanner.php file back to the admin sub folder
    • all should be well now
  3. you may also delete the additional files you copied in


Support

  1. You're sort of on your own... If you have a specific question, or feel some additional info in the above would help others, feel free to contact me directly. Mail me here
    • Please post suggestions, or your own flavour of this mod to the forum or list
Personal tools