Changeset 13906 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/attend-event.php
- Timestamp:
- 07/17/2024 11:19:52 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/routes/user/attend-event.php
r13753 r13906 32 32 33 33 public function handle( int $event_id ): void { 34 $nonce_name = '_attendee_nonce'; 35 if ( isset( $_POST['_attendee_nonce'] ) ) { 36 $nonce_value = sanitize_text_field( wp_unslash( $_POST['_attendee_nonce'] ) ); 37 if ( ! wp_verify_nonce( $nonce_value, $nonce_name ) ) { 38 $this->die_with_error( esc_html__( 'You are not authorized to change the attendance mode of this attendee', 'gp-translation-events' ), 403 ); 39 } 40 } 34 41 $user = wp_get_current_user(); 35 42 if ( ! $user ) { … … 47 54 } 48 55 49 $attendee = $this->attendee_repository->get_attendee_for_event_for_user( $event->id(), $user_id ); 56 $attendee = $this->attendee_repository->get_attendee_for_event_for_user( $event->id(), $user_id ); 57 $is_remote_attendee = isset( $_POST['attend_remotely'] ); 58 50 59 if ( $attendee instanceof Attendee ) { 51 60 if ( $attendee->is_contributor() ) { … … 54 63 $this->attendee_repository->remove_attendee( $event->id(), $user_id ); 55 64 } else { 56 $attendee = new Attendee( $event->id(), $user_id );65 $attendee = new Attendee( $event->id(), $user_id, false, false, array(), $is_remote_attendee ); 57 66 $this->attendee_adder->add_to_event( $event, $attendee ); 58 67 }
Note: See TracChangeset
for help on using the changeset viewer.