If I restrict booking for an event to registered users only, its possible to book multiple times for an rsvp.
Problem is that if only WP users are allowed to book, the id of the user is not part of the post request.
This patch fixes this by using get_current_user_id() as default and the value of post request only if user must not be registered.
— /home/wordpress/events-made-easy/eme_rsvp.php 2018-01-14
12:38:20.000000000 +0100 +++ eme_rsvp.php 2018-01-30
00:28:47.091687221 +0100 @@ -612,9 +612,12 @@
$attendees = eme_get_attendees_for($event_id);
if ($event[‘event_properties’][‘person_only_once’]) {
$already_registered=0;
– $booker = eme_get_person_by_post();
+ $bookerId = get_current_user_id();
+ if (!$registration_wp_users_only) {
+ $bookerId = eme_get_person_by_post()[‘person_id’];
+ }
foreach ($attendees as $attendee) {
– if ($attendee[‘person_id’]==$booker[‘person_id’])
+ if ($attendee[‘person_id’]==$bookerId)
$already_registered=1;
}
if ($already_registered) {