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

MFA report empty

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.5.4
    • Authentication
    • MOODLE_405_STABLE
    • MDL-85609-405
    • MDL-85609-500
    • Hide
      1. Log in as admin
      2. Navigate to Reports > MFA reports > All factor report in site administration
      3. Confirm the Total users column of the report contains number of users relevant to each authentication type
      4. Confirm the Pending MFA column contains the same count(s) (note: this is based on a brand new install, if there is historical MFA data then the values will differ)
      5. Set lookback period to "1 year"
      6. Confirm the Not logged in column contains the same count(s) (see caveat above, same applies here)
      Show
      Log in as admin Navigate to Reports > MFA reports > All factor report in site administration Confirm the Total users column of the report contains number of users relevant to each authentication type Confirm the Pending MFA column contains the same count(s) ( note: this is based on a brand new install, if there is historical MFA data then the values will differ ) Set lookback period to "1 year" Confirm the Not logged in column contains the same count(s) ( see caveat above, same applies here )
    • Hide

      Code verified against automated checks.

      Checked MDL-85609 using repository: https://github.com/paulholden/moodle

      More information about this report

      Built on: Thu May 29 14:18:27 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-85609 using repository: https://github.com/paulholden/moodle MOODLE_405_STABLE (0 errors / 0 warnings) [branch: MDL-85609-405 | CI Job ] MOODLE_500_STABLE (0 errors / 0 warnings) [branch: MDL-85609-500 | CI Job ] main (0 errors / 0 warnings) [branch: MDL-85609 | CI Job ] More information about this report Built on: Thu May 29 14:18:27 UTC 2025

      Some issues in the way the resulsets are being proccessed in MFA report.

      • function: factors_in_use_table(), factors_lock_table()
      • file: admin/tool/mfa/classes/output/renderer.php

      The query used is:

      $alluserssql = "SELECT auth,
                              COUNT(id) 
                              FROM {user}
                              WHERE deleted = 0
                              AND suspended = 0
                          GROUP BY auth";
      $allusersinfo = $DB->get_records_sql($alluserssql, []); 

      The code to fill the table is:

      $row[] = $allusersinfo[$authtype]->count ?? '-'; 

      But "count" is always null. Maybe the query above should add "as count" to name the count field of the resultset. Something like this:

      $alluserssql = "SELECT auth,
                              COUNT(id) as count
                              FROM {user}
                              WHERE deleted = 0
                              AND suspended = 0
                          GROUP BY auth";
      $allusersinfo = $DB->get_records_sql($alluserssql, []);

      There are some other similar occurrences in this file.

       

       

            pholden Paul Holden
            emilio.ah Emilio Arjona Heredia
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

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