Code Duplication    Length = 7-7 lines in 2 locations

system/modules/Users/Users.php 2 locations

@@ 71-77 (lines=7) @@
68
            ['user_id', $userId],
69
            ['hash', $hash]
70
        ]);
71
        if (!$session) {
72
            if (!headers_sent()) {
73
                setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/");
74
                setcookie($this->cookiePrefix . "_user_id", '', 0, "/");
75
            }
76
            Tools::redirect('/', \I18n\Text::module('Users', 'Произошла непредвиденная ошибка при авторизации сессии'));
77
        }
78
        if ($session->user->id != $userId) {
79
            Tools::redirect('/', \I18n\Text::module('Users', 'Произошла непредвиденная ошибка при авторизации сессии'));
80
        }
@@ 105-111 (lines=7) @@
102
            Users\User::$cur = $session->user;
103
            Users\User::$cur->date_last_active = 'CURRENT_TIMESTAMP';
104
            Users\User::$cur->save();
105
        } else {
106
            if (!headers_sent()) {
107
                setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/");
108
                setcookie($this->cookiePrefix . "_user_id", '', 0, "/");
109
            }
110
            Msg::add(\I18n\Text::module('Users', 'needrelogin'), 'info');
111
        }
112
    }
113
114
    /**