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

Replace add_to_log with an event trigger - User

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5
    • 2.6
    • Events API, Logging
    • MOODLE_25_STABLE
    • MOODLE_26_STABLE
    • MDL-40045_master
    • 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.
    • 20
    • 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

              markn Mark Nelson
              abgreeve Adrian Greeve
              Petr Skoda Petr Skoda
              Dan Poltawski Dan Poltawski
              David Monllaó David Monllaó
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo, David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                18/Nov/13