]> git.mjollnir.org Git - moodle.git/commit
accesslib: get_user_courses_bycap() is less of a piggy now...
authormartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:04:23 +0000 (07:04 +0000)
committermartinlanghoff <martinlanghoff>
Wed, 19 Sep 2007 07:04:23 +0000 (07:04 +0000)
commit573674bf471d453f8dca96458635af6454914d18
tree525f75fd0b34db67975f061ecdf38e20dde42782
parentaeb3916b7a0e0470d9492e5a9bbeecb9bc82cfc4
accesslib: get_user_courses_bycap() is less of a piggy now...

get_user_courses_bycap() replaces get_courses_bycap_fromsess().

Using a combination of in-DB enrolments and in-session capability
checks, we narrow down the courses we fetch from the DB for checking.

This patch adds a small DB query, and has has a moderate impact on
the timings observable on my laptop (~300ms?), but reduces
*significantly* the bandwidth used, which in cluster environments
with frontends separate from backends has a serious impact.
lib/accesslib.php
lib/datalib.php