/
[in-bulletin] Anonymous user is persisting data [5.2.2-B1]
[in-bulletin] Anonymous user is persisting data [5.2.2-B1]
There are 2 ways of persisting data:
- in the current session - is only valid during current user session and disappears afterwards
- across all sessions - is valid for current and future user sessions and never disappears
The 2nd type of data doesn't make sense to have, when user isn't yet logged-in on website, because upon next visit same data can't be reused. In particular the In-Bulletin module makes use of following data regardless of user being logged-in or not:
- checkboxes on the new topic creation page by default have value (checked or not) based on logged-in user settings:
- "Disable BB codes"
- "Disable smileys"
- "Show signature" - this doesn't make sense to have for anonymous users, because they don't have "Preferences" page, where they can enter their signature
- "Notify me about replies" - this doesn't make sense to have for anonymous users, because they don't have profile, where they can enter their e-mail address for notifications
- checkboxes on topic reply form (new post creation) page by default have value (checked or not) based on logged-in user settings:
- "Disable BB codes"
- "Disable smileys"
- "Show signature" - this doesn't make sense to have for anonymous users, because they don't have "Preferences" page, where they can enter their signature
- checkboxes on new private message form - form is accessible for logged-in user so don't event bother populating default values in there when anonymous user is browsing website
- when displaying topic posts a user setting is read, that specifies whatever he/she wants to see signatures of posters
Solution
- in the "OnAfterConfigRead" events for following units don't execute any code that uses session for anonymous user:
- bb - topics
- bb-post - topic posts
- private-message - private messages
- don't show any poster signatures for anonymous users