Atozed Forums
How to control application access using IWIpGeolocation - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: How to control application access using IWIpGeolocation (/thread-2838.html)



How to control application access using IWIpGeolocation - Alexandre Machado - 08-15-2022

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/master/15/Delphi/IPGeolocationAccessDemo

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


RE: How to control application access using IWIpGeolocation - JuergenS - 09-20-2022

Hi Alexandre,

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

Regrads
Juergen


RE: How to control application access using IWIpGeolocation - Alexandre Machado - 09-22-2022

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