Code Duplication    Length = 17-17 lines in 2 locations

class/utility.php 1 location

@@ 755-771 (lines=17) @@
752
    /**
753
     * Verify that the current user is a member of the Admin group
754
     */
755
    public static function isAdminGroup()
756
    {
757
        global $xoopsUser, $xoopsModule;
758
        if (is_object($xoopsUser)) {
759
            if (in_array('1', $xoopsUser->getGroups())) {
760
                return true;
761
            } else {
762
                if ($xoopsUser->isAdmin($xoopsModule->mid())) {
763
                    return true;
764
                } else {
765
                    return false;
766
                }
767
            }
768
        } else {
769
            return false;
770
        }
771
    }
772
773
    /**
774
     * Verify if the current "user" is a bot or not

include/functions.php 1 location

@@ 633-649 (lines=17) @@
630
/**
631
 * Verify that the current user is a member of the Admin group
632
 */
633
function news_is_admin_group()
634
{
635
    global $xoopsUser, $xoopsModule;
636
    if (is_object($xoopsUser)) {
637
        if (in_array('1', $xoopsUser->getGroups())) {
638
            return true;
639
        } else {
640
            if ($xoopsUser->isAdmin($xoopsModule->mid())) {
641
                return true;
642
            } else {
643
                return false;
644
            }
645
        }
646
    } else {
647
        return false;
648
    }
649
}
650
651
/**
652
 * Verify if the current "user" is a bot or not