bookmark users can now edit bookmarks.

TO COME: tag bookmarks with username, list bookmarks of a special user, filter private bookmarks for users.

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3274 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
allo 2007-01-23 10:24:26 +00:00
parent 49972b6193
commit ff79c52fc0
2 changed files with 9 additions and 4 deletions

View File

@ -72,7 +72,8 @@ public class Bookmarks {
int max_count=10;
String tagName="";
int start=0;
boolean isAdmin=switchboard.verifyAuthentication(header, true);
userDB.Entry user=switchboard.userDB.getUser(header);
boolean isAdmin=(switchboard.verifyAuthentication(header, true) || user!= null && user.hasBookmarkRight());
//defaultvalues
prop.put("mode", 0);

View File

@ -54,6 +54,7 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Random;
import de.anomic.http.httpHeader;
import de.anomic.kelondro.kelondroBase64Order;
import de.anomic.kelondro.kelondroDyn;
import de.anomic.kelondro.kelondroException;
@ -169,7 +170,10 @@ public final class userDB {
}
return null;
}
public Entry getUser(String auth, String ip, String cookies){
public Entry getUser(httpHeader header){
return getUser((String) header.get(httpHeader.AUTHORIZATION), (String)header.get("CLIENTIP"), header.getHeaderCookies());
}
public Entry getUser(String auth, String ip, String cookies){
Entry entry=null;
if(auth != null)
entry=proxyAuth(auth);
@ -187,9 +191,9 @@ public final class userDB {
public boolean hasAdminRight(String auth, String ip, String cookies){
Entry entry=getUser(auth, ip, cookies);
if(entry != null)
return true;
return entry.hasAdminRight();
else if(cookieAdminAuth(cookies))
return true;
return entry.hasAdminRight();
else
return false;
}