PAN-54 IT WORKS
This commit is contained in:
@@ -30,15 +30,9 @@ public class UserCreationController {
|
||||
|
||||
@PostMapping({"/",""})
|
||||
public String registerUser(@Validated final UserCreationForm userCreationForm, final Model model) {
|
||||
//model.addAttribute("userID", userCreationForm.getUserID());
|
||||
model.addAttribute("username", userCreationForm.getUsername());
|
||||
model.addAttribute("password", userCreationForm.getPassword());
|
||||
//model.addAttribute("confirmPassword", userCreationForm.getConfirmPassword());
|
||||
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);
|
||||
|
||||
|
||||
@@ -5,15 +5,10 @@ import lombok.Setter;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Positive;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class UserCreationForm {
|
||||
@NotNull
|
||||
@Positive
|
||||
private int userID;
|
||||
|
||||
@NotNull
|
||||
@NotEmpty
|
||||
private String username;
|
||||
@@ -30,16 +25,6 @@ public class UserCreationForm {
|
||||
@NotEmpty
|
||||
private String emailAddress;
|
||||
|
||||
@NotNull
|
||||
@NotEmpty
|
||||
private String firstName;
|
||||
|
||||
@NotNull
|
||||
@NotEmpty
|
||||
private String lastName;
|
||||
|
||||
private String referrer; // optional
|
||||
|
||||
@NotNull
|
||||
private boolean agreedToTerms;
|
||||
}
|
||||
|
||||
@@ -116,11 +116,6 @@
|
||||
<body>
|
||||
New User Registration:
|
||||
<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:
|
||||
<input type="text" name="username" id="username" onchange="checkValidUsername()"/>
|
||||
<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>
|
||||
</label>
|
||||
<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.
|
||||
<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>
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
<h2>Hello! Welcome to Pandamonium™ Theorem Prover!!</h2>
|
||||
|
||||
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>
|
||||
</body>
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
<title>You're Registered!</title>
|
||||
</head>
|
||||
<body>
|
||||
Thank you for joining!
|
||||
<br><b>Username: </b><%= request.getParameter("username")%>
|
||||
<br><b>Theorem: </b><%= request.getParameter("emailAddress")%>
|
||||
<br><b>Email Address: </b><%= request.getParameter("emailAddress")%>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user