"MDL-16954, get rid of remote_addr notice on cli, set ip = 0.0.0.0 in mdl_log table when accessed from cli"

This commit is contained in:
dongsheng
2008-12-11 05:17:02 +00:00
parent 50a8526252
commit 576fe29a1c
2 changed files with 8 additions and 1 deletions
+3
View File
@@ -1880,6 +1880,9 @@ function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user
}
$REMOTE_ADDR = getremoteaddr();
if (empty($REMOTE_ADDR)) {
$REMOTE_ADDR = '0.0.0.0';
}
$timenow = time();
$info = addslashes($info);
+5 -1
View File
@@ -7511,7 +7511,11 @@ function getremoteaddr() {
return cleanremoteaddr($_SERVER['HTTP_X_FORWARDED_FOR']);
}
}
return cleanremoteaddr($_SERVER['REMOTE_ADDR']);
if (!empty($_SERVER['REMOTE_ADDR'])) {
return cleanremoteaddr($_SERVER['REMOTE_ADDR']);
} else {
return null;
}
}
/**