question: public synchronized boolean requestAccount ( RequestData data ) throws JPlagException { if ( data . getRealName ( ) == null && data . getEmail ( ) == null && data . getEmailSecond ( ) == null && data . getHomepage ( ) == null && data . getReason ( ) == null && data . getNotes ( ) == null ) { if ( data . getPassword ( ) == null && data . getUsername ( ) != null ) { if ( exists ( data . getUsername ( ) ) ) return false ; else return ! requestAdmin . exists ( data . getUsername ( ) ) ; } else if ( data . getPassword ( ) != null && data . getUsername ( ) == null ) { String username = requestAdmin . validateRequest ( data . getPassword ( ) ) ; RequestData rd = requestAdmin . getRequestData ( username ) ; NodeList userList = rootElement . getElementsByTagName ( "user" ) ; for ( int i = 0 ; i < userList . getLength ( ) ; i ++ ) { Element elem = ( Element ) userList . item ( i ) ; if ( ( parseInt ( elem , "state" ) & MASK_REQUESTNOTIFY ) != 0 ) { sendMail ( elem . getAttribute ( "email" ) , MailTemplateAdmin . SERVER_REQUESTNOTIFY , rd ) ; } } return true ; } } if ( data . getUsername ( ) == null || data . getPassword ( ) == null || data . getRealName ( ) == null || data . getEmail ( ) == null || data . getReason ( ) == null ) throw new JPlagException ( "requestAccount" , "Username, password, " + "real name, primary email or reason is missing!" , "Check your input!" ) ; if ( ! isValidUsername ( data . getUsername ( ) ) ) throw new JPlagException ( "requestAccount" , "Illegal new username!" , "The username may only consist of the " + "following characters: 'A'-'Z', 'a'-'z', " + "'0'-'9', '@' and '.'" ) ; if ( exists ( data . getUsername ( ) ) || requestAdmin . exists ( data . getUsername ( ) ) ) throw new JPlagException ( "requestAccount" , "Username already used!" , "Seems like somebody else was faster ;)" ) ; String vericode = requestAdmin . addRequest ( data ) ; sendMail ( data . getEmail ( ) , MailTemplateAdmin . SERVER_VERIFICATION , data , "code" , vericode ) ; return true ; }
target:  Called by the server page. - If everything but username is null, it returns, whether the username is OK (true) or it is already used (false). - If everything but password is null and password is the email validation code sent to the user, the request becomes available to the AdminTool and an email is sent to the administrator, if the code is wrong, false is returned. - If username, password, realname, email and reason is not null, it saves the data and sends a validation email to the user. - Otherwise an exception is thrown.