Code Duplication    Length = 10-15 lines in 2 locations

src/Intraface/modules/modulepackage/ModulePackage.php 1 location

@@ 271-280 (lines=10) @@
268
     *
269
     * @return array Array with groups
270
     */
271
    function getGroups()
272
    {
273
        $result = $this->db->query("SELECT id, group_name AS ".$this->db->quoteIdentifier('group')." FROM module_package_group WHERE active = 1 ORDER BY sorting_index");
274
        if (PEAR::isError($result)) {
275
            throw new Exception('Error in db query: '.$result->getUserInfo());
276
            exit;
277
        }
278
279
        return $result->fetchAll();
280
    }
281
}
282

src/Intraface/User.php 1 location

@@ 606-620 (lines=15) @@
603
    /**
604
     * TODO M�ske kan det g�res enklere, s� der ikke skal bruges s� mange tabeller
605
     */
606
    public function getList()
607
    {
608
        $i = 0;
609
        $result = $this->db->query("SELECT DISTINCT user.id, user.email, address.name
610
            FROM user
611
            INNER JOIN permission ON permission.user_id = user.id
612
            LEFT JOIN address ON user.id = address.belong_to_id AND address.type = 2
613
            WHERE (address.active = 1 OR address.type IS NULL) AND permission.intranet_id = ".$this->intranet_id."
614
            ORDER BY address.name");
615
616
        if (PEAR::isError($result)) {
617
            throw new Exception($result->getUserInfo());
618
        }
619
        return $result->fetchAll();
620
    }
621
622
    public function isFilledIn()
623
    {