private static Configuration parseConfigFromPost(WikiContext context, Query query,
                                                     int listenPort,
                                                     String oldSSK)  {

        boolean allowImages = false;
        if (query.containsKey("images")) {
            allowImages = true;
        }
        int fcpPort = -1;
        int fmsPort = -1;
        try {
            fcpPort = Integer.parseInt(query.get("fcpport"));
        } catch (NumberFormatException nfe) {
            // NOP
        }

        try {
            fmsPort = Integer.parseInt(query.get("fmsport"));
        } catch (NumberFormatException nfe) {
            // NOP
        }

        String newSSK = query.get("fmsssk");
        if (newSSK == null || newSSK.equals("")) {
            // Hack to handle the fact that we don't display the
            // private key
            newSSK = oldSSK;
        }

        Configuration config = new Configuration(listenPort,
                                                 query.get("fcphost"),
                                                 fcpPort,
                                                 query.get("fpprefix"),
                                                 allowImages,
                                                 query.get("fmshost"),
                                                 fmsPort,
                                                 query.get("fmsid"),
                                                 newSSK,
                                                 query.get("fmsgroup"),
                                                 query.get("wikiname"));
        return config;
    }