MDL-15244, add ability to block ip addresses for HEAD.
This commit is contained in:
@@ -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
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user