LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

login with labview web server

Hi to all,

i need to implement a login process before letting pass a new user to access the system.

So i need that the user inserts a password that the system compares with a constant and in the case

that they are equals, the system will let the user pass to control the system that always is active in

memory.

Thanks,

Alex.
0 Kudos
Message 1 of 9
(4,965 Views)
Hi Alex,

You need to build something similar to the attached VI.

Hope this helps.

Rachel
0 Kudos
Message 2 of 9
(4,945 Views)
I forgot to mention that of course, this needs to be modified to allow the next user to log in only once the previous user has accessed the system.

Rachel
0 Kudos
Message 3 of 9
(4,942 Views)
Hi Alex,

you need the Internet Toolkit which is part of the Enterprise Connectivity Toolset. You can get it also as single toolkit.

You have to program your active pages with the CGI VIs from this toolkit. There is a VI which will give you the parameters of the request of the browser. Use this VI to get the user name and password from the login form. Check this against a user data base. If the user has the right to use the system then:

A)
generate a session number,
store the session number together with some time information,
generate the new page inserting the session number as parmeter in any link and form the user can click

B)
generate a cookie with a session number
store the session number together with some time information
store the cookie on the user system

Either method allows you to identify the user with the next request. Be sure to clean up the session number by providing a logout mechanism or by a cleanup VI which will remove the session after some time.

Be aware that the CGI VIs will not stay in memory if they are not used for some time. Use a permanent storage for the session numbers like a file.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 4 of 9
(4,920 Views)
Hello

Can you translate the instructions for a basic user

António
0 Kudos
Message 5 of 9
(4,882 Views)
António,

to understand what to do you must be familiar with HTML syntacs and the LV CGI programming examples.

Using Session ID's:
Create a CGI VI which a user will call when he first enters the web site. In this VI generate a random number and make a string with Hex values. If you think that 8 characters are to short do this sometimes more and concatenate the strings. This string will identify this user. It will be something like "5B7F981A". Create a file with the name of the string and store initial data about this user in it. You must use this string and a name in each link and form the user can use in the page you are creating in the current CGI VI. Links will then be something like "nextdoc.vi?sess_id=5B7F981A". When the user clicks on this link the CGI VI nextdoc.vi will be executed. You can then get the value of sess_id from the list of parameters. Now open the file again to read the initial data. Now you can store more data in the file. If you have a logout VI then delete the file to destroy the session. If the user will leave your web site without going to the logout the file will not be deleted. When the user revisites your web site he will get a new session id. The file from the first visit will never be deleted and will use your disc space whithout any sense. This is why you should have a VI running which will go through the folder where your session files are located and delete all files which will be older than a certain time. If a VI is called and will not find the file send a page stating something like "Session timed out or invalid" and give a link to the login page.

This method is simple to implement and will run with each user agent (a browser is only one sort of user agents, speech processors or spiders are some others). This way you must hold any permanent data and the user has to identify itself each time he is visiting your web site.

Using cookies:
In the internet toolkit there are the VIs and example programs how to use cookies. Cookies will hold data on the user agent side. They can be stored permanently if the user agent supports this. Using cookies allows you to identify the user again. Do not store to much data in the cookie because the cookie will be sent from the user agent to the server which each request. Store the data on your machine.

I hope I could give you some more startup information.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 6 of 9
(4,856 Views)
Hi Waldemar,

it seems you are familar with CGI and creating web remote panels. I have a similar problem related to this topic. Maybe you know the example "Creating Simultaneous Instances Remote Panels LabVIEW Applications" from the Developer Zone. I want to adapt this example for a multi-user application. Each time a user clicks on a link he is redirected to a new instance of a certain template that is embeded in a browser window.
However, when the browser is closed the instance of the VI remains in memory. I have tried a lot but could not manage to remove this garbage. Maybe you can help.

fRi
0 Kudos
Message 7 of 9
(4,795 Views)
Hi fRi,

I don't know this example and I have another problem. I do the work in this forum normally at home. I'm in progress to update my PC with a completely new installation and are not able to use LV because it is not installed by now. I think I will be ready end of next week. Then I will get the time to help you.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 8 of 9
(4,781 Views)
file attached request to you problème read this file and i thinks you know the solution
0 Kudos
Message 9 of 9
(4,723 Views)