]> git.mjollnir.org Git - moodle.git/commit
user preferences: MDL-17123 cope correctly with multiple sessions.
authortjhunt <tjhunt>
Tue, 4 Nov 2008 10:49:31 +0000 (10:49 +0000)
committertjhunt <tjhunt>
Tue, 4 Nov 2008 10:49:31 +0000 (10:49 +0000)
commit2660377f72ec22643b3fa58ad95651cd421b5b66
tree5740daa9b1f42e973a351d77b121666fed707241
parent2bea836d9bca3c8e9c608f2b018cae7461628656
user preferences: MDL-17123 cope correctly with multiple sessions.

This steals the logic from accesslib used to detect dirty contexts and so reload cached access data when permissions are changed.

Here, we track when user preferences are changed, so that if necessary we can trigger a reaload. This helps in two situations:
1. When you are logged into Moodle with two different browsers.
2. When someone else changes one of your preferences.
After this change, you will see the changed user pref immediately in all sessions.

This adds one cheap DB query to any page that tries to access a user preference (which is almost all of them, because of deciding whether to show the messaging pop-up). It adds a few more queries in the cases when a user preference is changed. This is in the name of correctness.
lib/moodlelib.php