-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force unconfirmed tickets to log in. #1421
Conversation
public_html/wp-content/plugins/camptix/addons/require-login.php
Outdated
Show resolved
Hide resolved
Unsure if this has been tested, but could this logic be extended to support users transferring their tickets to another username? Or is that supported elsewhere? I suppose on transfer of a ticket, it would just switch back to |
Pretty sure that was just because I used I've tested out the edit ticket flow and a logged out user can correctly edit a ticket bought before the require-login, and not edit after 👍🏻 Unfortunately, in testing the regular ticket purchase flow I'm seeing this error: I also realized the current redirect probably doesn't pass through the reservation info, but I was interrupted by ^ before I could properly test. A reservation is set up on a ticket (in the edit-ticket screen), and ends up being a link like |
Oh, the error is because |
I think I've covered all the relevant parameters. Can I get another review? |
* Get sanitized ticket parameters from request array. | ||
* | ||
* @param array $request_data Array of request data to sanitize. | ||
* @return array Sanitized parameters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i guess technically we could return an empty array too, if no parameters match the allowed list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, $args will return empty if nothing matches. Do you think we should note that here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, @return array Empty array or sanitized parameters.
or similar would work.
} | ||
if ( ! is_user_logged_in() ) { | ||
|
||
// Temporary: We don't want to block users from editing tickets unless they are unconfirmed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how long will this be temporary 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a script that will tell me when there are no more tickets purchased without accounts. Should be about February 2025.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
untested, but code looks ok.
I will test it & get back here, found any issue. |
Fixes #1420
Props mkrndmane, ryelle.
This PR forces login for editing tickets that are currently unconfirmed.
Changes
user_must_confirm_ticket
that checks if the ticket is unconfirmed. Referencetix_
parameters found in$_REQUEST
to the final destination. Referenceisset( $_REQUEST['tix_tickets_selected'] )
before passing along the parameters. I would assume we could pass them along in all cases.How to test
I don't know who will use this ticket yet
Attendees
post through the admin interface list:tix_username
is set to[[ unconfirmed ]]
tix_username
is set to the user that was used to log in.[[ unconfirmed ]]
.