Code Duplication    Length = 7-8 lines in 3 locations

htdocs/kernel/notification.php 3 locations

@@ 482-489 (lines=8) @@
479
     */
480
    public function subscribe($category, $item_id, $events, $mode = null, $module_id = null, $user_id = null)
481
    {
482
        if (!isset($user_id)) {
483
            global $xoopsUser;
484
            if (empty($xoopsUser)) {
485
                return false; // anonymous cannot subscribe
486
            } else {
487
                $user_id = $xoopsUser->getVar('uid');
488
            }
489
        }
490
491
        if (!isset($module_id)) {
492
            global $xoopsModule;
@@ 659-665 (lines=7) @@
656
            return false;
657
        }
658
659
        if (!isset($omit_user_id)) {
660
            global $xoopsUser;
661
            $omit_user_id = 0;
662
            if (!empty($xoopsUser)) {
663
                $omit_user_id = $xoopsUser->getVar('uid');
664
            }
665
        }
666
        $criteria = new CriteriaCompo();
667
        $criteria->add(new Criteria('not_modid', (int)$module_id));
668
        $criteria->add(new Criteria('not_category', $this->db->escape($category)));
@@ 771-778 (lines=8) @@
768
     **/
769
    public function unsubscribe($category, $item_id, $events, $module_id = null, $user_id = null)
770
    {
771
        if (!isset($user_id)) {
772
            global $xoopsUser;
773
            if (empty($xoopsUser)) {
774
                return false; // anonymous cannot subscribe
775
            } else {
776
                $user_id = $xoopsUser->getVar('uid');
777
            }
778
        }
779
        if (!isset($module_id)) {
780
            global $xoopsModule;
781
            $module_id = $xoopsModule->getVar('mid');