PAN-54 IT WORKS

This commit is contained in:
BrittanyBi
2019-05-01 22:32:09 -06:00
parent 8cc31b5c21
commit 1c69c8998c
5 changed files with 4 additions and 42 deletions
@@ -30,15 +30,9 @@ public class UserCreationController {
@PostMapping({"/",""}) @PostMapping({"/",""})
public String registerUser(@Validated final UserCreationForm userCreationForm, final Model model) { public String registerUser(@Validated final UserCreationForm userCreationForm, final Model model) {
//model.addAttribute("userID", userCreationForm.getUserID());
model.addAttribute("username", userCreationForm.getUsername()); model.addAttribute("username", userCreationForm.getUsername());
model.addAttribute("password", userCreationForm.getPassword()); model.addAttribute("password", userCreationForm.getPassword());
//model.addAttribute("confirmPassword", userCreationForm.getConfirmPassword());
model.addAttribute("emailAddress", userCreationForm.getEmailAddress()); model.addAttribute("emailAddress", userCreationForm.getEmailAddress());
//model.addAttribute("firstName", userCreationForm.getFirstName());
//model.addAttribute("lastName", userCreationForm.getLastName());
//model.addAttribute("referrer", userCreationForm.getReferrer());
//model.addAttribute("TnCAgreement", userCreationForm.isAgreedToTerms());
LOG.info("Saving user {}...", userCreationForm); LOG.info("Saving user {}...", userCreationForm);
@@ -5,15 +5,10 @@ import lombok.Setter;
import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
@Getter @Getter
@Setter @Setter
public class UserCreationForm { public class UserCreationForm {
@NotNull
@Positive
private int userID;
@NotNull @NotNull
@NotEmpty @NotEmpty
private String username; private String username;
@@ -30,16 +25,6 @@ public class UserCreationForm {
@NotEmpty @NotEmpty
private String emailAddress; private String emailAddress;
@NotNull
@NotEmpty
private String firstName;
@NotNull
@NotEmpty
private String lastName;
private String referrer; // optional
@NotNull @NotNull
private boolean agreedToTerms; private boolean agreedToTerms;
} }
-20
View File
@@ -116,11 +116,6 @@
<body> <body>
New User Registration: New User Registration:
<form method="post" action="" enctype="utf8"> <form method="post" action="" enctype="utf8">
<label for="userID">User ID:
<input type="text" name="userID" id="userID" onchange="checkIDBeginsWith900()"/>
<div class="error-messages" id="errorUserID">Invalid MSU student ID</div>
</label>
<br>
<label for="username">Username: <label for="username">Username:
<input type="text" name="username" id="username" onchange="checkValidUsername()"/> <input type="text" name="username" id="username" onchange="checkValidUsername()"/>
<div class="error-messages" id="errorUsername">Username must contain only letters, numbers, and underscores</div> <div class="error-messages" id="errorUsername">Username must contain only letters, numbers, and underscores</div>
@@ -141,21 +136,6 @@
<div class="error-messages" id="errorEmailAddress">Invalid email address</div> <div class="error-messages" id="errorEmailAddress">Invalid email address</div>
</label> </label>
<br> <br>
<label for="firstName">First Name:
<input type="text" name="firstName" id="firstName"/>
<div class="error-messages"></div>
</label>
<br>
<label for="lastName">Last Name:
<input type="text" name="lastName" id="lastName"/>
<div class="error-messages"></div>
</label>
<br>
<label for="referrer">Referrer:
<input type="text" name="referrer" id="referrer" />
<div class="error-messages" id="errorReferrer">Username must contain only letters, numbers, and underscores, and cannot be your own!</div>
</label>
<br>
<label for="agreedToTerms">I agree to the terms and conditions. <label for="agreedToTerms">I agree to the terms and conditions.
<input type="checkbox" name="agreedToTerms" id="agreedToTerms" onclick="checkAgreedToTerms()"/> <input type="checkbox" name="agreedToTerms" id="agreedToTerms" onclick="checkAgreedToTerms()"/>
<div class="error-messages" id="errorAgreedToTerms">You must agree to the terms and conditions in order to register.</div> <div class="error-messages" id="errorAgreedToTerms">You must agree to the terms and conditions in order to register.</div>
+2
View File
@@ -21,6 +21,8 @@
<h2>Hello! Welcome to Pandamonium™ Theorem Prover!!</h2> <h2>Hello! Welcome to Pandamonium™ Theorem Prover!!</h2>
Click on this <strong><a href="/theorem/">link</a></strong> to visit theorem entering page. Click on this <strong><a href="/theorem/">link</a></strong> to visit theorem entering page.
<h4 class="text-center"><a href="/login">Sign In</a></h4>
<h4 class="text-center"><a href="/createuser">New here? Register</a></h4>
</div> </div>
</div> </div>
</body> </body>
@@ -4,7 +4,8 @@
<title>You're Registered!</title> <title>You're Registered!</title>
</head> </head>
<body> <body>
Thank you for joining!
<br><b>Username: </b><%= request.getParameter("username")%> <br><b>Username: </b><%= request.getParameter("username")%>
<br><b>Theorem: </b><%= request.getParameter("emailAddress")%> <br><b>Email Address: </b><%= request.getParameter("emailAddress")%>
</body> </body>
</html> </html>