try
{
if ( validate( userId, password, email, firstname, lastname, locale, event ) )
{
PortletContext ctx = event.getPortlet( ).getPortletConfig( ).getPortletContext( );
UserService srv = ( UserService ) ctx.getService( UserService.NAME );
if ( register )
{
srv.addUser( request );
event.setReturnCode( "register" );
}
else
{
srv.updateUser( request );
event.setReturnCode( "update" );
}
notifyDataChanged( event );
return;