Skip to content

Commit

Permalink
Fixing Issue #5732 - Basic Auth login logging
Browse files Browse the repository at this point in the history
Web Basic Authentication does not log user logins
  • Loading branch information
TheWitness committed Apr 18, 2024
1 parent 29695bb commit 2dbaa89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -24,6 +24,7 @@ Cacti CHANGELOG
-issue#5726: Poller cache is not updating when changing hostname
-issue#5727: Incorrect values status_fail_date and status_rec_date with cmd poller
-issue#5731: After Marking a Tree for Editing - Saving the Tree Unpublishes the Tree
-issue#5732: Web Basic Authentication does not log user logins
-feature#5692: Add a "device enabled/disabled" indicator next to the graphs
-feature#5710: Notify the admin periodically when a remote data collector goes into heartbeat status
-feature#5716: Add Aruba Clearpass template
Expand Down
9 changes: 9 additions & 0 deletions include/auth.php
Expand Up @@ -98,6 +98,15 @@
if (cacti_sizeof($current_user)) {
$_SESSION['sess_user_id'] = $current_user['id'];;

cacti_log("LOGIN: User '" . $user['username'] . "' authenticated via Basic Authentication.", false, 'AUTH');

$client_addr = get_client_addr();

db_execute_prepared('INSERT IGNORE INTO user_log
(username, user_id, result, ip, time)
VALUES (?, ?, 1, ?, NOW())',
array($username, $current_user['id'], $client_addr));

return true;
} else {
require_once($config['base_path'] . '/auth_login.php');
Expand Down

0 comments on commit 2dbaa89

Please sign in to comment.