wikiAdmin Recht

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3006 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 18 years ago
parent 29fa17bd40
commit 4cb688018d

@ -63,7 +63,8 @@ Current User: #[username]#
<input type="checkbox" name="adminRight" #(adminRight)#::checked#(/adminRight)#>Admin<br />
<input type="checkbox" name="uploadRight" #(uploadRight)#::checked#(/uploadRight)#>Fileshare-Upload<br />
<input type="checkbox" name="downloadRight" #(downloadRight)#::checked#(/downloadRight)#>Fileshare-Download<br />
<input type="checkbox" name="blogRight" #(blogRight)#::checked#(/blogRight)#>Blog<br />
<input type="checkbox" name="blogRight" #(blogRight)#::checked#(/blogRight)#>Blog<br />
<input type="checkbox" name="wikiAdminRight" #(wikiAdminRight)#::checked#(/wikiAdminRight)#>Wiki Admin<br />
</td>
</tr>
<tr>

@ -111,6 +111,7 @@ public class User_p {
prop.put("page_downloadRight", (entry.hasDownloadRight()?1:0));
prop.put("page_adminRight", (entry.hasAdminRight()?1:0));
prop.put("page_blogRight", (entry.hasBlogRight()?1:0));
prop.put("page_wikiAdminRight", (entry.hasWikiAdminRight()?1:0));
}
}else if( post.containsKey("delete_user") && !((String)post.get("user")).equals("newuser") ){
sb.userDB.removeEntry((String)post.get("user"));
@ -138,6 +139,7 @@ public class User_p {
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");
String wikiAdminRight=( post.containsKey("wikiAdminRight")&&((String)post.get("wikiAdminRight")).equals("on") ? "true" : "false");
HashMap mem=new HashMap();
if( post.get("current_user").equals("newuser")){ //new user
@ -153,6 +155,7 @@ public class User_p {
mem.put(userDB.Entry.UPLOAD_RIGHT, uploadRight);
mem.put(userDB.Entry.DOWNLOAD_RIGHT, downloadRight);
mem.put(userDB.Entry.BLOG_RIGHT, blogRight);
mem.put(userDB.Entry.WIKIADMIN_RIGHT, wikiAdminRight);
try{
entry=sb.userDB.createEntry(username, mem);
@ -182,6 +185,7 @@ public class User_p {
entry.setProperty(userDB.Entry.DOWNLOAD_RIGHT, downloadRight);
entry.setProperty(userDB.Entry.ADMIN_RIGHT, adminRight);
entry.setProperty(userDB.Entry.BLOG_RIGHT, blogRight);
entry.setProperty(userDB.Entry.WIKIADMIN_RIGHT, wikiAdminRight);
}catch (IOException e){
}
}else{

@ -318,6 +318,7 @@ public final class userDB {
public static final String ADMIN_RIGHT = "adminRight";
public static final String PROXY_RIGHT = "proxyRight";
public static final String BLOG_RIGHT = "blogRight";
public static final String WIKIADMIN_RIGHT = "wikiAdminRight";
public static final int PROXY_ALLOK = 0; //can Surf
public static final int PROXY_ERROR = 1; //unknown error
@ -514,6 +515,9 @@ public final class userDB {
public boolean hasBlogRight() {
return (this.mem.containsKey(BLOG_RIGHT)?((String)this.mem.get(BLOG_RIGHT)).equals("true"):false);
}
public boolean hasWikiAdminRight() {
return (this.mem.containsKey(WIKIADMIN_RIGHT)?((String)this.mem.get(WIKIADMIN_RIGHT)).equals("true"):false);
}
public boolean isLoggedOut(){
return (this.mem.containsKey(LOGGED_OUT)?((String)this.mem.get(LOGGED_OUT)).equals("true"):false);
}

Loading…
Cancel
Save