Code Duplication    Length = 6-6 lines in 2 locations

subscription.php 2 locations

@@ 140-145 (lines=6) @@
137
        if ($submitterUid > 0) {
138
            // user logged in
139
            $submitter_email = $xoopsUser->email();
140
            foreach ($xoopsUser->getGroups() as $group) {
141
                if (in_array($group, $xnewsletter->getConfig('xn_groups_without_actkey')) || XOOPS_GROUP_ADMIN == $group) {
142
                    $allowedWithoutActivationKey = true;
143
                    break;
144
                }
145
            }
146
        } else {
147
            // user not logged in
148
            // NOP
@@ 586-591 (lines=6) @@
583
            } else {
584
                // user logged in
585
                $allowedWithoutActivationKey = false;
586
                foreach ($xoopsUser->getGroups() as $group) {
587
                    if (in_array($group, $xnewsletter->getConfig('xn_groups_without_actkey')) || XOOPS_GROUP_ADMIN == $group) {
588
                        $allowedWithoutActivationKey = true;
589
                        break;
590
                    }
591
                }
592
            }
593
594
            if ($activationKey || $allowedWithoutActivationKey) {