Using Orbiters function for auth

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1315 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent 38b19ff56a
commit 6822dce57b

@ -80,7 +80,7 @@ public class IndexMonitor {
(post.containsKey("deleteentry"))) { (post.containsKey("deleteentry"))) {
String authorization = ((String) header.get("Authorization", "xxxxxx")); String authorization = ((String) header.get("Authorization", "xxxxxx"));
if (authorization.length() != 0) { if (authorization.length() != 0) {
if (! switchboard.userDB.hasAdminRight(authorization)){ if (! switchboard.verifyAuthentication(header, true)){
// force log-in (again, because wrong password was given) // force log-in (again, because wrong password was given)
prop.put("AUTHENTICATE", "admin log-in"); prop.put("AUTHENTICATE", "admin log-in");
return prop; return prop;

@ -1891,8 +1891,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
if (authorization.length() == 0) return 1; // no authentication information given if (authorization.length() == 0) return 1; // no authentication information given
if ((((String) header.get("CLIENTIP", "")).equals("localhost")) && (adminAccountBase64MD5.equals(authorization))) return 3; // soft-authenticated for localhost if ((((String) header.get("CLIENTIP", "")).equals("localhost")) && (adminAccountBase64MD5.equals(authorization))) return 3; // soft-authenticated for localhost
if (adminAccountBase64MD5.equals(serverCodings.encodeMD5Hex(authorization))) return 4; // hard-authenticated, all ok if (adminAccountBase64MD5.equals(serverCodings.encodeMD5Hex(authorization))) return 4; // hard-authenticated, all ok
userDB.Entry entry = this.userDB.proxyAuth((String)header.get(httpHeader.AUTHORIZATION, "xxxxxx")); if(userDB.hasAdminRight((String)header.get(httpHeader.AUTHORIZATION, "xxxxxx")))
if((entry != null) && (entry.hasAdminRight()))
return 4; return 4;
return 0; // wrong password return 0; // wrong password
} }

Loading…
Cancel
Save