1 25 26 package net.killingar.forum.actions.user; 27 28 import net.killingar.forum.internal.User; 29 30 public class Add extends Edit 31 { 32 34 36 38 40 42 protected void doValidation() 44 { 45 user.birthdate = new java.sql.Date (year-1900, month, date); 46 47 if (newpassword != null && !newpassword.equals(newpassword2)) 48 addError("newpassword2", "passwords do not match"); 49 } 50 51 protected String doExecute() 52 { 53 try 54 { 55 if (modify) 56 { 57 userID = manager.addUser(user, newpassword); 58 59 return SUCCESS; 60 } 61 62 user = new UserData(manager, new User()); 63 64 user.groups = manager.getGroupsOfUser(userID); 65 66 user.email = net.killingar.forum.internal.Utils.unHTML(user.email ); 67 user.icq = net.killingar.forum.internal.Utils.unHTML(user.icq ); 68 user.telephone = net.killingar.forum.internal.Utils.unHTML(user.telephone ); 69 user.mobilephone = net.killingar.forum.internal.Utils.unHTML(user.mobilephone ); 70 user.address = net.killingar.forum.internal.Utils.unHTML(user.address ); 71 user.other = net.killingar.forum.internal.Utils.unHTML(user.other ); 72 user.realName = net.killingar.forum.internal.Utils.unHTML(user.realName ); 73 user.publicEmail = net.killingar.forum.internal.Utils.unHTML(user.publicEmail ); 74 user.restrictedEmail = net.killingar.forum.internal.Utils.unHTML(user.restrictedEmail); 75 user.secretEmail = net.killingar.forum.internal.Utils.unHTML(user.secretEmail ); 76 user.birthdate = new java.sql.Date (year-1900, month, date); 77 78 return INPUT; 79 } 80 catch (Exception e) 81 { 82 e.printStackTrace(); 83 addErrorMessage("executing "+getClass().toString()+" action failed, exception thrown: "+e.toString()); 84 return ERROR; 85 } 86 } 87 88 } 89 | Popular Tags |