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

No log entry is produced when a teacher unenrols a student manually

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.2
    • Fix Version/s: BACKEND
    • Component/s: Enrolments, Logging
    • Labels:
    • Testing Instructions:
      Hide

      visit course administration->users->enrolled users
      unenrol any user by clicking "unenrol" in the column "Enrollment methods".
      View latest log in mdl_log --> you will not find any hint.

      Show
      visit course administration->users->enrolled users unenrol any user by clicking "unenrol" in the column "Enrollment methods". View latest log in mdl_log --> you will not find any hint.
    • Workaround:
      Hide

      Could be changed by adding add_to_log(...);

      enrol/unenroluser.php line:69f

      if ($confirm && confirm_sesskey()) {
          $plugin->unenrol_user($instance, $ue->userid);
      	add_to_log($course->id, 'course', 'unenrol', '../enrol/users.php?id='.$course->id, 'unenrol userid '.$ue->userid); //there should be userid somewhere!
          redirect($returnurl);
      }

      Show
      Could be changed by adding add_to_log(...); enrol/unenroluser.php line:69f if ($confirm && confirm_sesskey()) { $plugin->unenrol_user($instance, $ue->userid); add_to_log($course->id, 'course', 'unenrol', '../enrol/users.php?id='.$course->id, 'unenrol userid '.$ue->userid); //there should be userid somewhere! redirect($returnurl); }
    • Affected Branches:
      MOODLE_22_STABLE

      Description

      If a teacher unenrolls a student while viewing course administration->users->enrolled users, no log entry is produced. This can be a problem when users are unenrolled and the agent can not be identified.

      While self unenrollment produces a log entry (enrol/manual/unenrolself.php:line 54), unenrollment by staff (enrol/unenroluser.php:line 69f) will not produce any logging.

      Could be changed by adding add_to_log(...);

      enrol/unenroluser.php line:69f

      if ($confirm && confirm_sesskey()) {
          $plugin->unenrol_user($instance, $ue->userid);
      	add_to_log($course->id, 'course', 'unenrol', '../enrol/users.php?id='.$course->id, 'unenrol userid '.$ue->userid); //there should be userid somewhere!
          redirect($returnurl);
      }

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: