pMe | (Object) Reference to the PmaWeb object where the event rises. |
---|---|
pEvent | (Object) Reference to an 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.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. |
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;
}