Code Duplication    Length = 4-4 lines in 3 locations

index.php 1 location

@@ 105-108 (lines=4) @@
102
if ($storytopic) {
103
    $groups        = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
104
    $gperm_handler = xoops_getHandler('groupperm');
105
    if (!$gperm_handler->checkRight('news_view', $storytopic, $groups, $xoopsModule->getVar('mid'))) {
106
        redirect_header(XOOPS_URL . '/modules/news/index.php', 3, _NOPERM);
107
    }
108
    $xoopsOption['storytopic'] = $storytopic;
109
} else {
110
    $xoopsOption['storytopic'] = 0;
111
}

submit.php 2 locations

@@ 62-65 (lines=4) @@
59
    $perm_itemid = 0;
60
}
61
//If no access
62
if (!$gperm_handler->checkRight('news_submit', $perm_itemid, $groups, $module_id)) {
63
    redirect_header(XOOPS_URL . '/modules/news/index.php', 3, _NOPERM);
64
}
65
$op = 'form';
66
67
//If approve privileges
68
$approveprivilege = 0;
@@ 143-146 (lines=4) @@
140
        //$storyid=(int)($_POST['storyid']);
141
        //}
142
        $story = new NewsStory($storyid);
143
        if (!$gperm_handler->checkRight('news_view', $story->topicid(), $groups, $module_id)) {
144
            redirect_header(XOOPS_URL . '/modules/news/index.php', 0, _NOPERM);
145
        }
146
        echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr><td class=\"odd\">";
147
        echo '<h4>' . _AM_EDITARTICLE . '</h4>';
148
        $title       = $story->title('Edit');
149
        $subtitle    = $story->subtitle('Edit');