Closed dilab closed 10 years ago
The point of that code is to only query the DB once on initial login. Uncommenting that line adds 2+ queries to each page.
Without uncommenting the line. Here is the problem: A moderator comes to the page, and when he logins, he will not be able to see the "Moderate" button.
Reason is because the session "Forum.lastVisit" is set before moderator logins.
Yes, that's a well known problem that occurs within any kind of application or software. It's the reason session regeneration/expiration exists, or the bootstrapping of applications when a user logs in. This kind of logic should not be done on every page.
If you really need this functionality, you're welcome to use your fork.
Thanks for verification.
It should not only check the Forum session. The moderator permission will never be updated.
Even for a non-login user, you have a Forum.lastVisit session value. If you only check the Forum session, the moderators' permission will not work correctly.