Archive: Username Password Validation via HTTP


Username Password Validation via HTTP
Hello,

We are building a community website for our school, and we are going to publish our activity documents on the website. Because the file list is to large we thought we should better make an installer and put an ms word document viewer in it. It's going to be easier for teachers.

Problem is the content has to be private, it's not going to be cool if some users share the installer.exe.

I wonder if that's possible with NSIS.

1) Send a username / password pair (via a dialog box?) to http://website.com/index.php?username=$username&password=$password

2) Depending on the response, either proceed the download or cancel.

I'm a bit lost in this thing and any help is greatly appreciated.

Thank you,

Mahmut


Use an Install Options page to get the user/pass and use the nsisdl plugin to download the file.

Have a look at the documentation for info about the commands to read values from a file.


Hi Joost,

Thank you for your message, but I'm really new to this. Could you explain what you mean with install options page? Also using this approach is it possible to check if their download is successful or not? So we can track the users that successfully downloaded the document pack.

Thank you again,

Mahmut


InstallOptions is an add-on for NSIS, you can find it in NSIS\Contrib\InstallOptions. NSIS also comes with a couple of examples for InstallOptions, also have a look on its documentation .


That file is quite outdated. You should use the Install Options documentation included in the NSIS installer.


Hi guys thank you again. I checked the documentation and example files as you have told, but I couldn't find an example of user validation. What I'm trying to do is have the users enter a username, password in the installer and then validate this username, password with using a php page (validation against a database), and then at the end of the download I would like to send a request to another page to tell the database that download is completed successfully. The INI file looks static.

Please let me know if I'm on the wrong way,

Mahmut


You need to create an INI file for the custom dialog, a dialog with a textbox for username and password.

You can get thes values from the INI file and use nsisdl to download the file from the internet. Use the file instruction to (FileOpen etc.) to read the info from the you downloaded.


thanks a lot, this makes sense. I'm going to work on it, once it's done I'm going to put the code on the forum so other users can use it.


okay, I'm almost done with it. Now it connects, query the database, return the results and according to the result it starts downloading the file. But I couldn't figure out how to resume the downloads.

Is there a way to support resuming via nsis download plugin ?

Thank you,

Mahmut


NSISdl doesn't support resuming.


But I saw an NSIS installer with stop / resume support and there is also a thread in the forums about this, but I couldn't make it work.


http://forums.winamp.com/showthread....=nsisdl+resume

Is this is the patch you are talking about?
It was never accepted for the reasons Justin listed there. The NSISdl that comes with NSIS doesn't support resuming.


Hi,

Yes, it was the post I was talking about. I already saw that implementation on an nsis installer. But if it's not safe, we better not use it. Once again, thank you for your prompt reply.

Mahmut