public boolean savePhpbbUser(String user) throws SQLException,
			ClassNotFoundException {
		sqlClass();
		sqlCon();
		if (!customField.isEmpty()) {
			query = "SELECT user_id FROM " + tablePref
					+ "profile_fields_data WHERE pf_" + customField + "='"
					+ user + "'";
			ResultSet rs = SELECT(query);
			if (rs.next()) {
				query = "UPDATE "
						+ tablePref
						+ "users SET user_type='0', user_actkey='', user_inactive_time='0' WHERE user_id="
						+ rs.getInt("user_id");
				UPDATE(query);
				query = "SELECT * FROM " + tablePref + "users WHERE user_id='"
						+ rs.getInt("user_id") + "'";

				rs = SELECT(query);
				if (rs.next()) {
					plugin.sendInfo(ForumAA.server.getPlayer(user),
							"Activated account for " + rs.getString("username"));
					updateStats(rs.getInt("user_id"), rs.getString("username"),
							rs.getString("user_colour"), rs.getInt("group_id"));
					closeCon();
					return true;
				} else {
					plugin.sendInfo(ForumAA.server.getPlayer(user),
							"Account activated but could not update Stats");
					return true;
				}
			} else {
				plugin.sendError(ForumAA.server.getPlayer(user),
						"Username could not be found");
				return false;
			}
		} else {
			// Update main users table
			query = "UPDATE "
					+ tablePref
					+ "users SET user_type='0', user_actkey='', user_inactive_time='0' WHERE username_clean='"
					+ user.toLowerCase() + "'";
			UPDATE(query);

			query = "SELECT * FROM "
					+ tablePref
					+ "users WHERE user_type='0' ORDER BY user_regdate DESC LIMIT 1";

			ResultSet rs = SELECT(query);

			if (rs.next()) {
				plugin.sendInfo(ForumAA.server.getPlayer(user),
						"Activated account for " + rs.getString("username"));
				updateStats(rs.getInt("user_id"), rs.getString("username"),
						rs.getString("user_colour"), rs.getInt("group_id"));
				closeCon();
				return true;
			} else {
				plugin.sendInfo(ForumAA.server.getPlayer(user),
						"Account activated but could not update Stats");
				closeCon();
				return true;
			}
		}
	}