mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
stealth mode shall only be available for authorized users, because
unauthorized users can otherwise be monitored by authorized users
This commit is contained in:
parent
2f1ec8d4a2
commit
5493389576
|
@ -100,8 +100,8 @@ public class yacysearch {
|
|||
final Switchboard sb = (Switchboard) env;
|
||||
sb.localSearchLastAccess = System.currentTimeMillis();
|
||||
|
||||
final boolean searchAllowed =
|
||||
sb.getConfigBool("publicSearchpage", true) || sb.verifyAuthentication(header);
|
||||
final boolean authorized = sb.verifyAuthentication(header);
|
||||
final boolean searchAllowed = sb.getConfigBool("publicSearchpage", true) || authorized;
|
||||
|
||||
boolean authenticated = sb.adminAuthenticated(header) >= 2;
|
||||
if ( !authenticated ) {
|
||||
|
@ -161,7 +161,7 @@ public class yacysearch {
|
|||
boolean p2pmode = sb.peers != null && sb.peers.sizeConnected() > 0 && indexReceiveGranted;
|
||||
boolean global = post == null || (post.get("resource", "local").equals("global") && p2pmode);
|
||||
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 (indexSegment == null) ConcurrentLog.info("yacysearch", "indexSegment == null");
|
||||
|
|
Loading…
Reference in New Issue
Block a user