Code Duplication    Length = 4-4 lines in 5 locations

makepdf.php 1 location

@@ 37-40 (lines=4) @@
34
35
$article = new NewsStory($storyid);
36
// Not yet published
37
if (0 == $article->published() || $article->published() > time()) {
38
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
39
}
40
41
// Expired
42
if (0 != $article->expired() && $article->expired() < time()) {
43
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);

print.php 2 locations

@@ 49-52 (lines=4) @@
46
// Verify that the article is published
47
$story = new NewsStory($storyid);
48
// Not yet published
49
if (0 == $story->published() || $story->published() > time()) {
50
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
51
}
52
53
// Expired
54
if (0 != $story->expired() && $story->expired() < time()) {
55
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
@@ 54-57 (lines=4) @@
51
}
52
53
// Expired
54
if (0 != $story->expired() && $story->expired() < time()) {
55
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
56
}
57
58
// Verify permissions
59
$gpermHandler = xoops_getHandler('groupperm');
60
if (is_object($xoopsUser)) {

ratenews.php 1 location

@@ 92-95 (lines=4) @@
89
90
if (!empty($storyid)) {
91
    $article = new NewsStory($storyid);
92
    if (0 == $article->published() || $article->published() > time()) {
93
        redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
94
    }
95
96
    // Expired
97
    if (0 != $article->expired() && $article->expired() < time()) {
98
        redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);

visit.php 1 location

@@ 34-37 (lines=4) @@
31
// Do we have the right to see the file ?
32
$article = new NewsStory($sfiles->getStoryid());
33
// and the news, can we see it ?
34
if (0 == $article->published() || $article->published() > time()) {
35
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
36
}
37
// Expired
38
if (0 != $article->expired() && $article->expired() < time()) {
39
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
40
}