mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 20:50:21 +01:00
MDL-29396 core: ip blocking will be bypassed for cli scripts - Thanks Petr
This commit is contained in:
parent
79b0fece1f
commit
ade30ad3c4
@ -816,12 +816,14 @@ if (!empty($CFG->customscripts)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// in the first case, ip in allowed list will be performed first
|
if (CLI_SCRIPT and !defined('WEB_CRON_EMULATED_CLI') and !PHPUNIT_SCRIPT) {
|
||||||
// for example, client IP is 192.168.1.1
|
// no ip blocking
|
||||||
// 192.168 subnet is an entry in allowed list
|
} else if (!empty($CFG->allowbeforeblock)) { // allowed list processed before blocked list?
|
||||||
// 192.168.1.1 is banned in blocked list
|
// in this case, ip in allowed list will be performed first
|
||||||
// This ip will be banned finally
|
// for example, client IP is 192.168.1.1
|
||||||
if (!empty($CFG->allowbeforeblock)) { // allowed list processed before blocked list?
|
// 192.168 subnet is an entry in allowed list
|
||||||
|
// 192.168.1.1 is banned in blocked list
|
||||||
|
// This ip will be banned finally
|
||||||
if (!empty($CFG->allowedip)) {
|
if (!empty($CFG->allowedip)) {
|
||||||
if (!remoteip_in_list($CFG->allowedip)) {
|
if (!remoteip_in_list($CFG->allowedip)) {
|
||||||
die(get_string('ipblocked', 'admin'));
|
die(get_string('ipblocked', 'admin'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user