Data room terms: event listener, gate and revocation
The notification event fired when the terms page is saved, the portal acceptance gate with its version fingerprint, and the data handling of per-user re-acceptance.
Terms handling has three parts: the portal gate and acceptance, an event listener that notifies users after the terms page is saved, and the revocation on the user form. The event listener is neither a menu item nor a screen.
Data model
Table names carry the installation's own prefix in the database.
| Table | Role | Main fields |
|---|---|---|
doc_room_consent | the acceptance | user_id, store_id, source_ref (information:ID or cms:ID), content_hash (SHA-1, 40), language_id, ip, user_agent, date_added, revoked_at, revoked_by |
doc_room_event | timeline | terms_changed, consent_reset, acceptance |
event (framework) | listener registration | dlbt_room_terms_changed |
person.language_id | language of the notification (0 = store default) | — |
Portal gate and acceptance
- The theme puts the requirement into the configuration: the source reference and the SHA-1 fingerprint of all languages of the terms text (the version). If there is a requirement and the user has no valid acceptance (same store, source, fingerprint, not revoked), every room endpoint refuses.
- Acceptance (POST, session token, accept = 1): recorded with user, store, source, fingerprint, language, IP and browser; without an ID "Your acceptance could not be recorded. Please try again."; on success a redirect to the room, a log line and a timeline event.
- Changing any language produces a new fingerprint, so the gate asks for re-acceptance at the next sign-in on its own.
Notification event
- Trigger: the framework event after an information page edit is saved.
- For every store (default and others) it checks in the data room theme settings whether the terms page is the information page just saved.
- On a match every user of the store with access valid today receives an e-mail in the recipient's language, using the mail module template (module: Folders, event:
room_terms_changed; variables:##recipient_name##,##client_name##,##room_name##,##link##,##button##), or a built-in text without a template, through the central mail dispatch path, on behalf of the client. - A timeline event per user (
terms_changed) and a log line. Mail errors do not block saving; they are written to the log.
Revocation on the user form
- Right (
consentreset) and a valid user ID. - Every not yet revoked acceptance of the user gets the revocation time and the revoking user.
- Read-back; if the revocation column is missing, a message reports the missing migration; if there was nothing to revoke: "There is no valid acceptance to revoke."
- Timeline event (
consent_reset), success message. No e-mail.
Permissions
- The event listener has no function key: whoever can save the information page triggers it.
- Revocation:
user/userconsentreset(base package); the card shows only with this right and for an existing user. - The portal gate runs server-side on every room endpoint.
Known limitations
The listener only watches information pages; changing terms chosen from a content management article sends no e-mail, because there is no such listener in the code. The captions of the users menu group are hard-coded in English and visible only to the super administrator.