Promotic
WikipediaLinkedInYoutubeTwitterFacebook

User - Deatiled object description

See: Object User
 
This object is available for example:
- in the Pm.LoggedUser property
- in onUserLogonEnd, onUserLogoff and onPageModify events (in the pEvent.User parameter)
- in onUserItemAction and onStateChange events (in the pEvent.Context.User parameter)
- in the user methods of the PmPanel object (in the pContext.User parameter)
 
During the authorization process the entered authorization data of the local or network user is compared with the list of defined users (see the PmRoot > Users page). The first defined user found, whose definition corresponds with the entered authorization data, will be used in the user right evaluation system (see Description of the Permissions page) and the specified data will be used by the User object.
 
The private user data:

In events onUserLogonEnd, onUserLogoff and onPageModify or in user methods of the PmPanel object it is possible to the specific user (User object) assign and read the assistant data named by the methods User.SetPrivateData and User.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 Data binding UP - Binding to the logged user property data binding linked to GetPrivateData in order to display in the graphic item 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 data identified as dt0 with the value of 7, otherwise 0.
VBScriptSelect and copy to clipboard

If pEvent.User.Name = "TEST" Then
  pEvent.User.SetPrivateData "dt0", 7
Else
  pEvent.User.SetPrivateData "dt0", 0
End If
Setting the private data by the client:
In the onButtonUp event of the PmiButton graphic item the "SettingData" panel designer's method is called with two paramaters.
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 identificator "dt0" into his private data.
VBScriptSelect and copy to clipboard

pContext.User.SetPrivateData sId, vVal
Reading the private data by the client:
Reading the privatedata can then be done by the Data binding UP - Binding to the logged user property binding connected to GetPrivateData. Or for example by calling the designer's method "GettingData" of panel from the graphic item with the 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.
VBScriptSelect and copy to clipboard

pResult = pContext.User.GetPrivateData(sId)
PROMOTIC 9.0.0 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