Code Duplication    Length = 14-14 lines in 2 locations

htdocs/kernel/group.php 2 locations

@@ 489-502 (lines=14) @@
486
     *           objects? FALSE returns associative array.
487
     * @return array array of groups the user belongs to
488
     */
489
    public function getGroupsByUser($uid)
490
    {
491
        $ret    = array();
492
        $sql    = 'SELECT groupid FROM ' . $this->db->prefix('groups_users_link') . ' WHERE uid=' . (int)$uid;
493
        $result = $this->db->query($sql);
494
        if (!$result) {
495
            return $ret;
496
        }
497
        while ($myrow = $this->db->fetchArray($result)) {
498
            $ret[] = $myrow['groupid'];
499
        }
500
501
        return $ret;
502
    }
503
504
    /**
505
     * retrieve users belonging to a group
@@ 514-527 (lines=14) @@
511
     *                        FALSE will return arrays
512
     * @return array array of users belonging to the group
513
     */
514
    public function getUsersByGroup($groupid, $limit = 0, $start = 0)
515
    {
516
        $ret    = array();
517
        $sql    = 'SELECT uid FROM ' . $this->db->prefix('groups_users_link') . ' WHERE groupid=' . (int)$groupid;
518
        $result = $this->db->query($sql, $limit, $start);
519
        if (!$result) {
520
            return $ret;
521
        }
522
        while ($myrow = $this->db->fetchArray($result)) {
523
            $ret[] = $myrow['uid'];
524
        }
525
526
        return $ret;
527
    }
528
}
529