You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/auth.php
+19-19Lines changed: 19 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -142,14 +142,6 @@ function check_auth_cookie() : int|false {
142
142
}
143
143
144
144
if (cacti_sizeof($user_info)) {
145
-
if (!auth_cookie_user_currently_allowed($user_info)) {
146
-
db_execute_prepared('DELETE FROM user_auth_cache
147
-
WHERE user_id = ?',
148
-
[$user_info['id']]);
149
-
150
-
returnfalse;
151
-
}
152
-
153
145
$secret = hash('sha512', $token, false);
154
146
155
147
$found = db_fetch_cell_prepared('SELECT user_id
@@ -161,20 +153,28 @@ function check_auth_cookie() : int|false {
161
153
162
154
if (empty($found)) {
163
155
returnfalse;
164
-
} else {
165
-
set_auth_cookie($user_info);
166
-
167
-
cacti_log(sprintf('LOGIN: User %s Authenticated via Authentication Cookie from IP Address %s', $user_info['username'], get_client_addr()), false, 'AUTH');
if (!auth_cookie_user_currently_allowed($user_info)) {
159
+
db_execute_prepared('DELETE FROM user_auth_cache
160
+
WHERE user_id = ?',
161
+
[$user_info['id']]);
175
162
176
-
return$user_info['id'];
163
+
returnfalse;
177
164
}
165
+
166
+
set_auth_cookie($user_info);
167
+
168
+
cacti_log(sprintf('LOGIN: User %s Authenticated via Authentication Cookie from IP Address %s', $user_info['username'], get_client_addr()), false, 'AUTH');
0 commit comments