-
Notifications
You must be signed in to change notification settings - Fork 2
Add kaptcha verification to signup module #638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vagisha
wants to merge
4
commits into
release26.3-SNAPSHOT
Choose a base branch
from
26.3_fb_signup-kaptcha
base: release26.3-SNAPSHOT
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+178
−84
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9aef658
Added kaptcha verification to SignUpApiAction
vagisha c79cf0e
Unified BeginAction and SignUpApiAction signup paths
vagisha 495d02e
Address Claude Code reviewer comments
vagisha 3e1101f
SignUpController.java: fix Copilot review comments (PR #638, round 1)
vagisha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,37 @@ | ||
| <%@ page import="org.labkey.api.view.ActionURL" %> | ||
| <%@ page import="org.labkey.api.view.HttpView" %> | ||
| <%@ page import="org.labkey.signup.SignUpController.BeginAction" %> | ||
| <%@ page import="org.labkey.signup.SignUpController.SignupForm" %> | ||
| <%@ page extends="org.labkey.api.jsp.JspBase" %> | ||
| <%@ taglib prefix="labkey" uri="http://www.labkey.org/taglib" %> | ||
| <% | ||
| SignupForm form = (SignupForm)HttpView.currentModel(); | ||
| ActionURL url = urlFor(BeginAction.class); | ||
| String contextPath = request.getContextPath(); | ||
| %> | ||
|
|
||
| <!-- Display errors here --> | ||
| <labkey:errors/> | ||
|
|
||
| <form action="<%=h(url)%>" method=post> | ||
| <labkey:csrf/> | ||
| <table> | ||
| <tr> | ||
| <td class="labkey-form-label"><label for="firstName">First Name</label> *</td> | ||
| <td nowrap><input size="20" type="text" id="firstName" name="firstName" value="<%=h(form.getFirstName())%>"/></td> | ||
| </tr> | ||
| <tr> | ||
| <td class="labkey-form-label"><label for="lastName">Last Name</label> *</td> | ||
| <td nowrap><input size="20" type="text" id="lastName" name="lastName" value="<%=h(form.getLastName())%>"/></td> | ||
| </tr> | ||
| <tr> | ||
| <td class="labkey-form-label"><label for="organization">Organization</label> *</td> | ||
| <td nowrap><input size="20" type="text" id="organization" name="organization" value="<%=h(form.getOrganization())%>"/></td> | ||
| </tr> | ||
| <tr> | ||
| <td class="labkey-form-label"><label for="email">Email</label> *</td> | ||
| <td nowrap><input size="20" type="text" id="email" name="email" value="<%=h(form.getEmail())%>"/></td> | ||
| </tr> | ||
| <tr> | ||
| <td colspan="2"><labkey:button text="Submit" /></td> | ||
| </tr> | ||
| </table> | ||
| </form> | ||
| <labkey:form method="post" layout="horizontal" autoComplete="off" style="max-width:600px;"> | ||
| <labkey:input name="firstName" id="firstName" label="First Name" isRequired="true" size="50" value="<%=form.getFirstName()%>"/> | ||
| <labkey:input name="lastName" id="lastName" label="Last Name" isRequired="true" size="50" value="<%=form.getLastName()%>"/> | ||
| <labkey:input name="organization" id="organization" label="Organization" isRequired="true" size="50" value="<%=form.getOrganization()%>"/> | ||
| <labkey:input name="email" id="email" label="Email" isRequired="true" size="50" value="<%=form.getEmail()%>"/> | ||
| <labkey:input name="emailConfirm" id="emailConfirm" label="Confirm Email" isRequired="true" size="50" value="<%=form.getEmailConfirm()%>"/> | ||
|
vagisha marked this conversation as resolved.
|
||
|
|
||
| <%-- Verification: standalone full-width block --%> | ||
| <div style="margin-top:20px;"><strong>Verification</strong></div> | ||
| <p style="margin:8px 0 4px 0;">Please enter the characters shown below (case-insensitive).</p> | ||
| <p style="margin:0 0 8px 0;"><a id="kaptchaReload" href="#">Get a new image.</a></p> | ||
| <img id="kaptchaImg" src="<%=h(contextPath)%>/kaptcha.jpg" alt="Captcha" width="200" height="50" style="border: 1px solid #ccc; display:block; margin-bottom:6px;"/> | ||
| <input type="text" id="kaptchaText" name="kaptchaText" aria-label="Verification code" style="width:200px;"/> | ||
|
|
||
| <div style="margin-top:20px; clear:both;"> | ||
| <button type="submit" class="btn btn-default labkey-button">Register</button> | ||
| </div> | ||
| </labkey:form> | ||
|
|
||
| <script type="text/javascript" nonce="<%=getScriptNonce()%>"> | ||
| document.getElementById("kaptchaReload").addEventListener("click", function(e) { | ||
| e.preventDefault(); | ||
| var img = document.getElementById("kaptchaImg"); | ||
| img.src = img.src.split("?")[0] + "?ts=" + new Date().getTime(); | ||
| }); | ||
| </script> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.