From f2f886725122551ab87b4141ee17a69d49f98217 Mon Sep 17 00:00:00 2001 From: allo Date: Thu, 22 Dec 2005 12:55:25 +0000 Subject: [PATCH] auth with userDB in IndexMonitor git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1243 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/IndexMonitor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htroot/IndexMonitor.java b/htroot/IndexMonitor.java index 48160845f..8e9ef202d 100644 --- a/htroot/IndexMonitor.java +++ b/htroot/IndexMonitor.java @@ -43,6 +43,7 @@ // javac -classpath .:../Classes Settings_p.java // if the shell's current path is HTROOT +import de.anomic.data.userDB; import de.anomic.http.httpHeader; import de.anomic.plasma.plasmaSwitchboard; import de.anomic.server.serverCodings; @@ -80,6 +81,7 @@ public class IndexMonitor { (post.containsKey("clearlist")) || (post.containsKey("deleteentry"))) { String authorization = ((String) header.get("Authorization", "xxxxxx")).trim().substring(6); + userDB.Entry entry = switchboard.userDB.proxyAuth(authorization); if (authorization.length() == 0) { // force log-in prop.put("AUTHENTICATE", "admin log-in"); @@ -87,7 +89,7 @@ public class IndexMonitor { } String adminAccountBase64MD5 = switchboard.getConfig("adminAccountBase64MD5", ""); boolean authenticated = (adminAccountBase64MD5.equals(serverCodings.encodeMD5Hex(authorization))); - if (!authenticated) { + if (!authenticated && !entry.hasAdminRight()) { // force log-in (again, because wrong password was given) prop.put("AUTHENTICATE", "admin log-in"); return prop;