$.udb.login()
This article is about the login() function of the udb object.
$.udb.login()
Logs in.
Returns a Promise object or the 'this' object. From USoft 10.0.1I, returns a udbPromise instead of a Promise object.
Syntax
.login( *user*, *password*, *options* )
*options* ::= {
page: *page*,
promise: *promise*,
success: *success-function*,
error: *error-function*
}
*promise* ::= { true | false }
The required user is a string that identifies the user. The required password is a string that defines the password.
Options is a struct that can have the following items, all of which are optional.
Page is a string that defines the page to jump to or a function to call on success.
*Promise *determines the return value of this function. If promise has the value 'true' (the default), a Promise object is returned. If promise has the value 'false', the ‘this’ object is returned instead.
Success-function is a function called after the operation has successfully completed.
Error-function is a function called if an error occurs.
Examples
$.udb.login('ABC','DEF');
$.udb.login('ABC','DEF',{page:'MyFirstPage'});
$.udb.login('ABC','DEF').then(function(){
alert('Welcome!');
});
Related events
| Event | Applies to | Occurs when |
|---|---|---|
| beforelogin | Page objects | Before each login action |
| beforelogout | Page objects | Before each logout action |
| login | Page objects | After each login action |