LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a login page with NI Security Programmatic Login.vi

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:

login.png

0 Kudos
Message 1 of 13
(6,691 Views)

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.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 13
(6,685 Views)

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.

loginfront.pnglogin diagram.png

page.png

0 Kudos
Message 3 of 13
(6,669 Views)

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.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 4 of 13
(6,664 Views)

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?

 

0 Kudos
Message 5 of 13
(6,658 Views)

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).

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 6 of 13
(6,650 Views)

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:

login diagram 2.png

 

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

0 Kudos
Message 7 of 13
(6,632 Views)

for close your VI, use "close reference"

Nueva imagen (1).jpg

And you could use the access control list for different controls, like Tab controls with which you can make different responses for the user.

Nueva imagen.jpg

 

Regards

0 Kudos
Message 8 of 13
(6,620 Views)

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?

 

webpage.png

Thank you?

0 Kudos
Message 9 of 13
(6,615 Views)

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.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 10 of 13
(6,613 Views)