Merge remote-tracking branch 'upstream/master'

pull/1/head
Roland Haeder 12 years ago
commit 59b4fdd5ad

@ -100,8 +100,8 @@ public class yacysearch {
final Switchboard sb = (Switchboard) env; final Switchboard sb = (Switchboard) env;
sb.localSearchLastAccess = System.currentTimeMillis(); sb.localSearchLastAccess = System.currentTimeMillis();
final boolean searchAllowed = final boolean authorized = sb.verifyAuthentication(header);
sb.getConfigBool("publicSearchpage", true) || sb.verifyAuthentication(header); final boolean searchAllowed = sb.getConfigBool("publicSearchpage", true) || authorized;
boolean authenticated = sb.adminAuthenticated(header) >= 2; boolean authenticated = sb.adminAuthenticated(header) >= 2;
if ( !authenticated ) { if ( !authenticated ) {
@ -161,7 +161,7 @@ public class yacysearch {
boolean p2pmode = sb.peers != null && sb.peers.sizeConnected() > 0 && indexReceiveGranted; boolean p2pmode = sb.peers != null && sb.peers.sizeConnected() > 0 && indexReceiveGranted;
boolean global = post == null || (post.get("resource", "local").equals("global") && p2pmode); boolean global = post == null || (post.get("resource", "local").equals("global") && p2pmode);
boolean stealthmode = p2pmode && !global; boolean stealthmode = p2pmode && !global;
prop.put("topmenu_resource-select", stealthmode ? 2 : global ? 1 : 0); prop.put("topmenu_resource-select", !authorized ? 0 : stealthmode ? 2 : global ? 1 : 0);
if ( post == null || indexSegment == null || env == null || !searchAllowed ) { if ( post == null || indexSegment == null || env == null || !searchAllowed ) {
if (indexSegment == null) ConcurrentLog.info("yacysearch", "indexSegment == null"); if (indexSegment == null) ConcurrentLog.info("yacysearch", "indexSegment == null");

@ -1076,8 +1076,10 @@ public class CollectionConfiguration extends SchemaConfiguration implements Seri
public int getInternalLinks(final byte[] id) { public int getInternalLinks(final byte[] id) {
int il = (int) this.internal_links_counter.get(id); int il = (int) this.internal_links_counter.get(id);
if (il >= 0) return il; if (il >= 0) return il;
SolrConnector connector = this.segment.fulltext().getDefaultConnector();
if (connector == null) return 0;
try { try {
SolrDocument doc = this.segment.fulltext().getDefaultConnector().getDocumentById(ASCII.String(id), CollectionSchema.inboundlinkscount_i.getSolrFieldName()); SolrDocument doc = connector.getDocumentById(ASCII.String(id), CollectionSchema.inboundlinkscount_i.getSolrFieldName());
if (doc == null) { if (doc == null) {
this.internal_links_counter.put(id, 0); this.internal_links_counter.put(id, 0);
return 0; return 0;

Loading…
Cancel
Save