0, 'error' => 'Kein Server ausgewählt' ] ) ); } if ( empty( $idLong ) ){ die( json_encode( [ 'status' => 0, 'error' => 'Keine Identität ausgewählt' ] ) ); } if ( empty( $_REQUEST['participantId'] ) ){ die( json_encode( [ 'status' => 0, 'error' => 'Daten unvollständig: ' . var_export( $_REQUEST, TRUE ) ] ) ); } $msg = new ParTCP_Outgoing_Message( $serverLong, $idLong, 'participant-update-request' ); $msg->set_date(); $msg->set( 'Participant-Id', $_REQUEST['participantId'] ); if ( ! empty( $_REQUEST['flags'] ) ){ $msg->set( 'Flags', array_map( 'trim', explode( "\n", trim( $_REQUEST['flags'] ) ) ) ); } if ( ! empty( $_REQUEST['attributes'] ) ){ $lines = explode( "\n", $_REQUEST['attributes'] ); $attr = []; foreach ( $lines as $line ){ $parts = array_map( 'trim', explode( ':', $line ) ); if ( ! empty( $parts[1] ) ){ $attr[ $parts[0] ] = $parts[1]; } } $msg->set( 'Attributes', $attr, TRUE ); } $response = pas_check_response( $msg->send() ); if ( is_string( $response ) ){ if ( substr( $response, 0, 2 ) == '43' ){ die( json_encode( [ 'status' => 2, 'error' => '' ] ) ); } die( json_encode( [ 'status' => 0, 'error' => $response ] ) ); } echo json_encode( [ 'status' => 1, 'error' => '' ] ); // end of file ajax/update_participant.php