added a disable function in RemoteCrawl_p servlet which prevents setting

of remote crawl if peer is not a senior or principal peer
pull/1/head
Michael Peter Christen 12 years ago
parent 1e3d8cc235
commit eb80405a16

@ -17,9 +17,11 @@
</legend>
<form id="ConfigForm" method="post" action="RemoteCrawl_p.html" enctype="multipart/form-data" accept-charset="UTF-8">
<dl>
#(disabled)#::<dt></dt><dd><span class="error">Your peer cannot accept remote crawls because you need senior or principal peer status for that!</span></dd>#(/disabled)#
<dt>
<dt>
<label for="crawlResponse">Accept Remote Crawl Requests</label>
<input type="checkbox" id="crawlResponse" name="crawlResponse" onclick="window.location.href='RemoteCrawl_p.html?#(crawlResponse)#crawlResponse=on::crawlResponse=off#(/crawlResponse)#'" #(crawlResponse)#::checked="checked" #(/crawlResponse)#/>
<input type="checkbox" #(disabled)#::disabled="disabled"#(/disabled)# id="crawlResponse" name="crawlResponse" onclick="window.location.href='RemoteCrawl_p.html?#(crawlResponse)#crawlResponse=on::crawlResponse=off#(/crawlResponse)#'" #(crawlResponse)#::checked="checked" #(/crawlResponse)#/>
</dt>
<dd>
Perform web indexing upon request of another peer.<br />

@ -69,14 +69,16 @@ public class RemoteCrawl_p {
}
}
// set seed information directly
sb.peers.mySeed().setFlagAcceptRemoteCrawl(sb.getConfigBool("crawlResponse", false));
// write remote crawl request settings
prop.put("crawlResponse", sb.getConfigBool("crawlResponse", false) ? "1" : "0");
prop.put("disabled", !sb.peers.mySeed().isActive() && !sb.peers.mySeed().getFlagAcceptRemoteCrawl() ? 1 : 0);
prop.put("crawlResponse", sb.peers.mySeed().getFlagAcceptRemoteCrawl() ? 1 : 0);
long RTCbusySleep = Math.max(1, env.getConfigLong(SwitchboardConstants.CRAWLJOB_REMOTE_TRIGGERED_CRAWL_BUSYSLEEP, 100));
final int RTCppm = (int) (60000L / RTCbusySleep);
prop.put("acceptCrawlLimit", RTCppm);
// set seed information directly
sb.peers.mySeed().setFlagAcceptRemoteCrawl(sb.getConfigBool("crawlResponse", false));
// -------------------------------------------------------------------------------------
// write network list

@ -3522,8 +3522,8 @@ public final class Switchboard extends serverSwitch {
this.peers.mySeed().setFlagDirectConnect(true);
this.peers.mySeed().setLastSeenUTC();
this.peers.mySeed().put(Seed.UTC, GenericFormatter.UTCDiffString());
this.peers.mySeed().setFlagAcceptRemoteCrawl(getConfig("crawlResponse", "").equals("true"));
this.peers.mySeed().setFlagAcceptRemoteIndex(getConfig("allowReceiveIndex", "").equals("true"));
this.peers.mySeed().setFlagAcceptRemoteCrawl(getConfigBool("crawlResponse", true));
this.peers.mySeed().setFlagAcceptRemoteIndex(getConfigBool("allowReceiveIndex", true));
//mySeed.setFlagAcceptRemoteIndex(true);
}

Loading…
Cancel
Save