Code Duplication    Length = 4-4 lines in 5 locations

print.php 2 locations

@@ 56-59 (lines=4) @@
53
// Verify that the article is published
54
$story = new NewsStory($storyid);
55
// Not yet published
56
if ($story->published() == 0 || $story->published() > time()) {
57
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
58
}
59
60
// Expired
61
if ($story->expired() != 0 && $story->expired() < time()) {
62
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
@@ 61-64 (lines=4) @@
58
}
59
60
// Expired
61
if ($story->expired() != 0 && $story->expired() < time()) {
62
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
63
}
64
65
// Verify permissions
66
$gperm_handler = xoops_getHandler('groupperm');
67
if (is_object($xoopsUser)) {

makepdf.php 1 location

@@ 49-52 (lines=4) @@
46
47
$article = new NewsStory($storyid);
48
// Not yet published
49
if ($article->published() == 0 || $article->published() > time()) {
50
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
51
}
52
53
// Expired
54
if ($article->expired() != 0 && $article->expired() < time()) {
55
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);

ratenews.php 1 location

@@ 98-101 (lines=4) @@
95
96
if (!empty($storyid)) {
97
    $article = new NewsStory($storyid);
98
    if ($article->published() == 0 || $article->published() > time()) {
99
        redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
100
    }
101
102
    // Expired
103
    if ($article->expired() != 0 && $article->expired() < time()) {
104
        redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);

visit.php 1 location

@@ 41-44 (lines=4) @@
38
// Do we have the right to see the file ?
39
$article = new NewsStory($sfiles->getStoryid());
40
// and the news, can we see it ?
41
if ($article->published() == 0 || $article->published() > time()) {
42
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
43
}
44
// Expired
45
if ($article->expired() != 0 && $article->expired() < time()) {
46
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
47
}