-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding a lockdown feature to mythweb. We check the user agent (and a …
…get var) to see if it is a search engine or bot or the like. If it is, we lock down the mythweb install until the lockfile is manually removed. The idea is to prevent people from having their installs indexed without their knowledge. It is not perfect, but it is a start. There is a way to disable this feature if the user wants, and it is covered in the updated README file. git-svn-id: http://svn.mythtv.org/svn/trunk@17580 7dbf422c-18fa-0310-86e9-fd20926502f2
- Loading branch information
Showing
18 changed files
with
104 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| <?php | ||
| /** | ||
| * To attempt to curve the massive amounts of (unintentionally) open mythweb installs, we are attempting to | ||
| * protect the users by having a automatic lockdown if we detect a 'bot' or if it's specifically requested by a user | ||
| * | ||
| * You can disable this feature with the apache env var of MYTHWEB_LOCKDOWN_DISABLE being set to true | ||
| * | ||
| * @url $URL: svn+ssh://svn.mythtv.org/var/lib/svn/trunk/mythplugins/mythweb/includes/lockdown.php $ | ||
| * @date $Date: 2008-03-07 16:21:55 -0800 (Fri, 07 Mar 2008) $ | ||
| * @version $Revision: 16436 $ | ||
| * @author $Author: kormoc $ | ||
| * @license GPL | ||
| * | ||
| * @package MythWeb | ||
| * | ||
| /**/ | ||
|
|
||
| if ($_SERVER['MYTHWEB_LOCKDOWN_DISABLE'] != true) { | ||
| if ( stristr('bot', $_SERVER['HTTP_USER_AGENT']) !== false | ||
| || stristr('spider', $_SERVER['HTTP_USER_AGENT']) !== false | ||
| || stristr('crawler', $_SERVER['HTTP_USER_AGENT']) !== false | ||
| || stristr('search', $_SERVER['HTTP_USER_AGENT']) !== false | ||
| || stristr('yahoo', $_SERVER['HTTP_USER_AGENT']) !== false | ||
| || isset($_GET['TRIGGER_MYTHWEB_LOCKDOWN']) | ||
| ) | ||
| touch('lockdown'); | ||
| } | ||
|
|
||
| if ( $_SERVER['MYTHWEB_LOCKDOWN_DISABLE'] != true && file_exists('lockdown')) | ||
| tailored_error('lockdown'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | ||
| <html> | ||
| <head> | ||
| <title>Error</title> | ||
| <link rel="stylesheet" type="text/css" href="<?php echo root ?>skins/errors.css"> | ||
| </head> | ||
|
|
||
| <body> | ||
|
|
||
| <div id="message"> | ||
|
|
||
| <h2>MythWeb Locked</h2> | ||
|
|
||
| <p> | ||
| <?php | ||
| echo t('LOCKDOWN_NOTICE').' '.realpath('lockdown').' '.t('LOCKDOWN_NOTICE_2'); | ||
| ?> | ||
| </p> | ||
|
|
||
| </div> | ||
|
|
||
| </body> | ||
| </html> |