Code: Select all
Sun Feb 07 19:31:25: ERROR JNDI lookup for datasource UFSREPOSITORY failed
Sun Feb 07 19:31:25: ERROR JNDI lookup for datasource UFSREPOSITORY failed
Sun Feb 07 19:31:27: ERROR JNDI lookup for datasource UFSREPOSITORY failed
Sun Feb 07 19:31:27: ERROR JNDI lookup for datasource UFSREPOSITORY failed
Sun Feb 07 19:31:29: ERROR JNDI lookup for datasource UFSREPOSITORY failed
Sun Feb 07 19:31:29: ERROR JNDI lookup for datasource UFSREPOSITORY failed
Sun Feb 07 19:31:33: ERROR Error creating transaction Cannot create resource instance
Sun Feb 07 19:31:33: ERROR Error detecteSun Feb 07 19:31:47: Error invoking logon system service: error code: 0.0
ror creating transaction Cannot create resource instance
Sun Feb 07 19:31:33: ERROR Error creating transaction Cannot create resource instance
Sun Feb 07 19:31:33: ERROR Error detected initialising the batch server component:
Sun Feb 07 19:31:33: ERROR Error creating transaction Cannot create resource instance
Sun Feb 07 19:31:33: ERROR Error detected initialising the workflow servlet component:
Sun Feb 07 19:31:33: ERROR Error creating transaction Cannot create resource instance
Sun Feb 07 19:31:33: FormCacheLoader: start
Sun Feb 07 19:31:33: FormCacheLoader: end
Sun Feb 07 19:31:33: ******************************************************************
Sun Feb 07 19:31:33: *** Ebase Xi Server V5.0.1 successfully initialized in 21 seconds
Sun Feb 07 19:31:33: *** Using workspace C:\ebaseXi\Workspace
Sun Feb 07 19:31:33: ******************************************************************
Code: Select all
importPackage(com.ebasetech.xi.api);
importPackage(com.ebasetech.xi.services);
try {
var eBaseDomain=system.executeCustomFunction("gettext", ['EBASEDOMAIN', 'Shared','EN']);
fields.USERID.value=fields.PARAM1_VALUE.value;
fields.PASSWORD.value=fields.PARAM2_VALUE.value;
tables.USERS.WHERECLAUSE.value="WHERE LOWER(Username)='" + fields.PARAM1_VALUE.value.toLowerCase() + "' AND DecryptByKey(Password)='" + fields.PARAM2_VALUE.value + "'";
tables.USERS.fetchTable();
// User account is not enabled
if ( tables.USERS.rowCount > 0 && tables.USERS.ENABLED.value != 'Y' ) {
fields.USERID.value=null;
fields.ERRORCODE.value = "999";
fields.ERRORDESCRIPTION.value = "Your account is disabled. Please contact the system administrator";
} else if ( tables.USERS.rowCount > 0 ) {
fields.ERRORCODE.value =0;
// Required for eBase SecurityManager to know that the authentication was successfull
fields.USERID.value=tables.USERS.REALNAME.value;
// Add these values as credentials so they can be referenced in any script
tables.CREDENTIALS.insertRow();
tables.CREDENTIALS.ID.value="REALNAME";
tables.CREDENTIALS.VALUE.value=tables.USERS.REALNAME.value;
tables.CREDENTIALS.updateTable();
tables.CREDENTIALS.insertRow();
tables.CREDENTIALS.ID.value="USERID";
tables.CREDENTIALS.VALUE.value=tables.USERS.USERID.value;
tables.CREDENTIALS.updateTable();
tables.CREDENTIALS.insertRow();
tables.CREDENTIALS.ID.value="SECID";
tables.CREDENTIALS.VALUE.value=tables.USERS.SECID.value;
tables.CREDENTIALS.updateTable();
tables.CREDENTIALS.insertRow();
tables.CREDENTIALS.ID.value="EMAILADDRESS";
tables.CREDENTIALS.VALUE.value=tables.USERS.EMAIL.value;
tables.CREDENTIALS.updateTable();
tables.CREDENTIALS.insertRow();
tables.CREDENTIALS.ID.value="IGNOREMAINTAINANCEMODE";
tables.CREDENTIALS.VALUE.value=(tables.USERS.IGNOREMAINTAINANCEMODE.value == 'Y' ? 'Y' : 'N');
tables.CREDENTIALS.updateTable();
tables.CREDENTIALS.insertRow();
tables.CREDENTIALS.ID.value="FORCEPASSWORDRESET";
tables.CREDENTIALS.VALUE.value=(tables.USERS.FORCEPASSWORDRESET.value == 1 ? 'Y' : 'N');
tables.CREDENTIALS.updateTable();
} else {
fields.USERID.value = null;
fields.ERRORCODE.value = "999991";
fields.ERRORDESCRIPTION.value = "Your username or password is not correct";
print("Login failed with the username " + fields.PARAM1_VALUE.value);
}
} catch (e) {
fields.USERID.value = null;
fields.ERRORCODE.value = "999991";
fields.ERRORDESCRIPTION.value = "Your username or password is not correct";
}
Code: Select all
function login(params) {
username=params[0];
password=params[1];
if (username=="" || password=="") {
return "Please enter the username and password";
}
try {
system.securityManager.logon([["",username],["",password]]);
} catch (e) {
// Parse the error message
var errormsg=String(e);
// Remove this string from the beginning of the error message
errormsg=errormsg.substring("JavaException: com.ebasetech.xi.exceptions.LogonException: ".length);
return errormsg;
}
form.gotoForm("HOMEPAGE");
}