Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 15th May 2007, 20:33   #1
Veerugadde
Junior Member
 
Join Date: May 2007
Posts: 36
IP Address verification

Hello everybody,

I have read the validate IP function, usage but i was unable figure out how can installer get the user IP address for validation.

Thanks,

Veeru
Veerugadde is offline   Reply With Quote
Old 15th May 2007, 20:54   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Use ValidateIP.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 15th May 2007, 21:05   #3
Veerugadde
Junior Member
 
Join Date: May 2007
Posts: 36
Quote:
Originally posted by kichik
Use ValidateIP.
Thank you.. Actually i am stuck with how we can push the client IP address to start the validation. In the example Validate IP function will go with validation process. Could you please suggest me how we can retrieve client IP address as an input for validation ?

Thanks.
Veerugadde is offline   Reply With Quote
Old 15th May 2007, 21:14   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
Why would you want to validate the user's IP? It can't be invalid if you get it through the API.

To get the IP, use one of the following:

http://nsis.sourceforge.net/IP_plug-in
http://nsis.sourceforge.net/Internet_plug-in

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 15th May 2007, 21:22   #5
Veerugadde
Junior Member
 
Join Date: May 2007
Posts: 36
[QUOTE]Originally posted by kichik
[B]Why would you want to validate the user's IP?



Can you please explain me about following statement in depth "It can't be invalid if you get it through the API".

Thanks lot.
Veerugadde is offline   Reply With Quote
Old 15th May 2007, 21:30   #6
Veerugadde
Junior Member
 
Join Date: May 2007
Posts: 36
[QUOTE]Originally posted by kichik
[B]Why would you want to validate the user's IP? It can't be invalid if you get it through the API.

Here i am thinking to give access to installers for the users within our domain and to abort the process if user is not within valid domain range. Please present your comments on the above thought.

Thanks..
Veerugadde is offline   Reply With Quote
Old 15th May 2007, 21:49   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,337
The ValidateIP function only checks to make sure a given string is a valid IP. It doesn't check for ranges. If you get the string from a good place (e.g. API), there's no need to validate it.

To make sure the IP is within a given subnet, you'd probably want to split using WordFind, as in ValidateIP, and use IntCmp on each part to make sure it's within the wanted range. You could also convert the IP to a 32-bit integer and use good old masking with IntOp.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump