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

Performance: checking group enrolment key always iterates through all groups

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9, 2.0
    • Component/s: Enrolments
    • Labels:
      None
    • Environment:
      n/a
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      low hanging fruit:

      check_group_entry in enrol.php has a loop on groups, currently it iterates all the groups all the time:

      foreach ($groups as $group) {
      if ( !empty($group->enrolmentkey) and (stripslashes($password) == $group->enrolmentkey) )

      { $ingroup = $group->id; }

      }

      maybe someone can put a break in when there is a match.

        Attachments

          Activity

            People

            Assignee:
            poltawski Dan Poltawski
            Reporter:
            wieloch Joe Wieloch
            Tester:
            Nobody
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              3/Mar/08