Logon - method of the Pm object
Login of the local user without the input window.
Long Logon(String sName, String sPassword)
|sName||(String) Login name (name, not identifier) of the local user|
|sPassword||(String) Login password of the local user|
0 - Login succesfull.
1 - User not registered, log in failed.
2 - Password incorrect, log in failed.
-1 - Missing parameters, log in failed.
Registering by the Logon
method rather skips the logon window of the local user, but then the normal login process proceeds and it is equal to registering by the login window. It means that the entered data are compared with the list of users and then calling the PmaRoot.onUserLogonBegin
event follows with default parameters. Only after that it is decided whether the login process of the local user passed.
This method is also functional in Web panels
. User login on the Web cannot be competed wihout the user confirming the login and therefore this method does the same thing as the Pm.WndLogon
method - opens new user login window (the parameters sName
are not used).
In order to make the method correctly functional in the Web panel, it is necessary to configure the panel (PmaPanel object) to have the "WebRead" permission (to force the network user to login into the browser). It is also recommended check the "Strict mode of network users login into the application requiring the use of both name and password" configurator in the PmaWeb object.
var nLogon = Pm.Logon("admin", "xyz");
Pm.Debug("Logon = " + nLogon);