Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use getremoteaddr() to get client address.

 CVS: ----------------------------------------------------------------------
  • Loading branch information...
commit 596194273257ca24e4886478fdca04361e98b629 1 parent f97ab1e
paca70 authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/moodlelib.php
View
4 lib/moodlelib.php
@@ -752,7 +752,7 @@ function create_user_record($username, $password, $auth='') {
$newuser->password = md5($password);
$newuser->lang = $CFG->lang;
$newuser->confirmed = 1;
- $newuser->lastIP = $REMOTE_ADDR;
+ $newuser->lastIP = getremoteaddr();
$newuser->timemodified = time();
if (insert_record("user", $newuser)) {
@@ -846,7 +846,7 @@ function authenticate_user_login($username, $password) {
} else {
add_to_log(0, "login", "error", $_SERVER['HTTP_REFERER'], $username);
$date = date('Y-m-d H:i:s');
- error_log("$date\tfailed login\t".$_SERVER['REMOTE_ADDR']."\t".$_SERVER['HTTP_USER_AGENT']."\t$username");
+ error_log("$date\tfailed login\t".getremoteaddr()."\t".$_SERVER['HTTP_USER_AGENT']."\t$username");
return false;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.