public boolean saveXenforoUser(String user) throws SQLException,
			ClassNotFoundException {
		sqlClass();
		sqlCon();
		if (!customField.isEmpty()) {
			query = "SELECT user_id FROM " + tablePref
					+ "user_field_value WHERE field_value ='" + user + "'";
			ResultSet rs = SELECT(query);
			if (rs.next()) {
				query = "UPDATE " + tablePref
						+ "user SET user_state='valid' WHERE user_id='"
						+ rs.getInt("user_id") + "'";
				UPDATE(query);
				query = "SELECT * FROM " + tablePref + "user WHERE user_id="
						+ rs.getInt("user_id") + " AND user_state='valid'";
				rs = SELECT(query);
				if (rs.next()) {
					plugin.sendInfo(ForumAA.server.getPlayer(user),
							"Your account has been activated.");
					return true;

				} else {
					plugin.sendError(ForumAA.server.getPlayer(user),
							"Your account has not been activated");
					closeCon();
					return false;
				}

			} else {
				plugin.sendError(ForumAA.server.getPlayer(user),
						"Couldn't find your username");
				closeCon();
				return false;
			}
		} else {
			query = "UPDATE " + tablePref
					+ "user SET user_state='valid' WHERE username='" + user
					+ "'";
			UPDATE(query);
			query = "SELECT * FROM " + tablePref + "user WHERE username='"
					+ user + "' AND user_state='valid'";
			ResultSet rs = SELECT(query);
			if (rs.next()) {
				plugin.sendInfo(ForumAA.server.getPlayer(user),
						"Your account has been activated.");
				closeCon();
				return true;

			} else {
				plugin.sendError(ForumAA.server.getPlayer(user),
						"Your account has not been activated");
				closeCon();
				return false;
			}
		}
	}