Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-19628

create_user_record requires ipaddress, does not work from scripts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9.10, 2.0
    • 1.9.5
    • Libraries
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE, MOODLE_20_STABLE

      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

        1. mdl-19628-20.diff
          0.5 kB
        2. mdl-19628-19.diff
          0.5 kB
        3. mdl-19628-18.diff
          0.5 kB

            dougiamas Martin Dougiamas
            trick Alan Trick (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.