You are here:  Home  >  IP Access Rule-Related Objects  >  How Do the IP Access/Ban Methods and Properties Work?

How Do the IP Access/Ban Methods and Properties Work?

Several interfaces, methods, properties, and an enum can be used to retrieve and set IP addresses that are denied or allowed access. The diagram and description below describe how the interfaces, methods, properties, and enum all work together. Scroll down to Related Topics for links to the IP-related interfaces, methods, properties, and enum. For an example of an IP ban access script, refer to Script Examples: UserIPBanEntry.

  • The ICIServer, ICISite, or ICIClientSettings interfaces each provide a GetIPAccess() method to retrieve an array (list) of IP access rules, regardless of how those rules were created, whether automatically due to auto-ban, or manually with deny/allow assigned to an IP address. The array of IP rules returned by GetIPAccess() will be different depending on whether you invoke the method under the ICIServer, ICISite, or ICIClientSettings interface.

  • ICIIPAccessRule is the parent interface for managing IP access rules. It returns the IP access rule type (manual or auto) for a given rule in the array of IP rules obtained using GetIPAccess(). The available types are 0 for auto-banned IPs, 1 for manually added IPs (which could be banned or allowed).

  • Two interfaces inherit from ICIIPAccessRule: ICIManualIPAccessRule and ICIAutobanIPAccessRule.

    • ICIManualIPAccessRule is used to obtain the properties of an IP rule that was manually added to the IP access rule set. Those properties include the IP address, whether the IP is allowed or denied, and the date the IP was added to the IP access rule set.

    • ICIAutobanIPAccessRule is used to obtain an array of automatically banned IPs as a subset of the entire array of IP access rules.

    • After you have the ICIAutobanIPAccessRule array, you use ICIBannedIP to obtain the properties for each of those auto-banned IP rules, including the IP address, the date banned, whether the ban is permanent or temporary ban, the ban expiration (if applicable), and ban reason.

Related Topics