Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Add a composer dependency 2. Add reCAPTCHA to request account page 3. Add two additional fields to Config table to store public/private keys
- Loading branch information
1 parent
fec9de2
commit 6193082
Showing
6 changed files
with
185 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
SET @parentID = (SELECT ID FROM ConfigSettings WHERE Name = 'APIKeys'); | ||
|
||
-- Cleanup | ||
DELETE FROM ConfigSettings WHERE Name='reCAPTCHAPrivate'; | ||
DELETE FROM ConfigSettings WHERE Name='reCAPTCHAPublic'; | ||
DELETE FROM Config WHERE ConfigID=(SELECT ID FROM ConfigSettings WHERE Name='reCAPTCHAPrivate'); | ||
DELETE FROM Config WHERE ConfigID=(SELECT ID FROM ConfigSettings WHERE Name='reCAPTCHAPublic'); | ||
|
||
-- Insert | ||
INSERT INTO ConfigSettings (`Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES ( | ||
'reCAPTCHAPrivate', 'Private Key for Google reCAPTCHA', 1, 0, 'text', @parentID, 'reCAPTCHA Private Key', 2 | ||
); | ||
INSERT INTO ConfigSettings (`Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES ( | ||
'reCAPTCHAPublic', 'Public Key for Google reCAPTCHA', 1, 0, 'text', @parentID, 'reCAPTCHA Public Key', 3 | ||
); |
This file contains 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,98 @@ | ||
<script src='https://www.google.com/recaptcha/api.js'></script> | ||
<div class="panel panel-default panel-center"> | ||
<div class="panel-heading"> | ||
<h3 class="panel-title"> | ||
{if $success} | ||
Account requested! | ||
{else} | ||
{$page_title} | ||
{/if} | ||
</h3> | ||
</div> | ||
<div class="panel-body"> | ||
{if $success} | ||
<div class="success-message"> | ||
<h1>Thank you!</h1> | ||
<p>Your request for an account has been received successfully.</p> | ||
<a href="/" class="btn btn-primary btn-block"> | ||
Return to Login Page | ||
</a> | ||
</div> | ||
{else} | ||
<p class="text-center"> | ||
Please fill in the form below to request a LORIS account.<br/> | ||
We will contact you once your account has been approved. | ||
</p> | ||
<form action="/request-account/" method="POST" | ||
name="form1" id="form1"> | ||
<div class="form-group"> | ||
<input type="text" name="name" class="form-control" id="name" size="20" | ||
placeholder="First Name" value="{$form.name}" /> | ||
<span id="helpBlock" class="help-block"> | ||
<b class="text-danger">{$error_message['name']}</b> | ||
</span> | ||
</div> | ||
<div class="form-group"> | ||
<input type="text" name="lastname" class="form-control" id="lastname" | ||
placeholder="Last Name" value="{$form.lastname}" /> | ||
<span id="helpBlock" class="help-block"> | ||
<b class="text-danger">{$error_message['lastname']}</b> | ||
</span> | ||
</div> | ||
<div class="form-group"> | ||
<input type="text" name="from" class="form-control" id="from" | ||
placeholder="Email" value="{$form.from}" /> | ||
<span id="helpBlock" class="help-block"> | ||
<b class="text-danger">{$error_message['from']}</b> | ||
</span> | ||
</div> | ||
<div class="form-group"> | ||
<select class="form-control" name="site" id="site"> | ||
<option value="">Choose Site</option> | ||
{foreach from=$site_list item=site key=idx} | ||
<option value="{$idx}" {if $idx == $form.site}selected{/if}> | ||
{$site} | ||
</option> | ||
{/foreach} | ||
</select> | ||
<span id="helpBlock" class="help-block"> | ||
<b class="text-danger">{$error_message['site']}</b> | ||
</span> | ||
</div> | ||
<div class="form-group"> | ||
<label class="checkbox-inline"> | ||
<input | ||
type="checkbox" | ||
name="examiner" | ||
id="examiner" | ||
{if $form.examiner === "on"}checked{/if} | ||
/> Examiner Role | ||
</label> | ||
<label class="checkbox-inline"> | ||
<input | ||
type="checkbox" | ||
name="radiologist" | ||
id="radiologist" | ||
{if $form.radiologist === "on"}checked{/if} | ||
/> Radiologist | ||
</label> | ||
</div> | ||
{if $captcha_key} | ||
<div class="form-group"> | ||
{* Google reCaptcha *} | ||
<div class="g-recaptcha" data-sitekey="{$captcha_key}"></div> | ||
<span id="helpBlock" class="help-block"> | ||
<b class="text-danger">{$error_message['captcha']}</b> | ||
</span> | ||
</div> | ||
{/if} | ||
<div class="form-group"> | ||
<input type="submit" name="Submit" class="btn btn-primary btn-block" | ||
value="Request Account"/> | ||
</div> | ||
<div class="form-group"> | ||
<a href="/">Back to login page</a> | ||
</div> | ||
{/if} | ||
</div> | ||
</div> |