Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-9040

Invalid Course Certificate Sent out to admin users in course

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.9.15, 3.10.11, 3.11.8, 4.0.2
    • None
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE

      Course certificates are sent out regardless of completion criteria for any system level admin users enrolled in a course as a student.

      To replicate:

      1. Add a course certificate to a course that is only available under certain restrictions.
      2. Enrol a system level admin user as a student in the course
      3. Once the "\mod_coursecertificate\task\issue_certificates_task" scheduled task runs, it will issue a certificate the that user regardless of any criteria

      The issue is from mod/coursecertificate/classes/helper.php, specifically the get_users_to_issue function:

       

                // Filter only users without 'viewall' capabilities and with access to the activity.
                $users = [];
                foreach ($filteredusers as $filtereduser) {
                    if (info_module::is_user_visible($cm, $filtereduser->id, false)) {
                        $users[] = $filtereduser;
                    }
                }
                return $users;
      

      The "is_user_visible" will return true for admin users in the course enrolled as a student.  The logic should be changed here to account for any users enrolled in the course with elevated permissions. 

       

       

            Unassigned Unassigned
            justin.haire@moodle.com Justin Haire
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.