// get a transaction
persistentObjectManagerClass loginTransaction
= new persistentObjectManagerClass( configuration, log );
systemUserClass user = new systemUserClass();
user.setSystem_user_id( -1 );
user.setSystem_user_name( userNameField.getText() );
user.setSystem_user_password( new String( passwordField.getPassword() ) );
if( userNameField.getText().equals( "" ) ){
throw new KExceptionClass(
"User name is required" ,null
);
}
//After login, object gets all the attributes from DB, if login OK ...
configuration.setField( "SESSION_ID", "LOGIN" );
user = (systemUserClass) loginTransaction.login4( user );
// ---------------------------------------------
// loading user setup
// save attr
configuration.setField( "system_user_id", Long.toString(user.getSystem_user_id() ) );
configuration.setField( "system_user_name", user.getSystem_user_name() );
configuration.setField( "system_user_fullname", user.getSystem_user_name() );
configuration.setField( "system_user_role", user.getSystem_user_role() );
configuration.setField( "system_user_email", user.getSystem_user_email() );
configuration.setField( "system_user_isadmin", user.getSystem_user_isadmin() );
loginStatus = true;
setVisible( false );
dispose ();