Skip to content

Commit

Permalink
Add 403 audit log
Browse files Browse the repository at this point in the history
  • Loading branch information
jweigelt committed Jun 24, 2019
1 parent 02e299b commit 373de08
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion SWBF2Admin/Web/WebServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,12 @@ private WebUser CheckAuth(HttpListenerContext ctx)
user = Core.Database.GetWebUser(identity.Name, identity.Password);
if (user != null)
{

authCache.Remove(user.Username);
authCache.Add(user.Username, user);
Core.Database.UpdateLastSeen(user);
}else
{
Logger.Log(LogLevel.Info, "User {0} ({1}): invalid login (cached/password mismatch)", identity.Name, ctx.Request.RemoteEndPoint.ToString());
}
}
}
Expand All @@ -256,6 +258,9 @@ private WebUser CheckAuth(HttpListenerContext ctx)
{
authCache.Add(user.Username, user);
Core.Database.UpdateLastSeen(user);
}else
{
Logger.Log(LogLevel.Info, "User {0} ({1}): invalid login (db/password mismatch)", identity.Name, ctx.Request.RemoteEndPoint.ToString());
}
}

Expand Down

0 comments on commit 373de08

Please sign in to comment.