From 64299082ad19689618fd9764b4e0d066ab717576 Mon Sep 17 00:00:00 2001 From: Andy Bauer Date: Mon, 17 Aug 2015 17:54:17 -0500 Subject: [PATCH] Send login activity to the zoneminder event log --- web/includes/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/includes/functions.php b/web/includes/functions.php index 44b60e5c76..385ab673b3 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -56,6 +56,7 @@ function userLogin( $username, $password="", $passwordHashed=false ) $_SESSION['remoteAddr'] = $_SERVER['REMOTE_ADDR']; // To help prevent session hijacking if ( $dbUser = dbFetchOne( $sql, NULL, $sql_values ) ) { + Info( "Login successful for user \"$username\"" ); $_SESSION['user'] = $user = $dbUser; if ( ZM_AUTH_TYPE == "builtin" ) { @@ -64,6 +65,7 @@ function userLogin( $username, $password="", $passwordHashed=false ) } else { + Warning( "Login denied for user \"$username\"" ); unset( $user ); } if ( $cookies ) @@ -73,6 +75,9 @@ function userLogin( $username, $password="", $passwordHashed=false ) function userLogout() { global $user; + $username = $user['Username']; + + Info( "User \"$username\" logged out" ); unset( $_SESSION['user'] ); unset( $user );