Code Duplication    Length = 6-8 lines in 2 locations

locallib.php 2 locations

@@ 536-541 (lines=6) @@
533
534
    if (is_array($participant_list)) {
535
        // Iterate looking for all configuration
536
        foreach($participant_list as $participant){
537
            if( $participant->selectiontype == 'all' ) {
538
                if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR )
539
                    return true;
540
            }
541
        }
542
543
        //Iterate looking for roles
544
        $db_moodle_roles = bigbluebuttonbn_get_db_moodle_roles();
@@ 558-565 (lines=8) @@
555
        }
556
557
        //Iterate looking for users
558
        foreach($participant_list as $participant){
559
            if( $participant->selectiontype == 'user' ) {
560
                if( $participant->selectionid == $user ) {
561
                    if ( $participant->role == BIGBLUEBUTTONBN_ROLE_MODERATOR )
562
                        return true;
563
                }
564
            }
565
        }
566
    }
567
568
    return false;