*/
public final void validateProfile( WikiContext context, UserProfile profile )
{
boolean isNew = profile.isNew();
WikiSession session = context.getWikiSession();
InputValidator validator = new InputValidator( SESSION_MESSAGES, context );
ResourceBundle rb = Preferences.getBundle( context, InternationalizationManager.CORE_BUNDLE );
//
// Query the SpamFilter first
//
FilterManager fm = m_engine.getFilterManager();
List<PageFilter> ls = fm.getFilterList();
for( PageFilter pf : ls )
{
if( pf instanceof SpamFilter )
{
if( ((SpamFilter)pf).isValidUserProfile( context, profile ) == false )
{
session.addMessage( SESSION_MESSAGES, "Invalid userprofile" );
return;
}
break;
}
}
// If container-managed auth and user not logged in, throw an error
if ( m_engine.getAuthenticationManager().isContainerAuthenticated()
&& !context.getWikiSession().isAuthenticated() )
{
session.addMessage( SESSION_MESSAGES, rb.getString("security.error.createprofilebeforelogin") );
}
validator.validateNotNull( profile.getLoginName(), rb.getString("security.user.loginname") );
validator.validateNotNull( profile.getFullname(), rb.getString("security.user.fullname") );
validator.validate( profile.getEmail(), rb.getString("security.user.email"), InputValidator.EMAIL );
// If new profile, passwords must match and can't be null
if ( !m_engine.getAuthenticationManager().isContainerAuthenticated() )
{
String password = profile.getPassword();