Skip to content

Commit

Permalink
Merge pull request ZoneMinder#1021 from knnniggett/log_logins
Browse files Browse the repository at this point in the history
Send login activity to the zoneminder event log
  • Loading branch information
connortechnology committed Aug 18, 2015
2 parents 16897b7 + 6429908 commit 7f305c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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" )
{
Expand All @@ -64,6 +65,7 @@ function userLogin( $username, $password="", $passwordHashed=false )
}
else
{
Warning( "Login denied for user \"$username\"" );
unset( $user );
}
if ( $cookies )
Expand All @@ -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 );
Expand Down

0 comments on commit 7f305c9

Please sign in to comment.