diff options
| -rw-r--r-- | help_text.php | 5 | ||||
| -rw-r--r-- | includes/functions/functions.php | 29 | ||||
| -rw-r--r-- | includes/session.php | 5 | ||||
| -rw-r--r-- | setup.php | 2 | ||||
| -rw-r--r-- | siteconfig.php | 5 |
5 files changed, 0 insertions, 46 deletions
diff --git a/help_text.php b/help_text.php index ff79754501..1ef77e2b3e 100644 --- a/help_text.php +++ b/help_text.php @@ -2336,11 +2336,6 @@ case 'MAX_RELATION_PATH_LENGTH': $text=i18n::translate('If the <i>Use relationship privacy</i> option is enabled, logged-in users will only be able to see or edit individuals within this number of relationship steps.<br /><br />This option sets the default for all users who have access to this genealogical database. The Administrator can override this option for individual users by editing the user\'s account details.'); break; -case 'MAX_VIEW_RATE': - $title=i18n::translate('Maximum page view rate'); - $text=i18n::translate('This option limits the rate at which a user can view pages.<br /><br />If that rate is exceeded, <b>webtrees</b> treats the session as a hacking attempt; the session will be terminated with a suitable message. These two values should place a reasonable limit on the amount of bandwith and downloaded bytes from the server. This feature can be switched off by setting the time interval to 0.'); - break; - case 'MEDIA_DIRECTORY_LEVELS': $title=i18n::translate('Multimedia directory levels to keep'); $text=i18n::translate('A value of 0 will ignore all directories in the file path for the media object. A value of 1 will retain the first directory containing this image. Increasing the numbers increases number of parent directories to retain in the path.<br /><br />For example, if you link an image in your GEDCOM with a path like <b>C:\Documents and Settings\User\My Documents\My Pictures\Genealogy\Surname Line\grandpa.jpg</b>, a value of 0 will translate this path to <b>./media/grandpa.jpg</b>. A value of 1 will translate this to <b>./media/Surname Line/grandpa.jpg</b>, etc. Most people will only need to use a 0. However, it is possible that some media objects kept in different directories have identical names and would overwrite each other when this option is set to 0. Non-zero settings allow you to keep some organization in your media thereby preventing name collisions.'); diff --git a/includes/functions/functions.php b/includes/functions/functions.php index 1eaba71ee0..d51db78928 100644 --- a/includes/functions/functions.php +++ b/includes/functions/functions.php @@ -2858,35 +2858,6 @@ function add_descendancy(&$list, $pid, $parents=false, $generations=-1) { } /** - * check if the page view rate for a session has been exeeded. - */ -function CheckPageViews() { - global $SEARCH_SPIDER, $MAX_VIEWS, $MAX_VIEW_TIME; - - if ($MAX_VIEW_TIME == 0 || $MAX_VIEWS == 0 || !empty($SEARCH_SPIDER)) - return; - - // The media firewall should not be throttled - if (WT_SCRIPT_NAME=='mediafirewall.php') - return; - - if (!empty($_SESSION["pageviews"]["time"]) && !empty($_SESSION["pageviews"]["number"])) { - $_SESSION["pageviews"]["number"] ++; - if ($_SESSION["pageviews"]["number"] < $MAX_VIEWS) - return; - $sleepTime = $MAX_VIEW_TIME - time() + $_SESSION["pageviews"]["time"]; - if ($sleepTime > 0) { - // The configured page view rate has been exceeded - // - Log a message and then sleep to slow things down - $text = "Permitted page view rate of {$MAX_VIEWS} per {$MAX_VIEW_TIME} seconds exceeded."; - AddToLog($text, 'auth'); - sleep($sleepTime); - } - } - $_SESSION["pageviews"] = array("time"=>time(), "number"=>1); -} - -/** * get the next available xref * calculates the next available XREF id for the given type of record * @param string $type the type of record, defaults to 'INDI' diff --git a/includes/session.php b/includes/session.php index 1d9da62d20..0266d35d45 100644 --- a/includes/session.php +++ b/includes/session.php @@ -246,8 +246,6 @@ $ALLOW_CHANGE_GEDCOM =get_site_setting('ALLOW_CHANGE_GEDCOM'); $WT_SESSION_SAVE_PATH =get_site_setting('SESSION_SAVE_PATH'); $WT_SESSION_TIME =get_site_setting('SESSION_TIME'); $SERVER_URL =get_site_setting('SERVER_URL'); -$MAX_VIEWS =get_site_setting('MAX_VIEWS'); -$MAX_VIEW_TIME =get_site_setting('MAX_VIEW_TIME'); //-- allow user to cancel ignore_user_abort(false); @@ -406,9 +404,6 @@ if (WT_USER_ID && safe_GET_bool('logout')) { exit; } -// Check for page views exceeding the limit -CheckPageViews(); - $show_context_help = ''; if (!empty($_REQUEST['show_context_help'])) $show_context_help = $_REQUEST['show_context_help']; if (!isset($_SESSION['show_context_help'])) $_SESSION['show_context_help'] = $SHOW_CONTEXT_HELP; @@ -1005,8 +1005,6 @@ try { "('SESSION_TIME', '7200'),". "('SERVER_URL', ''),". "('LOGIN_URL', 'login.php'),". - "('MAX_VIEWS', '20'),". - "('MAX_VIEW_TIME', '1'),". "('MEMORY_LIMIT', '".addcslashes($_POST['maxmem'], "'")."M'),". "('MAX_EXECUTION_TIME', '".addcslashes($_POST['maxcpu'], "'")."'),". "('SMTP_ACTIVE', '".addcslashes($_POST['smtpuse'], "'")."'),". diff --git a/siteconfig.php b/siteconfig.php index bce7242672..80bb209a14 100644 --- a/siteconfig.php +++ b/siteconfig.php @@ -53,8 +53,6 @@ case 'update': set_site_setting('SESSION_TIME', safe_POST('session_time')); set_site_setting('SERVER_URL', safe_POST('server_url')); set_site_setting('LOGIN_URL', safe_POST('login_url')); - set_site_setting('MAX_VIEWS', safe_POST('max_views')); - set_site_setting('MAX_VIEW_TIME', safe_POST('max_view_time')); set_site_setting('MEMORY_LIMIT', safe_POST('memory_limit', '\d+[KMG]?', ini_get('memory_limit'))); set_site_setting('MAX_EXECUTION_TIME', safe_POST('max_execution_time', '\d+', ini_get('max_execution_time'))); set_site_setting('SMTP_ACTIVE', safe_POST('smtp_active', 'internal|external|disabled', 'internal')); @@ -124,9 +122,6 @@ echo '<td class="descriptionbox width20 wrap">', i18n::translate('Login URL'), help_link('LOGIN_URL'), '</td>', '<td class="optionbox wrap"><input type="text" name="login_url" value="', get_site_setting('LOGIN_URL'), '" size="50" /></td>', '</tr><tr>', - '<td class="descriptionbox width20 wrap">', i18n::translate('Maximum page view rate'), help_link('MAX_VIEW_RATE'), '</td>', - '<td class="optionbox wrap"><input type="text" name="max_views" value="', get_site_setting('MAX_VIEWS'), '" size="10" /> ', i18n::translate('pages per'), ' <input type="text" name="max_view_time" value="', get_site_setting('MAX_VIEW_TIME'), '" size="10" />', i18n::translate('seconds'), '</td>', - '</tr><tr>', '<td class="facts_label" colspan="2">', i18n::translate('SMTP mail configuration'), '</td>', '</tr><tr>', '<td class="descriptionbox width20 wrap">', i18n::translate('Messages'), help_link('SMTP_ACTIVE'), '</td>', |
