]> git.mjollnir.org Git - moodle.git/commitdiff
mod/chat - use empty value instead of erroring out if $USER->lastIP and getremoteaddr...
authormartinlanghoff <martinlanghoff>
Wed, 19 Apr 2006 21:22:36 +0000 (21:22 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Apr 2006 21:22:36 +0000 (21:22 +0000)
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.

mod/chat/lib.php

index dad87133a0b7d9cfb2e92fe6e44597d9db8738b9..31382401fa9a76f4fd9aba1b15aaf8770021ed4d 100644 (file)
@@ -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 = '';
             }
         }