Automatically disable Attendance UI #1055
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Camptix Attendance UI must be turned on to reveal attendee info with a link without user authentication. Currently, we trust organisers to disable the UI when they no longer need it. That can lead to the UI being open and the potential of attendee info leakage.
To mitigate the potential issues, this PR automatically disabled the UI after two weeks from generating the code.
It is done simply by saving the time when the secret was generated and comparing that when the link or Camptix settings are visited. If the link is older than two weeks, the UI will be disabled and the secret removed.
This could have been done with a cron job or event, but that just felt too complicated.
Fixes #620
Screenshots
How to test the changes in this Pull Request:
wp-admin/edit.php?post_type=tix_ticket&page=camptix_options&tix_section=attendance-ui
$secret_expiry
value (set to 1 second for example)