Code Duplication    Length = 12-22 lines in 2 locations

main/inc/lib/AnnouncementManager.php 1 location

@@ 1010-1031 (lines=22) @@
1007
     * including users from linked courses
1008
     * @deprecate use CourseManager class
1009
     */
1010
    public static function get_course_users()
1011
    {
1012
        //this would return only the users from real courses:
1013
        $session_id = api_get_session_id();
1014
        if ($session_id != 0) {
1015
            $userList = CourseManager::get_real_and_linked_user_list(
1016
                api_get_course_id(),
1017
                true,
1018
                $session_id,
1019
                true
1020
            );
1021
        } else {
1022
            $userList = CourseManager::get_real_and_linked_user_list(
1023
                api_get_course_id(),
1024
                false,
1025
                0,
1026
                true
1027
            );
1028
        }
1029
1030
        return $userList;
1031
    }
1032
1033
    /**
1034
     * this function gets all the groups of the course,

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

@@ 5311-5322 (lines=12) @@
5308
     * this function gets all the users of the course,
5309
     * including users from linked courses
5310
     */
5311
    public static function getCourseUsers()
5312
    {
5313
        //this would return only the users from real courses:
5314
        $session_id = api_get_session_id();
5315
        if ($session_id != 0) {
5316
            $user_list = self::get_real_and_linked_user_list(api_get_course_id(), true, $session_id);
5317
        } else {
5318
            $user_list = self::get_real_and_linked_user_list(api_get_course_id(), false, 0);
5319
        }
5320
5321
        return $user_list;
5322
    }
5323
5324
    /**
5325
     * this function gets all the groups of the course,