Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29602 cleanup and improve acccesslib META
  3. MDL-29669

delay loading of USER->access and check for new enrolments only after login and loginas

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 2.1
    • Enrolments, Roles / Access
    • None
    • MOODLE_21_STABLE

      The problem is that session_set_user() is doing unrelated loading of capabilities and enrolment checks:
      1/ we need the USER->access only in has_capability() and friends
      2/ the $USER is not yet available inside session_set_user() which complicates everything in accessslib.php
      3/ enrolment checks may be very slow in some plugins, it does not make much sense to do it every time we try to fake global $USER

      Solution is:
      1/ delay loading of $USER->access till the time it is really necessary
      2/ do enrol_check_plugins($user); only in login-stlye scripts
      3/ clean up all places that are related to these changes

            skodak Petr Skoda
            skodak Petr Skoda
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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