From: martinlanghoff Date: Wed, 19 Apr 2006 21:22:36 +0000 (+0000) Subject: mod/chat - use empty value instead of erroring out if $USER->lastIP and getremoteaddr... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f83edcb114fa2b6ac1313d5c6327bb1255c2783e;p=moodle.git mod/chat - use empty value instead of erroring out if $USER->lastIP and getremoteaddr() don't yield any interesting value Sometimes we can't get any useful IP for the user -- and this may even be a valid situation. So fudge an empty value -- the DB needs it as the IP field is NOT NULL. --- diff --git a/mod/chat/lib.php b/mod/chat/lib.php index dad87133a0..31382401fa 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -390,11 +390,11 @@ function chat_login_user($chatid, $version, $groupid, $course) { // Sometimes $USER->lastIP is not setup properly // during login. Update with current value if possible - // or error out clearly. + // or provide a dummy value for the db if (empty($chatuser->ip)) { $chatuser->ip = getremoteaddr(); if (empty($chatuser->ip)) { - error("Cannot determine the IP address of the user!"); + $chatuser->ip = ''; } }