mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
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:
parent
49972b6193
commit
ff79c52fc0
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user