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

Replace add_to_log with an event trigger - User

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.6
    • Component/s: Events API, Logging
    • Labels:
    • Testing Instructions:
      Hide
      Test 1
      1. Run unit tests. Including the LDAP ones (you will need to enable special LDAP config in your phpunit.xml)
      Test 2
      1. Open a tab to <yoursite>/report/log/index.php?id=1.
      2. Visit a course and view the list of enrolled users.
      3. View one of the user's profile page.
      4. Refresh the log tab and check that the action reads 'user view' with the link taking you to the user profiles page and the information being the name of the user who was viewed.
      5. Login using LDAP.
      6. Refresh the log tab and check that the action reads 'user login' with the link taking you to the user profiles page and the information being the id of the user who logged in.
      7. Login using Shibboleth.
      8. Refresh log tab and check that it's the same as above.
      9. Visit <yoursite>/login/change_password.php and change your password.
      10. Refresh the log tab and check that the action reads 'user updated' with the link taking you to the user profiles page and the information being empty.
      11. Visit <yoursite>/user/index.php?id=<courseid> where courseid is the id of a course that has enrolled users.
      12. Refresh the log tab and check that the action reads 'user view all' with the link taking you to page listed in the last step and the information being empty.
      Show
      Test 1 Run unit tests. Including the LDAP ones (you will need to enable special LDAP config in your phpunit.xml) Test 2 Open a tab to <yoursite>/report/log/index.php?id=1. Visit a course and view the list of enrolled users. View one of the user's profile page. Refresh the log tab and check that the action reads 'user view' with the link taking you to the user profiles page and the information being the name of the user who was viewed. Login using LDAP. Refresh the log tab and check that the action reads 'user login' with the link taking you to the user profiles page and the information being the id of the user who logged in. Login using Shibboleth. Refresh log tab and check that it's the same as above. Visit <yoursite>/login/change_password.php and change your password. Refresh the log tab and check that the action reads 'user updated' with the link taking you to the user profiles page and the information being empty. Visit <yoursite>/user/index.php?id=<courseid> where courseid is the id of a course that has enrolled users. Refresh the log tab and check that the action reads 'user view all' with the link taking you to page listed in the last step and the information being empty.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE
    • Pull Master Branch:
      MDL-40045_master
    • Story Points:
      20
    • Sprint:
      BACKEND Sprint 6

      Description

      Replace the add_to_log calls for the following area, with a call to the get_legacy_logdata function in the event class.

      /user/index.php:89: add_to_log($course->id, 'user', 'view all', 'index.php?id='.$course->id, '');
      /user/view.php:191: add_to_log($course->id, "user", "view", "view.php?id=$user->id&course=$course->id", "$user->id");
      /auth/ldap/auth.php:1739: add_to_log(SITEID, 'user', 'login', "view.php?id=$USER->id&course=".SITEID,
      /auth/shibboleth/index.php:65: add_to_log(SITEID, 'user', 'login', "view.php?id=$USER->id&course=".SITEID, $USER->id, 0, $USER->id);
      /login/change_password.php:123: add_to_log($course->id, 'user', 'change password', "view.php?id=$USER->id&course=$course->id", "$USER->id");

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              markn Mark Nelson
              Reporter:
              abgreeve Adrian Greeve
              Peer reviewer:
              Petr Skoda
              Integrator:
              Dan Poltawski
              Tester:
              David Monllaó
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/13