Code Duplication    Length = 12-22 lines in 2 locations

main/inc/lib/AnnouncementManager.php 1 location

@@ 880-901 (lines=22) @@
877
     * including users from linked courses
878
     * @deprecate use CourseManager class
879
     */
880
    public static function get_course_users()
881
    {
882
        //this would return only the users from real courses:
883
        $session_id = api_get_session_id();
884
        if ($session_id != 0) {
885
            $userList = CourseManager::get_real_and_linked_user_list(
886
                api_get_course_id(),
887
                true,
888
                $session_id,
889
                true
890
            );
891
        } else {
892
            $userList = CourseManager::get_real_and_linked_user_list(
893
                api_get_course_id(),
894
                false,
895
                0,
896
                true
897
            );
898
        }
899
900
        return $userList;
901
    }
902
903
    /**
904
     * this function gets all the groups of the course,

main/inc/lib/course.lib.php 1 location

@@ 5606-5617 (lines=12) @@
5603
     * this function gets all the users of the course,
5604
     * including users from linked courses
5605
     */
5606
    public static function getCourseUsers()
5607
    {
5608
        //this would return only the users from real courses:
5609
        $session_id = api_get_session_id();
5610
        if ($session_id != 0) {
5611
            $user_list = self::get_real_and_linked_user_list(api_get_course_id(), true, $session_id);
5612
        } else {
5613
            $user_list = self::get_real_and_linked_user_list(api_get_course_id(), false, 0);
5614
        }
5615
5616
        return $user_list;
5617
    }
5618
5619
    /**
5620
     * this function gets all the groups of the course,