|
|
|
@ -42,7 +42,7 @@ public class index {
|
|
|
|
|
final Switchboard sb = (Switchboard) env;
|
|
|
|
|
final serverObjects prop = new serverObjects();
|
|
|
|
|
|
|
|
|
|
String forwardTarget = sb.getConfig(SwitchboardConstants.INDEX_FORWARD, "");
|
|
|
|
|
final String forwardTarget = sb.getConfig(SwitchboardConstants.INDEX_FORWARD, "");
|
|
|
|
|
if (forwardTarget.length() > 0) {
|
|
|
|
|
// forward the page
|
|
|
|
|
prop.put("forward", 1);
|
|
|
|
@ -59,9 +59,9 @@ public class index {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
final boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
|
|
|
|
|
boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
|
|
|
|
|
|
|
|
|
|
int searchoptions = (post == null) ? 1 : post.getInt("searchoptions", 1);
|
|
|
|
|
int searchoptions = (post == null) ? 0 : Math.min(1, post.getInt("searchoptions", 0));
|
|
|
|
|
if (!sb.getConfigBool("search.options", true)) searchoptions = 0;
|
|
|
|
|
final String former = (post == null) ? "" : post.get("former", "");
|
|
|
|
|
final int count = Math.min(100, (post == null) ? 10 : post.getInt("count", 10));
|
|
|
|
@ -72,10 +72,10 @@ public class index {
|
|
|
|
|
final String cat = (post == null) ? "href" : post.get("cat", "href");
|
|
|
|
|
final int type = (post == null) ? 0 : post.getInt("type", 0);
|
|
|
|
|
|
|
|
|
|
final boolean indexDistributeGranted = sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW, true);
|
|
|
|
|
//final boolean indexDistributeGranted = sb.getConfigBool(SwitchboardConstants.INDEX_DIST_ALLOW, true);
|
|
|
|
|
final boolean indexReceiveGranted = sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_ALLOW, true) ||
|
|
|
|
|
sb.getConfigBool(SwitchboardConstants.INDEX_RECEIVE_AUTODISABLED, true);
|
|
|
|
|
//global = global && indexDistributeGranted && indexReceiveGranted;
|
|
|
|
|
global = global && indexReceiveGranted;
|
|
|
|
|
|
|
|
|
|
// search domain
|
|
|
|
|
ContentDomain contentdom = ContentDomain.TEXT;
|
|
|
|
@ -102,10 +102,9 @@ public class index {
|
|
|
|
|
prop.put("searchoptions_count-10", (count == 10) ? "1" : "0");
|
|
|
|
|
prop.put("searchoptions_count-50", (count == 50) ? "1" : "0");
|
|
|
|
|
prop.put("searchoptions_count-100", (count == 100) ? "1" : "0");
|
|
|
|
|
prop.put("searchoptions_resource-select", (sb.peers == null) ? 0 : sb.peers.sizeConnected() > 0 ? 1 : 0);
|
|
|
|
|
prop.put("searchoptions_resource-select", (sb.peers == null || sb.peers.sizeConnected() == 0 || !global) ? 0 : 1);
|
|
|
|
|
prop.put("searchoptions_resource-select_global", global ? "1" : "0");
|
|
|
|
|
prop.put("searchoptions_resource-select_global-disabled", (indexReceiveGranted && indexDistributeGranted) ? "0" : "1");
|
|
|
|
|
prop.put("searchoptions_resource-select_global-disabled_reason", (indexReceiveGranted) ? "0" : (indexDistributeGranted ? "1" : "2"));
|
|
|
|
|
prop.put("searchoptions_resource-select_global-disabled", indexReceiveGranted ? "0" : "1");
|
|
|
|
|
prop.put("searchoptions_resource-select_local", global ? "0" : "1");
|
|
|
|
|
prop.put("searchoptions_urlmaskoptions", "0");
|
|
|
|
|
prop.putHTML("searchoptions_urlmaskoptions_urlmaskfilter", urlmaskfilter);
|
|
|
|
@ -120,6 +119,7 @@ public class index {
|
|
|
|
|
prop.put("pi", sb.getConfigBool("publicAdministratorPi", false) ? 1 : 0);
|
|
|
|
|
prop.putHTML("constraint", constraint);
|
|
|
|
|
prop.put("searchdomswitches", sb.getConfigBool("search.text", true) || sb.getConfigBool("search.audio", true) || sb.getConfigBool("search.video", true) || sb.getConfigBool("search.image", true) || sb.getConfigBool("search.app", true) ? 1 : 0);
|
|
|
|
|
prop.put("searchdomswitches_searchoptions", searchoptions);
|
|
|
|
|
prop.put("searchdomswitches_searchtext", sb.getConfigBool("search.text", true) ? 1 : 0);
|
|
|
|
|
prop.put("searchdomswitches_searchaudio", sb.getConfigBool("search.audio", true) ? 1 : 0);
|
|
|
|
|
prop.put("searchdomswitches_searchvideo", sb.getConfigBool("search.video", true) ? 1 : 0);
|
|
|
|
|