C# Class DevRainSolutions.KyivSmartCity.New.Models.SpamProtectionAttribute

Verifies that a form has not been submitted in a too short timespan. Used in POST scenarios to ensure that no spam-bot is performing the request.
Inheritance: System.Web.Mvc.FilterAttribute, IAuthorizationFilter
ファイルを表示 Open project: DevRainSolutions/KyivSmartCity

Public Methods

Method Description
OnAuthorization ( System.Web.Mvc.AuthorizationContext filterContext ) : void

Called when a process requests authorization.

SpamProtectionAttribute ( ) : System

Initializes a new instance of the SpamProtectionAttribute class.

SpamProtectionAttribute ( int timespan ) : System

Initializes a new instance of the SpamProtectionAttribute class.

Method Details

OnAuthorization() public method

Called when a process requests authorization.
public OnAuthorization ( System.Web.Mvc.AuthorizationContext filterContext ) : void
filterContext System.Web.Mvc.AuthorizationContext The filter context.
return void

SpamProtectionAttribute() public method

Initializes a new instance of the SpamProtectionAttribute class.
public SpamProtectionAttribute ( ) : System
return System

SpamProtectionAttribute() public method

Initializes a new instance of the SpamProtectionAttribute class.
public SpamProtectionAttribute ( int timespan ) : System
timespan int The he minimum timespan between GET- and POST-request.
return System