Update cookies preferences
Promotic

PmUser - Deatiled object description

See: The PmUser object

This object is available for example:
- in the Pm.LoggedUser property
- in the "UP - Logged user property" data binding
- in events: onUserLogonEnd, onUserLogoff and onPageModify (in the pEvent.User parameter)
- in events: onUserItemAction and onStateChange (in the pEvent.Context.User parameter)
- in designer methods of the PmaPanel object (in the pContext.User parameter)


During the authentication process the entered authentication data of the local or network user is compared with the list of defined users (see the "PmaRoot > Users" tab).
The first defined user found, whose definition corresponds to the entered authentication data, will be used in the user permissions evaluation system (see the "Permission" tab) and the specified data will be used by the PmUser object.

The private user data:
In events onUserLogonEnd, onUserLogoff and onPageModify or in designer methods of the PmaPanel object it is possible to the specific user (PmUser object) assign and read the auxiliary named data by methods PmUser.SetPrivateData and PmUser.GetPrivateData. This is particullary useful for network users, enabling to store the different states for each logged user. This is handy especially for network users, because this way it is possible to save different status for each logged user. Then it is, for example, possible in the Web panel to have the "UP - Logged user property" data binding linked to GetPrivateData in order to display in the Pmg object different values for each user.

Examples of usage the private data:
Setting the private data by the server:
In the onUserLogonEnd event, the "TEST" user will get the private variable with dt0 identifier with the value of 7, otherwise 0.
JavaScriptVBScriptSelect and copy to clipboard

if (pEvent.User.Name == "TEST")
{
pEvent.User.SetPrivateData("dt0", 7);
}
else
{
pEvent.User.SetPrivateData("dt0", 0);
}
Setting the private data by the client:
In the onButtonUp event of the PmgButton object the "SettingData" panel designer method is called with two parameters.
JavaScriptVBScriptSelect and copy to clipboard

pMe.PmPanel.Methods.SettingData("dt0", 7);
The "SettingData" method has two parameters sId and vVal. The logged-in user entered the value 7 with dt0 identifier into his private data.
JavaScriptVBScriptSelect and copy to clipboard

pContext.User.SetPrivateData(sId, vVal);
Reading the private data by the client:
Reading the private data value then can be done by the "UP - Logged user property" data binding connected to GetPrivateData. Or for example by calling the designer method "GettingData" of the panel from the Pmg object with parameter:
JavaScriptVBScriptSelect and copy to clipboard

if (pMe.PmPanel.Methods.GettingData("dt0") == 7)
{
// ...
}
The "GettingData" panel method has the sId parameter and returns the value.
JavaScriptVBScriptSelect and copy to clipboard

return pContext.User.GetPrivateData(sId);
PROMOTIC 9.0.31 SCADA system documentation MICROSYS, spol. s r.o.

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