catch the "username too short" exception

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2844 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent f32db7e619
commit 5a6488256d

@ -97,6 +97,8 @@ User changed: #[username]#
generic error.
::
Passwords do not match.
::
Username too short. Username must be >= 4 Charakters.
#(/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.

@ -150,10 +150,15 @@ public class User_p {
mem.put(userDB.Entry.DOWNLOAD_RIGHT, downloadRight);
mem.put(userDB.Entry.BLOG_RIGHT, blogRight);
entry=sb.userDB.createEntry(username, mem);
sb.userDB.addEntry(entry);
prop.put("page_text_username", username);
prop.put("page_text", 1);
try{
entry=sb.userDB.createEntry(username, mem);
sb.userDB.addEntry(entry);
prop.put("page_text_username", username);
prop.put("page_text", 1);
}catch(IllegalArgumentException e){
prop.put("page_error", 3);
}
} else { //edit user

@ -127,7 +127,7 @@ public final class userDB {
}
}
public Entry createEntry(String userName, HashMap userProps) {
public Entry createEntry(String userName, HashMap userProps) throws IllegalArgumentException{
Entry entry = new Entry(userName,userProps);
return entry;
}
@ -329,7 +329,7 @@ public final class userDB {
private String userName;
private Calendar oldDate, newDate;
public Entry(String userName, Map mem) {
public Entry(String userName, Map mem) throws IllegalArgumentException {
if ((userName == null) || (userName.length() == 0))
throw new IllegalArgumentException("Username needed.");
if(userName.length()>128){

Loading…
Cancel
Save