mySCADA
myDESIGNER › myDESIGNER › Views & Layout

View script function - Users, language and login

On this page

Login/Logout

If user is logged in, this function will automatically log user out. If user is not logged in, this function will present a login dialog to the user.

myscada.loginLogout();

Login As

You can log in specific user by calling following function myscada.loginAs(user, password, callback);

Example:

myscada.loginAs(‘petr’, ‘svoboda’, function (ok) {

if (ok)

{//login successful}

});

Log User Out

To log user out, use function

myscada.logout();

You can also provide a callback function as parameter.

Get Current Language

To get current language, user is using, use following function

var lang=myscada.getLanguage();

Set Current Language

To set current language, please pass the language code into the following function:

myscada.setLanguage(‘en’);

Log User Action

You can write a log into a User Actions log by using following function:

myscada.logUserAction(message,severity,callback)

First parameter is string with message, second is severity eg. importance of the message and last one is a callback informing you whether action was performed.

Example:

myscada.logUserAction(‘petr’,0,function (err,data){

if (!err)

{

//action OK

}

});