Details
Description
If you call create_user_record from a script or anywhere where $_SERVER['REMOTE_ADDR'] and such are not defined. It will try to insert a user record where lastip is null. This doesn't work because the user table has a non-null constraint on lastip. As a result, things like ldap authentication are broken (see last few comments on MDL-17682).
Suggestions:
- Remove non-null constraint. This makes the most sense to me because a user that has just be created by a script shouldn't have a lastip.
- default to '127.0.0.1' in case getremoteaddr() returns null