a bugfix against empty paramter "user"

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2870 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
(no author) 19 years ago
parent 78b7f6f7fd
commit 8c6e1531e6

@ -98,7 +98,7 @@ generic error.
::
Passwords do not match.
::
Username too short. Username must be >= 4 Charakters.
Username too short. Username must be >= 4 Characters.
#(/error)#
<p />
If you want to manage more Users, return to the <a href="User_p.html?change_user=true&user=#[username]#">user</a> page.

@ -93,21 +93,25 @@ public class User_p {
//current_user = edited user
} else if(post.containsKey("user") && !((String)post.get("user")).equals("newuser")){
if(post.containsKey("change_user")){
//defaults for newuser are set above
//defaults for newuser are set above
entry=sb.userDB.getEntry((String)post.get("user"));
//TODO: set username read-only in html
prop.put("page_current_user", post.get("user"));
prop.put("page_username", post.get("user"));
prop.put("page_firstname", entry.getFirstName());
prop.put("page_lastname", entry.getLastName());
prop.put("page_address", entry.getAddress());
prop.put("page_timelimit", entry.getTimeLimit());
prop.put("page_timeused", entry.getTimeUsed());
prop.put("page_proxyRight", (entry.hasProxyRight()?1:0));
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));
// program crashes if a submit with emty username was made on previous mask and the user clicked on the
// link: "If you want to manage more Users, return to the user page." (parameter "user" is empty)
if (entry != null) {
//TODO: set username read-only in html
prop.put("page_current_user", post.get("user"));
prop.put("page_username", post.get("user"));
prop.put("page_firstname", entry.getFirstName());
prop.put("page_lastname", entry.getLastName());
prop.put("page_address", entry.getAddress());
prop.put("page_timelimit", entry.getTimeLimit());
prop.put("page_timeused", entry.getTimeUsed());
prop.put("page_proxyRight", (entry.hasProxyRight()?1:0));
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"));
}

Loading…
Cancel
Save