Once you have created the application, you can place a user control with “login”.
First, create a VAR TEXT tag that will receive the user’s name. If you have tags or groups created, select the first tag and press Ctrl-I. It will insert a tag before everyone to stay organized like this:
Then create a login screen by inserting a new page at the beginning if you want.
Give her a name, for example, Login.
You can create the background design however you want
Create a button to login, assign it to the user tag, put the system home page in the Properties page, and in the PasswordDepends property 1 – Yes, like this:
To create or configure new users, run USCN.EXE in your application folder.
The initial password for accessing the USCN is:
supervisor
But the initial password for the admin user is:
Test@123
It is possible to create users and privilege levels that will be used next.
On the home screen page of the system, you can place the button for “logout”. To log out, place a script in the OnClick event like this:
You can also, on the General page, place an object associated with the user tag, which will be the logged user.
As for privileges, the application’s internal buttons that move to another page are defined by levels in the Privileges property. These levels are defined in the button’s Privileges property. In this case, we will set level 3, so only users with level 3 will be able to access the page screen associated with the button, like this:
In the case of applications from multiple groups, it is good to replicate the user tag for each group, just associating the main user tag in the formula like this:
In the other panels, the user name you can insert on the screen:
To test, go back to the Login page, and start the application.
Click the Login button, select the user and enter the password. By default, the user is admin and the password Test@123.
Upon entering the main screen, the logged in user should appear. And in the database, this information will be stored in the history, alarms, and change log, if you want.
To do an automatic logout, you can place two scripts:
1 – On the OnClick event Login button:
timer.login.reset
2 – In the general event OnAfterUpdate
if timer.login > 60000 then ‘if more than 1 minute
timer.login.reset
user = “”
users.name = “”
panel.page = “Login”
end if