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

Replace add_to_log with an event trigger - misc

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5, 2.7
    • Fix Version/s: 2.7
    • Component/s: Events API, Logging
    • Labels:
    • Testing Instructions:
      Hide
      Test 1
      1. Run the unit tests mnet/tests/events_test.php and lib/tests/events_test.php and ensure all passes.
      Test 2
      1. On one tab open up to <yoursite>/report/log/index.php?id=1 - use this report to get the logs when asked to view them later on in the testing instructions.
      2. Visit <yoursite>/admin/mnet/access_control.php and enter some data in the form and submit. Check that there is a log entry for 'admin/mnet add'.
      3. On the page listing the access control you just created, under the column 'Access level' select the link next to the access level to change the status. Check that there is a log entry for 'admin/mnet update'.
      4. Visit <yoursite>/admin/settings.php?section=manageauths and enable self registration.
      5. Visit <yoursite>/admin/settings.php?section=messagesettingemail and set the SMTP hosts to something invalid.
      6. Open another browser and sign up for an account, the verification email should fail when you finalise the sign up form. Check that there is a 'library mailer' log entry.
      Show
      Test 1 Run the unit tests mnet/tests/events_test.php and lib/tests/events_test.php and ensure all passes. Test 2 On one tab open up to <yoursite>/report/log/index.php?id=1 - use this report to get the logs when asked to view them later on in the testing instructions. Visit <yoursite>/admin/mnet/access_control.php and enter some data in the form and submit. Check that there is a log entry for 'admin/mnet add'. On the page listing the access control you just created, under the column 'Access level' select the link next to the access level to change the status. Check that there is a log entry for 'admin/mnet update'. Visit <yoursite>/admin/settings.php?section=manageauths and enable self registration. Visit <yoursite>/admin/settings.php?section=messagesettingemail and set the SMTP hosts to something invalid. Open another browser and sign up for an account, the verification email should fail when you finalise the sign up form. Check that there is a 'library mailer' log entry.
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-40051_master
    • Story Points:
      20
    • Sprint:
      BACKEND Sprint 9

      Description

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

      lib
      /lib/uploadlib.php:772: add_to_log($courseid, 'upload', 'upload', ((!$nourl) ? substr($_SERVER['HTTP_REFERER'], 0, 100) : ''), $newfilepath);
      /lib/uploadlib.php:786: add_to_log(0, 'upload', 'infected', $_SERVER['HTTP_REFERER'], $oldfilepath, 0, $userid);
      /lib/moodlelib.php:5791: add_to_log(SITEID, 'library', 'mailer', qualified_me(), 'ERROR: '. $mail->ErrorInfo);

      mnet
      /mnet/lib.php:446: add_to_log(SITEID, 'admin/mnet', 'update', 'admin/mnet/access_control.php',
      /mnet/lib.php:455: add_to_log(SITEID, 'admin/mnet', 'add', 'admin/mnet/access_control.php',

      report
      /report/questioninstances/index.php:38: add_to_log(SITEID, "admin", "report questioninstances", "report/questioninstances/index.php?qtype=$requestedqtype", $requestedqtype);

      admin/tool
      /admin/tool/capability/index.php:95: add_to_log(SITEID, "admin", "tool capability", "tool/capability/index.php", count($capabilities));

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              markn Mark Nelson
              Reporter:
              abgreeve Adrian Greeve
              Peer reviewer:
              Rajesh Taneja
              Integrator:
              Damyon Wiese
              Tester:
              Andrew Nicols
              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:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/May/14