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

Notice during invalid login token validation for unknown user

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.7.6, 3.8.2, 3.9
    • Fix Version/s: 3.7.6, 3.8.3
    • Component/s: Authentication
    • Labels:
    • Testing Instructions:
      Hide
      1. Login as admin
      2. Navigate to Development > Debugging in Site administration
      3. Set Debug messages to Developer, and Display debug messages to Yes
      4. Save changes
      5. Log out
      6. Visit login page
      7. Clear session cookie *
      8. Attempt to login with a non-existing account
      9. Confirm you don't see a PHP notice
      10. Confirm the login form reloads with a warning stating "Invalid login, please try again"

      * We need to delete the MoodleSession cookie, which also simulates a session timing out - you can use your browser developer tools to inspect, then go to Application / Storage / Cookies and delete the cookie:

      Show
      Login as admin Navigate to Development > Debugging in Site administration Set Debug messages to Developer , and Display debug messages to Yes Save changes Log out Visit login page Clear session cookie * Attempt to login with a non-existing account Confirm you don't see a PHP notice Confirm the login form reloads with a warning stating "Invalid login, please try again" * We need to delete the MoodleSession cookie, which also simulates a session timing out - you can use your browser developer tools to inspect, then go to Application / Storage / Cookies and delete the cookie:
    • Affected Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE, MOODLE_38_STABLE
    • Pull 3.8 Branch:
    • Pull Master Branch:

      Description

      The following notice is triggered after a failed validation of user login token, where the user account doesn't exist:

      Notice: Trying to get property 'id' of non-object in /var/www/html/lib/moodlelib.php on line 4427

      Because the $user object isn't guaranteed to exist here

        Attachments

          Activity

            People

            Assignee:
            pholden Paul Holden
            Reporter:
            pholden Paul Holden
            Peer reviewer:
            Peter Dias
            Integrator:
            Eloy Lafuente (stronk7)
            Tester:
            Janelle Barcega
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              11/May/20

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 47 minutes
                47m