MDL-15244, add ability to block ip addresses for HEAD.

This commit is contained in:
dongsheng
2008-07-14 08:14:31 +00:00
parent fb94cd4848
commit ab99c8f014
4 changed files with 60 additions and 0 deletions
+12
View File
@@ -527,6 +527,18 @@ global $HTTPSPAGEREQUIRED;
}
}
$iplist = unserialize(get_config(null, 'blockedip'));
if(!empty($iplist)) {
foreach($iplist as $ip) {
if(address_in_subnet(getremoteaddr(), $ip)){
// Telling the banned user the site is not
// available currently.
echo get_string('sitemaintenance', 'admin');
die;
}
}
}
/// note: we can not block non utf-8 installatrions here, because empty mysql database
/// might be converted to utf-8 in admin/index.php during installation
?>