From 5f41913043211eed62b54083381bf030aa604085 Mon Sep 17 00:00:00 2001 From: orbiter Date: Sun, 20 Jul 2008 21:52:51 +0000 Subject: [PATCH] fix for http://forum.yacy-websuche.de/viewtopic.php?f=6&t=1347&hilit=&p=9216#p9216 git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5012 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ConfigBasic.java | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java index a2857379e..c6cde30b4 100644 --- a/htroot/ConfigBasic.java +++ b/htroot/ConfigBasic.java @@ -135,29 +135,23 @@ public class ConfigBasic { // set a use case String networkName = sb.getConfig("network.unit.name", ""); if (post != null && post.containsKey("usecase")) { - if (post.get("usecase", "").equals("freeworld")) { - if (!networkName.equals("freeworld")) { - // switch to freeworld network - sb.switchNetwork("defaults/yacy.network.freeworld.unit"); - } + if (post.get("usecase", "").equals("freeworld") && !networkName.equals("freeworld")) { + // switch to freeworld network + sb.switchNetwork("defaults/yacy.network.freeworld.unit"); // switch to p2p mode sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, true); sb.setConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, true); } - if (post.get("usecase", "").equals("portal")) { - if (!networkName.equals("webportal")) { - // switch to webportal network - sb.switchNetwork("defaults/yacy.network.webportal.unit"); - } + if (post.get("usecase", "").equals("portal") && !networkName.equals("webportal")) { + // switch to webportal network + sb.switchNetwork("defaults/yacy.network.webportal.unit"); // switch to robinson mode sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, false); sb.setConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, false); } - if (post.get("usecase", "").equals("intranet")) { - if (!networkName.equals("intranet")) { - // switch to intranet network - sb.switchNetwork("defaults/yacy.network.intranet.unit"); - } + if (post.get("usecase", "").equals("intranet") && !networkName.equals("intranet")) { + // switch to intranet network + sb.switchNetwork("defaults/yacy.network.intranet.unit"); // switch to p2p mode: enable ad-hoc networks between intranet users sb.setConfig(plasmaSwitchboard.INDEX_DIST_ALLOW, true); sb.setConfig(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, true);