Plugin Directory

Changeset 3284398


Ignore:
Timestamp:
04/29/2025 09:27:00 PM (11 months ago)
Author:
elearningevolve
Message:

2.5.0-update

Location:
video-conferencing-with-bbb/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • video-conferencing-with-bbb/trunk/README.md

    r3259705 r3284398  
    55Tags: virtual classroom, video conference, BigBlueButton, BBB, online meeting, web conferencing, online teaching, learning management system, LMS, online session, live training, video conferencing, video conference, meetings, virtual meetings
    66Requires at least: 5.1 
    7 Tested up to: 6.7.2 
     7Tested up to: 6.8 
    88Requires PHP: 7.2 
    9 Stable tag: 2.4.3 
     9Stable tag: 2.5.0 
    1010License: GPLv2 or later 
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    175175
    176176## Changelog ##
     177### 2.5.0 ###
     178* Added: Allow LearnDash Instructors and Group Leaders to embed room shortcode
     179
    177180### 2.4.3 ###
    178181* Fixed: Access code not updates are not applied for the room
  • video-conferencing-with-bbb/trunk/public/helpers/class-bigbluebutton-tokens-helper.php

    r2849433 r3284398  
    4444                }
    4545                $tokens_string .= $param;
    46             } else {
    47                 if ( 'token' == substr( $param, 0, 5 ) ) {
     46            } elseif ( 'token' == substr( $param, 0, 5 ) ) {
    4847                    $param          = substr( $param, 5 );
    4948                    $tokens_string .= ',' . $param;
    50                 }
    5149            }
    5250        }
     
    156154
    157155    /**
     156     * Check if the current user has any of the allowed roles.
     157     *
     158     * @param array $allowed_roles Array of allowed user role slugs.
     159     * @return bool True if user has any allowed role, false otherwise.
     160     */
     161    public static function is_current_user_in_allowed_roles( $author ) {
     162
     163        $allowed_roles = array( 'administrator', 'bbb-moderator', 'ld-instructor', 'wdm_instructor', 'group_leader' );
     164
     165        $current_user = get_user( $author );
     166
     167        if ( empty( $current_user->roles ) || empty( $allowed_roles ) ) {
     168            return false;
     169        }
     170
     171        return (bool) array_intersect( $allowed_roles, (array) $current_user->roles );
     172    }
     173
     174    /**
    158175     * Get room from token.
    159176     *
     
    166183     */
    167184    public static function find_room_id_by_token( $token, $author ) {
    168         // Only show room if author can create rooms.
    169         if ( ! user_can( $author, 'edit_bbb_rooms' ) ) {
     185        $in_allowed_roles = self::is_current_user_in_allowed_roles( $author );
     186
     187        // Only show room if author or roles satisfy create room cap.
     188        if ( ! $in_allowed_roles && ! user_can( $author, 'edit_bbb_rooms' ) ) {
    170189            self::$error_message = esc_html__( 'This user does not have permission to display any rooms in a shortcode or widget.', 'bigbluebutton' );
    171190            return 0;
     
    209228     * @since   3.0.0
    210229     *
    211      * @param   String $token     String value of the token.
     230     * @param   String  $token     String value of the token.
    212231     * @param   Integer $author   Author writing the content using this shortcode.
    213232     * @return  Integer $room_id  Room ID associated with the token.
     
    232251     * @since   3.0.0
    233252     *
    234      * @param   String $token     String value of the token.
     253     * @param   String  $token     String value of the token.
    235254     * @param   Integer $author   Author writing the content using this shortcode.
    236255     * @return  Integer $room_id  Room ID associated with the token.
  • video-conferencing-with-bbb/trunk/video-conferencing-with-bbb.php

    r3259705 r3284398  
    1616 * Plugin URI:        https://wordpress.org/plugins/video-conferencing-with-bbb
    1717 * Description:       This plugin allows teachers to manage their virtual classrooms right from WordPress using BigBlueButton
    18  * Version:           2.4.3
     18 * Version:           2.5.0
    1919 * Author:            eLearning evolve <info@elearningevolve.com>
    2020 * Author URI:        https://elearningevolve.com/
     
    2424 * Domain Path:       /languages
    2525 */
    26 $plugin_version = '2.4.3';
     26$plugin_version = '2.5.0';
    2727$plugin_name    = 'Virtual Classroom & Video Conferencing - BigBlueButton';
    2828
Note: See TracChangeset for help on using the changeset viewer.