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.
// 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 = '';
}
}