Skip to content
This repository was archived by the owner on Jun 9, 2020. It is now read-only.

Commit 70d8718

Browse files
committed
Add UETA confirmation
1 parent 6287eb0 commit 70d8718

File tree

6 files changed

+100
-26
lines changed

6 files changed

+100
-26
lines changed

app/Http/Controllers/Vip/IndexController.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,18 @@ public function getWaiver()
8686
if ($this->ticket->waiver_pdf !== null) {
8787
return \Redirect::to($this->ticket->waiver_pdf);
8888
}
89-
90-
$waiverContent = file_get_contents(sprintf('https://srnd-cdn.net/codeday/waiver-%sminor.html', ($this->ticket->is_minor ? '' : 'non')));
91-
92-
return \View::make('vip/waiver', ['waiver_content' => $waiverContent]);
89+
$key = hash_hmac('whirlpool', $this->ticket->id.'-'.$this->ticket->age, \Config::get('app.key'));
90+
91+
if (\Input::get('key') == $key) {
92+
if (\Input::get('consent')) {
93+
$waiverContent = file_get_contents(sprintf('https://srnd-cdn.net/codeday/waiver-%sminor.html', ($this->ticket->is_minor ? '' : 'non')));
94+
return \View::make('vip/waiver', ['waiver_content' => $waiverContent]);
95+
} else {
96+
return \View::make('vip/waiver-consent', ['key' => $key]);
97+
}
98+
} else {
99+
return \redirect('/'.$this->ticket->id.'/waiver?key='.$key);
100+
}
93101
}
94102

95103
public function getSyncwaiver()
@@ -98,4 +106,9 @@ public function getSyncwaiver()
98106

99107
return \Redirect::to('/'.$this->ticket->id);
100108
}
109+
110+
public function getCognitojs()
111+
{
112+
return response(file_get_contents('https://services.cognitoforms.com/s/7hYXr3TPxk6yIpJxjqVoFQ'))->header('Content-type', 'text/plain');
113+
}
101114
}

app/Http/routes.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
$routes = function () {
3030
// Domain Routes
3131
\Route::group(['domain' => isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'vip.x' ? 'vip.x' : 'codeday.vip'], function () {
32+
\Route::get('/cognito.js', '\CodeDay\Http\Controllers\Vip\IndexController@getCognitojs');
3233
\Route::Controller('/{ticket}/ticket', '\CodeDay\Http\Controllers\Vip\TicketController');
3334
\Route::Controller('/{ticket}/certificate', '\CodeDay\Http\Controllers\Vip\CertificateController');
3435
\Route::Controller('/{ticket}', '\CodeDay\Http\Controllers\Vip\IndexController');

public/assets/img/srnd_logo.svg

Lines changed: 52 additions & 0 deletions
Loading

resources/views/vip/esign-consent.twig

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% extends "template.twig" %}
2+
{% block section %}vip{% endblock %}
3+
{% block page %}utea{% endblock %}
4+
{% block title %}E-Sign Your Waiver{% endblock %}
5+
{% block meta %}
6+
<meta name="robots" content="noindex,nofollow" />
7+
{% endblock %}
8+
{% block nav %}<nav><ul><li><a href="/{{ ticket.id }}">{{ ticket.name }}</a></li></ul></nav>{% endblock %}
9+
{% block content %}
10+
<h3>Want to e-sign your waiver?</h3>
11+
12+
<p>You can save time by e-signing your waiver. Here's some more information on how it works:</p>
13+
<div class="esign-consent" style="height: 10rem;border:1px solid gray;padding:1rem;overflow-y:scroll">
14+
{% include "parts/esign-consent.twig" %}
15+
</div>
16+
17+
<p>
18+
<a href="/{{ticket.id}}/waiver?key={{key}}&consent=yes" class="agree">E-Sign</a>
19+
</p>
20+
<a href="https://srnd-cdn.net/codeday/waiver-{%if not ticket.is_minor %}non{% endif %}minor.pdf" target="_blank">Print and sign instead.</a>
21+
{% endblock %}

resources/views/vip/waiver.twig

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
{% block nav %}<nav><ul><li><a href="/{{ ticket.id }}">{{ ticket.name }}</a></li></ul></nav>{% endblock %}
99
{% block content %}
1010
<section class="waiver" id="waiver">
11-
11+
{% if ticket.is_minor %}
12+
<h2>This waiver must be signed by the parent or legal guardian of {{ ticket.name }}:</h2>
13+
{% else %}
14+
<h2>Please read and e-sign this waiver (by signing you certify you are not a minor):</h2>
15+
{% endif %}
1216
<style>
1317
@import url("https://srnd.org/assets/fonts/avenir-next.css");
1418
.page {
@@ -89,12 +93,12 @@
8993
</style>
9094
<div class="page" style="display:none">
9195
<header>
92-
<img src="https://srnd.org/assets/img/logo.svg" />
96+
<img src="/assets/img/srnd_logo.svg" />
9397
<h1>PARTICIPANT AGREEMENT, WAIVER, and RELEASE of LIABILITY</h1>
9498
</header>
9599
{{ waiver_content|raw }}
96100
<div class="cognito">
97-
<script src="https://services.cognitoforms.com/s/7hYXr3TPxk6yIpJxjqVoFQ"></script>
101+
<script src="/cognito.js"></script>
98102
<script>Cognito.load("forms", { id: "5", entry: {
99103
"Ticket": "{{ ticket.id|escape('js') }}",
100104
"ParticipantName": "{{ ticket.name|escape('js') }}",
@@ -119,8 +123,8 @@
119123
</div>
120124
</div>
121125
<div class="alternative">
122-
<p>If you have any problems signing your waiver, you can
123-
<a href="https://srnd-cdn.net/codeday/waiver-{%if not ticket.is_minor %}non{% endif %}minor.pdf" target="_blank">print and sign.</a></p>
126+
<p>If you have any problems signing your waiver, please disable any ad-blockers. If you still have problems, you can
127+
<a href="https://srnd-cdn.net/codeday/waiver-{%if not ticket.is_minor %}non{% endif %}minor.pdf" target="_blank">print and sign your waiver.</a></p>
124128
</div>
125129
<div class="success" style="display: none">
126130
<p>Thanks, your waiver has been successfully signed! You can download a copy at any time from your ticket page. <a href="/{{ticket.id}}">Click here to return to it.</a></p>

0 commit comments

Comments
 (0)