From af1da090bbe218ce0e2b675b78c445a9847a3bbe Mon Sep 17 00:00:00 2001 From: allo Date: Tue, 21 Feb 2006 09:45:09 +0000 Subject: [PATCH] blogRight in UserDB. Look at the Fileshare, for how to use it. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1722 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/User_p.html | 1 + htroot/User_p.java | 5 ++++- source/de/anomic/data/userDB.java | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/htroot/User_p.html b/htroot/User_p.html index b7b752b37..a424c3d71 100644 --- a/htroot/User_p.html +++ b/htroot/User_p.html @@ -63,6 +63,7 @@ Current User: #[username]# Admin
Fileshare-Upload
Fileshare-Download
+ Blog
diff --git a/htroot/User_p.java b/htroot/User_p.java index 18b95566d..a8cc044c7 100644 --- a/htroot/User_p.java +++ b/htroot/User_p.java @@ -107,6 +107,7 @@ public class User_p { prop.put("page_uploadRight", (entry.hasUploadRight()?1:0)); prop.put("page_downloadRight", (entry.hasDownloadRight()?1:0)); prop.put("page_adminRight", (entry.hasAdminRight()?1:0)); + prop.put("page_blogRight", (entry.hasBlogRight()?1:0)); }else if( post.containsKey("delete_user") && !((String)post.get("user")).equals("newuser") ){ sb.userDB.removeEntry((String)post.get("user")); } @@ -132,6 +133,7 @@ public class User_p { String uploadRight=( post.containsKey("uploadRight")&&((String)post.get("uploadRight")).equals("on") ? "true" : "false"); String downloadRight=( post.containsKey("downloadRight")&&((String)post.get("downloadRight")).equals("on") ? "true" : "false"); String adminRight=( post.containsKey("adminRight")&&((String)post.get("adminRight")).equals("on") ? "true" : "false"); + String blogRight=( post.containsKey("blogRight")&&((String)post.get("blogRight")).equals("on") ? "true" : "false"); HashMap mem=new HashMap(); if( post.get("current_user").equals("newuser")){ //new user @@ -146,7 +148,7 @@ public class User_p { mem.put(userDB.Entry.PROXY_RIGHT, proxyRight); mem.put(userDB.Entry.UPLOAD_RIGHT, uploadRight); mem.put(userDB.Entry.DOWNLOAD_RIGHT, downloadRight); - mem.put(userDB.Entry.ADMIN_RIGHT, adminRight); + mem.put(userDB.Entry.BLOG_RIGHT, blogRight); entry=sb.userDB.createEntry(username, mem); sb.userDB.addEntry(entry); @@ -170,6 +172,7 @@ public class User_p { entry.setProperty(userDB.Entry.UPLOAD_RIGHT, uploadRight); entry.setProperty(userDB.Entry.DOWNLOAD_RIGHT, downloadRight); entry.setProperty(userDB.Entry.ADMIN_RIGHT, adminRight); + entry.setProperty(userDB.Entry.BLOG_RIGHT, blogRight); }catch (IOException e){ } }else{ diff --git a/source/de/anomic/data/userDB.java b/source/de/anomic/data/userDB.java index 0b87f46de..35187db10 100644 --- a/source/de/anomic/data/userDB.java +++ b/source/de/anomic/data/userDB.java @@ -264,6 +264,7 @@ public final class userDB { public static final String DOWNLOAD_RIGHT = "downloadRight"; public static final String ADMIN_RIGHT = "adminRight"; public static final String PROXY_RIGHT = "proxyRight"; + public static final String BLOG_RIGHT = "blogRight"; // this is a simple record structure that hold all properties of a user private Map mem; @@ -445,6 +446,9 @@ public final class userDB { public boolean hasAdminRight() { return (this.mem.containsKey(ADMIN_RIGHT)?((String)this.mem.get(ADMIN_RIGHT)).equals("true"):false); } + public boolean hasBlogRight() { + return (this.mem.containsKey(BLOG_RIGHT)?((String)this.mem.get(BLOG_RIGHT)).equals("true"):false); + } public boolean isLoggedOut(){ return (this.mem.containsKey(LOGGED_OUT)?((String)this.mem.get(LOGGED_OUT)).equals("true"):false); }