From 669f840eabdd66a9d8c60c904fc90cdd9115b19e Mon Sep 17 00:00:00 2001 From: karlchenofhell Date: Tue, 12 Jun 2007 13:48:27 +0000 Subject: [PATCH] - added ViewProfile / Impressum (default on) to local peer's robots.txt git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3874 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ConfigRobotsTxt_p.html | 2 ++ htroot/ConfigRobotsTxt_p.java | 2 ++ htroot/robots.java | 6 ++++-- htroot/robots.txt | 6 ++++++ source/de/anomic/http/httpdRobotsTxtConfig.java | 12 ++++++++++++ 5 files changed, 26 insertions(+), 2 deletions(-) diff --git a/htroot/ConfigRobotsTxt_p.html b/htroot/ConfigRobotsTxt_p.html index 478574176..158c9564e 100644 --- a/htroot/ConfigRobotsTxt_p.html +++ b/htroot/ConfigRobotsTxt_p.html @@ -41,6 +41,8 @@
+
+
 
diff --git a/htroot/ConfigRobotsTxt_p.java b/htroot/ConfigRobotsTxt_p.java index 5728c9e08..2bf1073fb 100644 --- a/htroot/ConfigRobotsTxt_p.java +++ b/htroot/ConfigRobotsTxt_p.java @@ -78,6 +78,7 @@ public class ConfigRobotsTxt_p { rbc.setStatusDisallowed(post.containsKey(httpdRobotsTxtConfig.STATUS)); rbc.setSurftipsDisallowed(post.containsKey(httpdRobotsTxtConfig.SURFTIPS)); rbc.setWikiDisallowed(post.containsKey(httpdRobotsTxtConfig.WIKI)); + rbc.setProfileDisallowed(post.containsKey(httpdRobotsTxtConfig.PROFILE)); env.setConfig(plasmaSwitchboard.ROBOTS_TXT, rbc.toString()); } } @@ -94,6 +95,7 @@ public class ConfigRobotsTxt_p { prop.put(httpdRobotsTxtConfig.STATUS + ".checked", (rbc.isStatusDisallowed()) ? 1 : 0); prop.put(httpdRobotsTxtConfig.SURFTIPS + ".checked", (rbc.isSurftipsDisallowed()) ? 1 : 0); prop.put(httpdRobotsTxtConfig.WIKI + ".checked", (rbc.isWikiDisallowed()) ? 1 : 0); + prop.put(httpdRobotsTxtConfig.PROFILE + ".checked", (rbc.isProfileDisallowed()) ? 1 : 0); return prop; } } diff --git a/htroot/robots.java b/htroot/robots.java index 219c54b7e..10cfa6bd4 100644 --- a/htroot/robots.java +++ b/htroot/robots.java @@ -28,6 +28,7 @@ public class robots { if (rbc.isStatusDisallowed()) prop.put(httpdRobotsTxtConfig.ALL + "_" + httpdRobotsTxtConfig.STATUS, 1); if (rbc.isSurftipsDisallowed()) prop.put(httpdRobotsTxtConfig.ALL + "_" + httpdRobotsTxtConfig.SURFTIPS, 1); if (rbc.isWikiDisallowed()) prop.put(httpdRobotsTxtConfig.ALL + "_" + httpdRobotsTxtConfig.WIKI, 1); + if (rbc.isProfileDisallowed()) prop.put(httpdRobotsTxtConfig.ALL + "_" + httpdRobotsTxtConfig.PROFILE, 1); if (rbc.isLockedDisallowed() || rbc.isDirsDisallowed()) { final ArrayList[] p = getFiles(env.getConfig(plasmaSwitchboard.HTROOT_PATH, plasmaSwitchboard.HTROOT_PATH_DEFAULT)); @@ -60,8 +61,9 @@ public class robots { if (file.isDirectory()) { htrootDirs.add(htroots[i]); } else if ( - (dot = htroots[i].lastIndexOf('.')) < 2 || - htroots[i].charAt(dot - 2) == '_' && htroots[i].charAt(dot - 1) == 'p' + ((dot = htroots[i].lastIndexOf('.')) < 2 || + htroots[i].charAt(dot - 2) == '_' && htroots[i].charAt(dot - 1) == 'p') && + !(htroots[i].endsWith("java") || htroots[i].endsWith("class")) ) { htrootFiles.add(htroots[i]); } diff --git a/htroot/robots.txt b/htroot/robots.txt index 092143049..cfb7d3567 100644 --- a/htroot/robots.txt +++ b/htroot/robots.txt @@ -51,6 +51,12 @@ Disallow: /share#(/fileshare)# # surftips Disallow: /Surftips.html#(/surftips)# +#(profile)#:: +# view profile +Disallow: /ViewProfile.html +Disallow: /ViewProfile.vcf +Disallow: /ViewProfile.xml#(/profile)# + :: # all Disallow: / diff --git a/source/de/anomic/http/httpdRobotsTxtConfig.java b/source/de/anomic/http/httpdRobotsTxtConfig.java index 67144f3aa..2086b2697 100644 --- a/source/de/anomic/http/httpdRobotsTxtConfig.java +++ b/source/de/anomic/http/httpdRobotsTxtConfig.java @@ -63,6 +63,7 @@ public final class httpdRobotsTxtConfig { public static final String LOCKED = "locked"; public static final String DIRS = "dirs"; public static final String NETWORK = "network"; + public static final String PROFILE = "profile"; public static final String ALL = "all"; private boolean allDisallowed = false; @@ -77,6 +78,7 @@ public final class httpdRobotsTxtConfig { private boolean networkDisallowed = false; private boolean surftipsDisallowed = false; private boolean bookmarksDisallowed = false; + private boolean profileDisallowed = true; public httpdRobotsTxtConfig() { } @@ -95,6 +97,7 @@ public final class httpdRobotsTxtConfig { if (active[i].equals(NETWORK)) { this.networkDisallowed = true; continue; } if (active[i].equals(LOCKED)) { this.lockedDisallowed = true; continue; } if (active[i].equals(DIRS)) { this.dirsDisallowed = true; continue; } + if (active[i].equals(PROFILE)) { this.profileDisallowed = true; continue; } if (active[i].equals(ALL)) { this.allDisallowed = true; continue; } } } @@ -119,6 +122,7 @@ public final class httpdRobotsTxtConfig { if (this.statusDisallowed) sb.append(STATUS).append(","); if (this.surftipsDisallowed) sb.append(SURFTIPS).append(","); if (this.wikiDisallowed) sb.append(WIKI).append(","); + if (this.profileDisallowed) sb.append(PROFILE).append(","); return sb.toString(); } @@ -217,4 +221,12 @@ public final class httpdRobotsTxtConfig { public void setWikiDisallowed(boolean wikiDisallowed) { this.wikiDisallowed = wikiDisallowed; } + + public boolean isProfileDisallowed() { + return profileDisallowed || this.allDisallowed; + } + + public void setProfileDisallowed(boolean profileDisallowed) { + this.profileDisallowed = profileDisallowed; + } }