summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/login.html.ep11
-rw-r--r--templates/recover_password.html.ep77
-rw-r--r--templates/set_password.html.ep60
3 files changed, 148 insertions, 0 deletions
diff --git a/templates/login.html.ep b/templates/login.html.ep
index 58ff0ed..283aa60 100644
--- a/templates/login.html.ep
+++ b/templates/login.html.ep
@@ -102,4 +102,15 @@
<div class="col s3 m3 l3">
</div>
</div>
+ <div class="row" style="margin-top: 2em;">
+ <div class="col s3 m3 l3">
+ </div>
+ <div class="col s6 m6 l6 center-align">
+ <a href="/recover">
+ Passwort vergessen
+ </a>
+ </div>
+ <div class="col s3 m3 l3">
+ </div>
+ </div>
%= end
diff --git a/templates/recover_password.html.ep b/templates/recover_password.html.ep
new file mode 100644
index 0000000..4ebc41a
--- /dev/null
+++ b/templates/recover_password.html.ep
@@ -0,0 +1,77 @@
+<h1>Passwort zurücksetzen</h1>
+% if (my $invalid = stash('invalid')) {
+ <div class="row">
+ <div class="col s12">
+ <div class="card red darken-4">
+ <div class="card-content white-text">
+ % if ($invalid eq 'csrf') {
+ <span class="card-title">Ungültiger CSRF-Token</span>
+ <p>Sind Cookies aktiviert? Ansonsten könnte es sich um einen
+ Fall von <a
+ href="https://de.wikipedia.org/wiki/Cross-Site-Request-Forgery">CSRF</a>
+ handeln.</p>
+ % }
+ % elsif ($invalid eq 'credentials') {
+ <span class="card-title">Ungültige Daten</span>
+ <p>Falscher Account oder falsches Mail-Adresse.</p>
+ % }
+ % elsif ($invalid eq 'in progress') {
+ <span class="card-title">Passwort-Reset wird durchgeführt</span>
+ <p>Es wurde bereits ein Reset-Link verschickt.</p>
+ % }
+ % elsif ($invalid eq 'token') {
+ <span class="card-title">Ungültiger Token</span>
+ <p>Der Reset-Token ist ungültig oder abgelaufen. Neuen beantragen?</p>
+ % }
+ % else {
+ <span class="card-title">Unbekannter Fehler</span>
+ <p>„<%= $invalid %>“</p>
+ % }
+ </div>
+ </div>
+ </div>
+ </div>
+% }
+% if (stash('success')) {
+ <div class="row">
+ <div class="col s12">
+ <div class="card green darken-4">
+ <div class="card-content white-text">
+ <span class="card-title">Passwort-Reset wird durchgeführt</span>
+ <p>
+ Ein für zwei Tage gültiger Reset-Link wurde an deine
+ Mail-Adresse verschickt. Sobald du damit ein neues Passwort
+ gesetzt hast, kannst du dich wieder anmelden.
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+% }
+%= form_for '/recover' => (method => 'POST') => begin
+ %= csrf_field
+ <div class="row">
+ <div class="input-field col s12">
+ <i class="material-icons prefix">account_circle</i>
+ %= text_field 'user', id => 'user', class => 'validate', required => undef, maxlength => 60, autocomplete => 'username'
+ <label for="user">Account</label>
+ </div>
+ <div class="input-field col s12">
+ <i class="material-icons prefix">email</i>
+ %= email_field 'email', id => 'email', class => 'validate', required => undef, maxlength => 250
+ <label for="email">Mail-Adresse</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col s3 m3 l3">
+ </div>
+ <div class="col s6 m6 l6 center-align">
+ <button class="btn waves-effect waves-light" type="submit" name="action" value="initiate">
+ Passwort-Reset
+ <i class="material-icons right">send</i>
+ </button>
+ </div>
+ <div class="col s3 m3 l3">
+ </div>
+ </div>
+%= end
diff --git a/templates/set_password.html.ep b/templates/set_password.html.ep
new file mode 100644
index 0000000..571ee0b
--- /dev/null
+++ b/templates/set_password.html.ep
@@ -0,0 +1,60 @@
+% if (my $invalid = stash('invalid')) {
+ <div class="row">
+ <div class="col s12">
+ <div class="card red darken-4">
+ <div class="card-content white-text">
+ % if ($invalid eq 'csrf') {
+ <span class="card-title">Ungültiger CSRF-Token</span>
+ <p>Sind Cookies aktiviert? Ansonsten könnte es sich um einen
+ Fall von <a
+ href="https://de.wikipedia.org/wiki/Cross-Site-Request-Forgery">CSRF</a>
+ handeln.</p>
+ % }
+ % elsif ($invalid eq 'password_notequal') {
+ <span class="card-title">Passwort ungültig</span>
+ <p>Die angegebenen neuen Passwörter sind nicht identisch.</p>
+ % }
+ % elsif ($invalid eq 'password_short') {
+ <span class="card-title">Passwort zu kurz</span>
+ <p>Das neue Passwort muss mindestens acht Zeichen lang sein.</p>
+ % }
+ % else {
+ <span class="card-title">Unbekannter Fehler</span>
+ <p>„<%= $invalid %>“</p>
+ % }
+ </div>
+ </div>
+ </div>
+ </div>
+% }
+
+<h1>Neues Passwort eintragen</h1>
+%= form_for '/recover' => (method => 'POST') => begin
+ %= csrf_field
+ %= hidden_field 'id' => param('id')
+ %= hidden_field 'token' => param('token')
+ <div class="row">
+ <div class="input-field col l6 m12 s12">
+ <i class="material-icons prefix">lock</i>
+ %= password_field 'newpw', id => 'password', class => 'validate', required => undef, minlength => 8, autocomplete => 'new-password'
+ <label for="password">Neues Passwort</label>
+ </div>
+ <div class="input-field col l6 m12 s12">
+ <i class="material-icons prefix">lock</i>
+ %= password_field 'newpw2', id => 'password2', class => 'validate', required => undef, minlength => 8, autocomplete => 'new-password'
+ <label for="password2">Passwort wiederholen</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col s3 m3 l3">
+ </div>
+ <div class="col s6 m6 l6 center-align">
+ <button class="btn waves-effect waves-light" type="submit" name="action" value="set_password">
+ Eintragen
+ <i class="material-icons right">send</i>
+ </button>
+ </div>
+ <div class="col s3 m3 l3">
+ </div>
+ </div>
+%= end