Code Duplication    Length = 14-14 lines in 2 locations

src/records/download.php 1 location

@@ 49-62 (lines=14) @@
46
47
$permissions = record_get_permissions($attachment['template_id'], $attachment['creator_id'], $attachment['responsible_id']);
48
49
if (!can_record_be_displayed($permissions))
50
{
51
    if (get_user_level() == USER_LEVEL_GUEST)
52
    {
53
        debug_write_log(DEBUG_NOTICE, 'Guest must be logged in.');
54
        save_cookie(COOKIE_URI, $_SERVER['REQUEST_URI']);
55
        header('Location: ../logon/index.php');
56
        exit;
57
    }
58
59
    debug_write_log(DEBUG_NOTICE, 'Attachment cannot be displayed.');
60
    header('Location: index.php');
61
    exit;
62
}
63
64
$filename = stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') === FALSE
65
          ? $attachment['attachment_name']

src/records/view.php 1 location

@@ 53-66 (lines=14) @@
50
51
$permissions = record_get_permissions($record['template_id'], $record['creator_id'], $record['responsible_id']);
52
53
if (!can_record_be_displayed($permissions))
54
{
55
    if (get_user_level() == USER_LEVEL_GUEST)
56
    {
57
        debug_write_log(DEBUG_NOTICE, 'Guest must be logged in.');
58
        save_cookie(COOKIE_URI, $_SERVER['REQUEST_URI']);
59
        header('Location: ../logon/index.php');
60
        exit;
61
    }
62
63
    debug_write_log(DEBUG_NOTICE, 'Record cannot be displayed.');
64
    header('Location: index.php');
65
    exit;
66
}
67
68
// page's title
69