G Web Server Examples

Access Control of Panel Images

Sometimes you need to have control over who has access to certain VI panel images. You can limit access to static and animated panel images based on the browser's Internet address or the referring document (the page in which the image is embedded). You can also require a user name and password in order to display an image.

Access for panel images is specified in the global access configuration file, internet/http/conf/access.cfg, which you can edit by hand or with the HTTP Access Configuration VI. The different directives for the configuration file are described in the user manual.



For this example, the VI Secret Panel.vi has been protected with the following directives:

	
 1   <Panel Secret Panel.vi>
 2   AuthUserFile conf/pwd.txt
 3   AuthName Secret Panel
 4   <Limit Snapshot>
 5   require valid-user
 6   </Limit>
 7   <Limit Monitor>
 8   require user salvador
 9   </Limit>
10   </Panel>


Line 1 and 10 specify that these directives affect the VI Secret Panel.vi.
Line 2 specifies the location of the user file (since the path is relative, it is appended to the ServerRoot directory). The user names and passwords stored in this file are shown at the left.
Line 3 specifies the string with which the user is prompted.
Lines 4-6 specify that only a valid-user can gain access to the static image.
Lines 7-8 specify that only the user salvador can gain access to the animated image.
User Password
pablo picasso
salvador dali
diego rivera
juan gris
frida kahlo



The following example contains an embed static image of the front panel of the VI Secret Panel.vi. In order to see the image, you'll have to use one of the user names and the corresponding password from above, for example

User: pablo
Password: picasso



The following example contains an embed animated image of the front panel of the VI Secret Panel.vi. In order to see the image, you'll have to use the following user name and password:

User: salvador
Password: dali


© National Instruments