From ed28d08878ce66ec73155da0b0494eb01faa350b Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Sun, 21 Mar 2010 15:03:26 +0000 Subject: [PATCH] moodlelib MDL-20110 - allow remoteip_in_list to return true for cli access Previously it always failed and restricted access for users blocking ips and running cron from cli --- lib/moodlelib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index e97f4f4b932..4d0e1d6589b 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -8432,6 +8432,12 @@ function cleardoubleslashes ($path) { function remoteip_in_list($list){ $inlist = false; $client_ip = getremoteaddr(); + + if(!$client_ip){ + // ensure access on cli + return true; + } + $list = explode("\n", $list); foreach($list as $subnet) { $subnet = trim($subnet);