public UserInfo setUserInfo(String username, String password, String newPassword, String name, String organization, 
    		String position, String phone, String email, String extraInfo)throws XMPPException{
    	if(newPassword != null && newPassword.length() < 6)
    		throw new XMPPException(new XMPPError(XMPPError.Condition.not_allowed, "userdata.newpassword.incorrect"));
    	if(password != null && "".equals(password.trim()))
    		throw new XMPPException(new XMPPError(XMPPError.Condition.not_allowed, "userdata.password.incorrect"));
    	
    	DHEncoder encoder = new DHEncoder(connection.getKey());
    	String encodedPassword = password!=null?encoder.encode(password):null;
    	String encodedNewPassword = password!=null?encoder.encode(newPassword):null;
    	UserInfo reg = new UserInfo(encodedPassword, encodedNewPassword, name, organization, position, phone, email, extraInfo);
        reg.setType(IQ.Type.SET);
        reg.setTo(connection.getServiceName());
        PacketFilter filter = new AndFilter(new PacketIDFilter(reg.getPacketID()),
                new PacketTypeFilter(IQ.class));
        PacketCollector collector = connection.createPacketCollector(filter);
        connection.sendPacket(reg);
        UserInfo result = (UserInfo)collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); 
        // Stop queuing results
        collector.cancel();
        if (result == null) {
            throw new XMPPException("No response from server.");
        }
        else if (result.getType() == IQ.Type.ERROR) {
            throw new XMPPException(result.getError());
        }
        return result;
    }