Promotic
WikipediaLinkedInYoutubeTwitterFacebook

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 access rights on the "Permissions" tab of the appropriate objects.
Parameters:
pMe(Object) Reference to the PmaWeb object where the event rises.
pEvent(Object) Reference to object describing detailed information about the specific event.
pEvent.HostName - (String) 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) 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) Nework address of the client computer - the Web browser
pEvent.ComponentId - (String) Identifier of the Web component from which the page is requested. This text is always converted to lower case.
pEvent.PageAddr - (String) Address of the requested page on the Web component (e.g. "default.htm"). This text is always converted to lower case.
pEvent.TypeEnable - (Long) 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.16 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice