src/org/ohmage/request/user/UserCreationRequest.java
@Override
	public void service() {
		LOGGER.info("Servicing the user creation request.");
		
		if(! authenticate(AllowNewAccount.NEW_ACCOUNT_DISALLOWED)) {
			return;
		}
		
		try {
			LOGGER.info("Verifying that the requesting user is an admin.");
			UserServices.instance().verifyUserIsAdmin(getUser().getUsername());
			
			LOGGER.info("Verifying that a user with the username doesn't already exist.");
			UserServices.instance().checkUserExistance(newUsername, false);
			
			LOGGER.info("Creating the user.");
			UserServices.instance().createUser(newUsername, newPassword, emailAddress, newIsAdmin, newIsEnabled, newIsNewAccount, newCampaignCreationPrivilege, false, false);
		}
		catch(ServiceException e) {
			e.failRequest(this);
			e.logException(LOGGER);
		}
	}
/**
	 * Services this request if an existing user is making the request.
	 */
Services this request if an existing user is making the request.
Services this request if an existing user is making the request .
@Override
	public void service() {
		LOGGER.info("Servicing the user creation request.");
		if(! authenticate(AllowNewAccount.NEW_ACCOUNT_DISALLOWED)) {
			return;
		}
		try {
			LOGGER.info("Verifying that the requesting user is an admin.");
			UserServices.instance().verifyUserIsAdmin(getUser().getUsername());
			LOGGER.info("Verifying that a user with the username doesn't already exist.");
			UserServices.instance().checkUserExistance(newUsername, false);
			LOGGER.info("Creating the user.");
			UserServices.instance().createUser(newUsername, newPassword, emailAddress, newIsAdmin, newIsEnabled, newIsNewAccount, newCampaignCreationPrivilege, false, false);
		}
		catch(ServiceException e) {
			e.failRequest(this);
			e.logException(LOGGER);
		}
	}
@ Override public void service ( ) { LOGGER . info ( "Servicing the user creation request." ) ; if ( ! authenticate ( AllowNewAccount . NEW_ACCOUNT_DISALLOWED ) ) { return ; } try { LOGGER . info ( "Verifying that the requesting user is an admin." ) ; UserServices . instance ( ) . verifyUserIsAdmin ( getUser ( ) . getUsername ( ) ) ; LOGGER . info ( "Verifying that a user with the username doesn't already exist." ) ; UserServices . instance ( ) . checkUserExistance ( newUsername , false ) ; LOGGER . info ( "Creating the user." ) ; UserServices . instance ( ) . createUser ( newUsername , newPassword , emailAddress , newIsAdmin , newIsEnabled , newIsNewAccount , newCampaignCreationPrivilege , false , false ) ; } catch ( ServiceException e ) { e . failRequest ( this ) ; e . logException ( LOGGER ) ; } }
Services this request if an existing user is making the request.
Services this request if an existing user is making the request .