| @@ -29,9 +29,8 @@ | ||
| 29 | 29 | add_action( 'wp_ajax_wpstream_handle_channel_selection', [$this, 'wpstream_handle_channel_selection'] ); |
| 30 | 30 | add_action( 'wp_ajax_wpstream_handle_channel_creation', [$this, 'wpstream_handle_channel_creation'] ); |
| 31 | 31 | add_action( 'wp_ajax_wpstream_handle_channel_details_saving', [$this, 'wpstream_handle_channel_details_saving'] ); |
| 32 | 32 | add_action( 'wp_ajax_wpstream_remove_post_id', [$this, 'wpstream_remove_post_id_callback'] ); |
| 33 | - add_action( 'wp_ajax_wpstream_get_live_quota_data', [$this, 'wpstream_get_live_quota_data'] ); | |
| 34 | 33 | |
| 35 | 34 | // Enqueue dashboard scripts |
| 36 | 35 | add_action( 'wp_enqueue_scripts', [$this, 'wpstream_enqueue_dashboard_scripts'] ); |
| 37 | 36 | } |
| @@ -134,21 +133,8 @@ | ||
| 134 | 133 | wp_send_json_error( array( 'error' => 'User is not logged in.' ) ); |
| 135 | 134 | die(); |
| 136 | 135 | } |
| 137 | 136 | |
| 138 | - /* Making sure that the channel that's currently selected by the user is the one being updated */ | |
| 139 | - $current_user = wp_get_current_user(); | |
| 140 | - if ( isset( $_POST['postID'] ) && intval( $_POST['postID'] ) !== 0 ) { | |
| 141 | - $current_editing_channel = get_user_meta( $current_user->ID, 'wpstream_start_streaming_channel', true ); | |
| 142 | - if ( intval( $current_editing_channel ) !== intval( $_POST['postID'] ) ) { | |
| 143 | - wp_send_json_error( array( 'error' => 'Can\'t edit this channel.' ) ); | |
| 144 | - die(); | |
| 145 | - } | |
| 146 | - } else { | |
| 147 | - wp_send_json_error( array( 'error' => 'Invalid channel ID.' ) ); | |
| 148 | - die(); | |
| 149 | - } | |
| 150 | - | |
| 151 | 137 | $thumb_id = isset( $_POST['thumb_id'] ) ? intval( $_POST['thumb_id'] ) : 0; |
| 152 | 138 | $title = sanitize_text_field( $_POST['title'] ); |
| 153 | 139 | $description = sanitize_text_field( $_POST['description'] ); |
| 154 | 140 | $channel_paid = intval( $_POST['channel_paid'] ); |
| @@ -910,27 +896,6 @@ | ||
| 910 | 896 | |
| 911 | 897 | wp_send_json( $response ); |
| 912 | 898 | |
| 913 | 899 | wp_die(); |
| 914 | - } | |
| 915 | - | |
| 916 | - public function wpstream_get_live_quota_data() { | |
| 917 | - if ( ! wp_verify_nonce( $_POST['security'] ?? '', 'wpstream_notice_nonce' ) ) { | |
| 918 | - wp_send_json_error( 'Nonce verification failed.' ); | |
| 919 | - die(); | |
| 920 | - } | |
| 921 | - | |
| 922 | - if ( ! is_user_logged_in() ) { | |
| 923 | - wp_send_json_error( 'You must be logged in to perform this action.' ); | |
| 924 | - die(); | |
| 925 | - } | |
| 926 | - | |
| 927 | - $quota_data = $this->main->quota_manager->get_live_quota_data( 'wpstream_get_live_quota_data' ); | |
| 928 | - | |
| 929 | - if ( $quota_data ) { | |
| 930 | - $quota_data['is_basic_streaming'] = $this->main->quota_manager->is_basic_streaming_mode( $quota_data ); | |
| 931 | - wp_send_json_success( $quota_data ); | |
| 932 | - } else { | |
| 933 | - wp_send_json_error( 'Could not retrieve quota data.' ); | |
| 934 | - } | |
| 935 | 900 | } |
| 936 | 901 | } |