Class UserTypeChangedEventArgs is triggered when the firewall detects a user group association change. Implements the
EventArgs
The bellow sample assumes that you are using a ILogger instance to document the changes and that we never block a search engine as behaving badly
private void MyFireWall_OnUserTypeChange(object? sender, UserTypeChangedEventArgs e)
{
_logger?.Lazy().LogDebug("User is being changed from {oldType} to {newType}\n Route: {route}\n Rules:\n Data: {data}"
, e.OriginalType
, e.NewType
, e.Rout
, string.Join("\n ", e.Rules)
);
//allow the change
e.AllowRaiseIncident = true;
if (e.OriginalType.HasFlag(UserTypes.IsSearchEngine) && e.NewType.HasFlag(UserTypes.IsMalicious))
{
//remove the malicious flag from search engines to not prevent search engines from
//indexing the site
e.NewType &= ~UserTypes.IsMalicious;
}
}
System.Object
System.EventArgs
Walter.Web.FireWall.EventArguments.UserTypeChangedEventArgs
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2