04-05-2012 05:11 PM
Hi everyone,
I'm trying to create a login page that inputs username and password of users, then authorize user information with the Domain Account Manager to recognize user identification.
I google and see the NI Security Programmatic Login.vi can allow me to create a login page and it works. However, I got a problem is to redirect to other pages after authorizing.
NI Security Programmatic Login.vi only outputs some string to show the status of the authentication, it doesnt output boolean like true or fall.
Does anyone has a solution to help me?
Thank you.
This is my screen shot:
04-05-2012 07:35 PM
Where are you trying to "redirect" to?
Why can't you just call this VI as a subVI on your larger program (the one you want to redirect to)?
Why do you need a boolean output? Just compare the output string to an expected output for a valid login and you'll have the boolean you want.
04-06-2012 02:18 PM
Thank you for suggesting me. I've done the checking task but I don't know how to call a subVi.
As you can see in the images I post below, I have a login page with its diagram, and the main page that I want to show after logging in conrrectly.
So should the main page is the subVi or the login page? And can you tell me how to show the main page after logging correctly?
I also don't know how to refresh the page if logging information is incorrect. Do you have any solution?
Thank you so much.
04-06-2012 02:48 PM
The login page should be the subVI.
Simply drag the file onto the block diagram of the main VI.
Right-click on the subVI and select SubVI Node Setup. Have the subVI load the front panel when called.
Then you'll need some logic in your top level VI to decide whether or not to allow the user to do anything or not.
04-06-2012 03:10 PM
Thank you. I think I didn't give my questions clearly.
My question is how to hide others controls except the username and password controls, then if the login information is correct, the login control is hiden and other controls are showed up.
If I just drag the file onto the main VI, I have to load both of them, and users just close the login page to see the main VI.
As you see in my images, I have a comparision to check the login information. But I don't know what to do with the returned value after comparing.
If its true, show other controls, if its false, reload the page.
Or should I include them in one VI? At the beginning, anly load the login controls, then show other controls?
04-06-2012 03:43 PM
If you make the subVI a top-level dialog (VI Properties > Window Appearance) the user will not be able to go to the main VI and ignore it.
If they don't log in you can either close the main VI or disable all the controls (via property nodes).
04-09-2012 02:03 PM
Thank you for helping me. But I think your suggestion is not really helpfun in my situation. You can see my login page in this image:
So the question is how to close this VI if the comparing result is true. I've tried many ways but couldn't fix it. I have my main VI and call this VI as subVi. But eventually the user closes the subVI, he still can access the main VI. But my first issue is to close the login page if the login information is correct. I can do it easily in PHP but LabView is totally different.
Thank you
04-09-2012 05:02 PM
for close your VI, use "close reference"
And you could use the access control list for different controls, like Tab controls with which you can make different responses for the user.
Regards
04-09-2012 05:47 PM
Thanks. I can do it now by using Close.vi file. I also make the login vi can't be closed or minimized by user. But the user can move the login front panel to control the main vi. Do you have any suggestion to make the login vi front panel cannot be moved or the main vi cannot be controlled until the login page closed?
Thank you?
04-09-2012 06:04 PM
If your login VI is a subVI holding up the execution of the main VI, then the user can type/move things around all they want in the main VI, but it's not going to continue executing until the login VI finishes.