0, 'error' => 'Kein Server ausgewählt' ] ) ); } if ( empty( $idLong ) ){ die( json_encode( [ 'status' => 0, 'error' => 'Keine Identität ausgewählt' ] ) ); } if ( empty( $_REQUEST['eventId'] ) || empty( $_REQUEST['votings'] ) ){ die( json_encode( [ 'status' => 0, 'error' => 'Daten unvollständig' ] ) ); } $votings = yaml_parse( $_REQUEST['votings'] ); if ( ! $votings ){ die( json_encode( [ 'status' => 0, 'error' => 'Ungültige YAML-Daten' ] ) ); } foreach ( $votings as &$voting ){ unset( $voting['period_start'], $voting['period_end'] ); } $msg = new ParTCP_Outgoing_Message( $serverLong, $idLong, 'event-update-request' ); $msg->set( 'Event-Id', $_REQUEST['eventId'] ); $msg->set( 'Votings', $votings ); $response = pas_check_response( $msg->send() ); if ( is_string( $response ) ){ die( json_encode( [ 'status' => 0, 'error' => $response->rawMessage ] ) ); } echo json_encode( [ 'status' => 1, 'redirect' => "{$BaseUrl}/event/{$_REQUEST['eventId']}" ] ); // end of file ajax/import_votings.php