Moodle
  1. Moodle
  2. MDL-32510

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

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • 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
    • Epic Link:
    • Rank:
      39402

      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);
      }
      

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

          thanks for the report and patch proposal

          Show
          Petr Škoda added a comment - thanks for the report and patch proposal
          Hide
          Josh Marshall added a comment -

          This also affects 23 Stable, 24 Stable, and 25 Stable at least.

          Show
          Josh Marshall added a comment - This also affects 23 Stable, 24 Stable, and 25 Stable at least.

            People

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

              Dates

              • Created:
                Updated: