summaryrefslogtreecommitdiff
path: root/templates/set_password.html.ep
blob: 571ee0b671135617eaff8201ddd2365f0e9b9491 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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