Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

if a new pop-up page is set in config portal, then this page applies also to the default page configuration for the httpd if no path is given.

Michael Peter Christen8aba045ba132
diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java
index 3135e3573..791d42584 100644
--- a/htroot/ConfigBasic.java
+++ b/htroot/ConfigBasic.java
@@ -229,8 +229,8 @@ public class ConfigBasic {
final boolean properName = (sb.peers.mySeed().getName().length() >= 3) && (!(Seed.isDefaultPeerName(sb.peers.mySeed().getName())));
final boolean properPort = (sb.peers.mySeed().isSenior()) || (sb.peers.mySeed().isPrincipal());
- if ((env.getConfig("defaultFiles", "").startsWith("ConfigBasic.html,"))) {
- env.setConfig("defaultFiles", env.getConfig("defaultFiles", "").substring(17));
+ if ((env.getConfig(SwitchboardConstants.BROWSER_DEFAULT, "").startsWith("ConfigBasic.html,"))) {
+ env.setConfig(SwitchboardConstants.BROWSER_DEFAULT, env.getConfig(SwitchboardConstants.BROWSER_DEFAULT, "").substring(17));
env.setConfig("browserPopUpPage", "Status.html");
HTTPDFileHandler.initDefaultPath();
}
diff --git a/htroot/ConfigPortal.java b/htroot/ConfigPortal.java
index 8c6052737..540713903 100644
--- a/htroot/ConfigPortal.java
+++ b/htroot/ConfigPortal.java
@@ -50,14 +50,16 @@ public class ConfigPortal {
if (post.containsKey("popup")) {
final String popup = post.get("popup", "status");
if ("front".equals(popup)) {
- sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html?display=2");
+ sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html");
} else if ("search".equals(popup)) {
- sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacysearch.html?display=2");
+ sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacysearch.html");
} else if ("interactive".equals(popup)) {
- sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacyinteractive.html?display=2");
+ sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "yacyinteractive.html");
} else {
sb.setConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "Status.html");
}
+ sb.setConfig(SwitchboardConstants.BROWSER_DEFAULT, sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "index.html"));
+ HTTPDFileHandler.initDefaultPath();
}
if (post.containsKey("searchpage_set")) {
final String newGreeting = post.get(SwitchboardConstants.GREETING, "");
diff --git a/source/de/anomic/http/server/HTTPDFileHandler.java b/source/de/anomic/http/server/HTTPDFileHandler.java
index dd8f665fc..e1afb615c 100644
--- a/source/de/anomic/http/server/HTTPDFileHandler.java
+++ b/source/de/anomic/http/server/HTTPDFileHandler.java
@@ -192,7 +192,7 @@ public final class HTTPDFileHandler {
public static final void initDefaultPath() {
// create default files array
- defaultFiles = switchboard.getConfig("defaultFiles","index.html").split(",");
+ defaultFiles = switchboard.getConfig(SwitchboardConstants.BROWSER_DEFAULT,"index.html").split(",");
if (defaultFiles.length == 0) defaultFiles = new String[] {"index.html"};
indexForward = switchboard.getConfig(SwitchboardConstants.INDEX_FORWARD, "");
if (indexForward.startsWith("/")) indexForward = indexForward.substring(1);
diff --git a/source/net/yacy/search/SwitchboardConstants.java b/source/net/yacy/search/SwitchboardConstants.java
index 5da3c6a21..01bc22d01 100644
--- a/source/net/yacy/search/SwitchboardConstants.java
+++ b/source/net/yacy/search/SwitchboardConstants.java
@@ -426,6 +426,7 @@ public final class SwitchboardConstants {
*/
public static final String BROWSER_POP_UP_TRIGGER = "browserPopUpTrigger";
public static final String BROWSER_POP_UP_PAGE = "browserPopUpPage";
+ public static final String BROWSER_DEFAULT = "defaultFiles";
/**
* forwarder of the index page