Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions public/helpers/class-bigbluebutton-tokens-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public static function find_room_id_by_token( $token, $author ) {
public static function can_display_room_on_page() {
global $pagenow;
$can_view = true;
if ( 'edit.php' == $pagenow || 'post.php' == $pagenow || 'post-new.php' == $pagenow ) {
if ( 'edit.php' == $pagenow || 'post.php' == $pagenow || 'post-new.php' == $pagenow || post_password_required() ) {
$can_view = false;
}
return $can_view;
Expand All @@ -202,11 +202,12 @@ private static function check_if_room_exists_for_new_token_format( $token, $auth
$room_id = (int) substr( $token, 1 );
$room = get_post( $room_id );
if ( false !== $room && null !== $room && 'bbb-room' == $room->post_type ) {
if ( 'publish' != $room->post_status ) {
if ( 'publish' == $room->post_status || 'private' == $room->post_status ) {
return $room->ID;
} else {
self::set_error_message( sprintf( wp_kses( __( 'The token: %s is not associated with a published room.', 'bigbluebutton' ), array() ), $token ), $author );
return 0;
}
return $room->ID;
} else {
return self::check_if_room_exists_for_old_token_format( $token, $author );
}
Expand Down Expand Up @@ -239,7 +240,9 @@ private static function check_if_room_exists_for_old_token_format( $token, $auth
if ( ! empty( $query->posts ) ) {
foreach ( $query->posts as $key => $room_id ) {
$room = get_post( $room_id );
if ( 'publish' != $room->post_status ) {
if ( 'publish' == $room->post_status || 'private' == $room->post_status ) {
return $room->ID;
} else {
self::set_error_message( sprintf( wp_kses( __( 'The token: %s is not associated with a published room.', 'bigbluebutton' ), array() ), $token ), $author );
return 0;
}
Expand Down