Code Duplication    Length = 6-6 lines in 2 locations

index.php 2 locations

@@ 76-81 (lines=6) @@
73
    $cm = get_coursemodule_from_instance('bigbluebuttonbn', $bigbluebuttonbn->id, $course->id, false, MUST_EXIST);
74
75
    //User roles
76
    if( $bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]" ){
77
        //The room that is being used comes from a previous version
78
        $moderator = has_capability('mod/bigbluebuttonbn:moderate', $context);
79
    } else {
80
        $moderator = bigbluebuttonbn_is_moderator($USER->id, get_user_roles($context, $USER->id, true), $bigbluebuttonbn->participants);
81
    }
82
    $administrator = has_capability('moodle/category:manage', $context);
83
84
    if( $moderator || $administrator ) {
@@ 104-109 (lines=6) @@
101
    $cm = get_coursemodule_from_id('bigbluebuttonbn', $bigbluebuttonbn->coursemodule, 0, false, MUST_EXIST);
102
103
    //User roles
104
    if( $bigbluebuttonbn->participants == null || $bigbluebuttonbn->participants == "" || $bigbluebuttonbn->participants == "[]" ){
105
        //The room that is being used comes from a previous version
106
        $moderator = has_capability('mod/bigbluebuttonbn:moderate', $context);
107
    } else {
108
        $moderator = bigbluebuttonbn_is_moderator($USER->id, get_user_roles($context, $USER->id, true), $bigbluebuttonbn->participants);
109
    }
110
    $administrator = has_capability('moodle/category:manage', $context);
111
112
    if ( groups_get_activity_groupmode($cm) > 0 ){