Events Made Easy Forums Bug fixed or feature request implemented Multiple bookings possible if restricted to wp users

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #57514
    Anonymous
    Inactive

    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) {

    #57519
    Franky
    Keymaster

    Hi, you’re correct about this, but your code isn’t totally correct as it doesn’t check if WP membership is required for this event.
    However, just moving some lines up in the code (and deleting 1 line) should fix this:
    https://plugins.trac.wordpress.org/changeset/1821615/

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.
Scroll to Top