MDL-57404 admin_settings: Allow comments in ip block
This adds the ability to to add comments to ip lists in moodle. Currently, the configiplist textentry box does not allow the user to annotate the IP addresses defined. For example, I'd like to be able to define: 192.168.1.1 # London office 10.1.1.1 # New york office 118.209.246.240 # My home IP This would allow me to revisit this list after a few months, and remove IP addresses that are no longer required - without having to manually confirm each IP address
This commit is contained in:
+4
-3
@@ -8888,7 +8888,7 @@ function cleardoubleslashes ($path) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Is current ip in give list?
|
||||
* Is the current ip in a given list?
|
||||
*
|
||||
* @param string $list
|
||||
* @return bool
|
||||
@@ -8903,8 +8903,9 @@ function remoteip_in_list($list) {
|
||||
}
|
||||
|
||||
$list = explode("\n", $list);
|
||||
foreach ($list as $subnet) {
|
||||
$subnet = trim($subnet);
|
||||
foreach ($list as $line) {
|
||||
$tokens = explode('#', $line);
|
||||
$subnet = trim($tokens[0]);
|
||||
if (address_in_subnet($clientip, $subnet)) {
|
||||
$inlist = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user