Promotic

onNewRequest - event of the PmaWeb object

Description:
The event is triggered on the request for each new Web page (the document of the HTML, XML, BMP, etc. type).
The event is triggered before creating and sending the document into the Web client.
In this event it is possible to get all required information about the request and to affect if the required page is really sent.
But the event is obsolete and it is better to perform the test of the client's permissions on the "Permissions" tab of the appropriate objects.
Parameters:
pMe(Object) Reference to the PmaWeb object where the event rises.
pEvent(Object) Reference to the object describing detailed information about the specific event.
pEvent.HostName - (String) [for reading] Name of the logged-in user in the Web browser (client). If the user isn't logged on, then the string is empty.
pEvent.HostPwd - (String) [for reading] Password of the logged-in user in the Web browser (client). If the user isn't logged on, then the string is empty.
pEvent.HostAddr - (String) [for reading] Network address of the client computer - the Web browser
pEvent.ComponentId - (String) [for read and write] Identifier of the Web component from which the page is requested. This text is always converted to lower case.
pEvent.PageAddr - (String) [for read and write] Address of the requested page on the Web component (e.g. "default.htm"). This text is always converted to lower case.
pEvent.TypeEnable - (Long) [for reading] It enables to set the type of sending the page to the client. The designer can (according to the user setting, password or the computer address) disable the operation.
Setting this parameter is recommended only for special cases. Common security setting is better to be done by standard means of the permissions: WebRead. See also PmaWebDir.onPageLoad, PmaObject-Cfg.Methods.
1 (default) - enabling operation.
-1 - required log-on of the user (if the user hasn't been set) or disabling the user (if the user has been set but the name and password are wrong).
-2 - disabling operation for the client unconditionally.
Example:
JavaScriptVBScriptSelect and copy to clipboard

if (pEvent.HostAddr != "192.168.0.24" && pEvent.HostAddr != "192.168.0.26")
{
pEvent.TypeEnable = -2;

}
else if (pEvent.HostName != "admin" && pEvent.HostPwd != "Pokemon")
{
pEvent.TypeEnable = -1;
}
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.