Atozed Forums

Full Version: How to control application access using IWIpGeolocation
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've just published a new demo showing how to use the new IWIPGeolocation classes to control application access based on IPGeolocation.

It uses LITERALLY 2 lines of code + 2 units added to the uses clause.

You can have it both ways: block access from certain countries or grant access only to certain countries.

Please check it out:

https://github.com/Atozed/IntraWeb/tree/...AccessDemo

Please notice:
- You *don't need* another 2 Gb library 
- You *don't need* to download and install a 2 Gb package just to get IPGeolocation
- You *don't need* to learn another "api" just to get this simple thing working

It is as simple as it can should be

Enjoy  Big Grin
Hi Alexandre,

Where do the functions AllowAccess(),BlockAccess(), IsPrivateIP() and IsLocalHost() get their comparative information from?

Regrads
Juergen
IsPrivateIP() and IsLocalHost() are internal IntraWeb functions declared in IW.Common.SysTools.pas

AllowAccess() and BlockAccess() are simple helper methods that decide based on the supplied parameters if the access should be granted or blocked... nothing else