@@ -801,7 +801,7 @@ function valid_url($url, $absolute = FALSE) {
...
@@ -801,7 +801,7 @@ function valid_url($url, $absolute = FALSE) {
* The name of the event.
* The name of the event.
*/
*/
functionflood_register_event($name){
functionflood_register_event($name){
db_query("INSERT INTO {flood} (event, hostname, timestamp) VALUES ('%s', '%s', %d)",$name,$_SERVER['REMOTE_ADDR'],time());
db_query("INSERT INTO {flood} (event, hostname, timestamp) VALUES ('%s', '%s', %d)",$name,ip_address(),time());
}
}
/**
/**
...
@@ -817,7 +817,7 @@ function flood_register_event($name) {
...
@@ -817,7 +817,7 @@ function flood_register_event($name) {
* True if the user did not exceed the hourly threshold. False otherwise.
* True if the user did not exceed the hourly threshold. False otherwise.
*/
*/
functionflood_is_allowed($name,$threshold){
functionflood_is_allowed($name,$threshold){
$number=db_num_rows(db_query("SELECT event FROM {flood} WHERE event = '%s' AND hostname = '%s' AND timestamp > %d",$name,$_SERVER['REMOTE_ADDR'],time()-3600));
$number=db_num_rows(db_query("SELECT event FROM {flood} WHERE event = '%s' AND hostname = '%s' AND timestamp > %d",$name,ip_address(),time()-3600));
return($number<$threshold?TRUE:FALSE);
return($number<$threshold?TRUE:FALSE);
}
}
...
@@ -2805,3 +2805,4 @@ function watchdog_severity_levels() {
...
@@ -2805,3 +2805,4 @@ function watchdog_severity_levels() {
@@ -706,6 +706,20 @@ function system_performance_settings() {
...
@@ -706,6 +706,20 @@ function system_performance_settings() {
'#description'=>t("Some Drupal modules include their own CSS files. When these modules are enabled, each module's CSS file adds an additional HTTP request to the page, which can increase the load time of each page. These HTTP requests can also slightly increase server load. It is recommended to only turn this option on when your site is in production, as it can interfere with theme development. This option is disabled if you have not set up your files directory, or if your download method is set to private."),
'#description'=>t("Some Drupal modules include their own CSS files. When these modules are enabled, each module's CSS file adds an additional HTTP request to the page, which can increase the load time of each page. These HTTP requests can also slightly increase server load. It is recommended to only turn this option on when your site is in production, as it can interfere with theme development. This option is disabled if you have not set up your files directory, or if your download method is set to private."),
);
);
$form['reverse_proxy']=array(
'#type'=>'fieldset',
'#title'=>t('Reverse proxy'),
'#description'=>t('Proper extraction of client IP addresses when Drupal is behind a reverse proxy.'),
'#description'=>t('Enable this setting to determine the correct IP address of the remote client by examining information stored in the X-Forwarded-For headers. X-Forwarded-For headers are a standard mechanism for identifying client systems connecting through a reverse proxy server, such as Squid or Pound. Reverse proxy servers are often used to enhance the performance of heavily visited sites and may also provide other site caching, security or encryption benefits. If this Drupal installation operates behind a reverse proxy, this setting should be enabled so that correct IP address information is captured in Drupal\'s session management, logging, statistics and access management systems; if you are unsure about this setting, do not have a reverse proxy, or Drupal operates in a shared hosting environment, this setting should be set to disabled.'),