diff --git a/Kinza/lib/Kinza.pm b/Kinza/lib/Kinza.pm
index 2657abb..49a2b37 100644
--- a/Kinza/lib/Kinza.pm
+++ b/Kinza/lib/Kinza.pm
@@ -202,7 +202,7 @@ post '/register' => sub {
session 'error', undef;
- unless ($email = param('email')
+ unless ($email = lc param('email')
and $pass1 = param('password') and $pass2 = param('password2')) {
session 'error' => 'You must fill in all values';
return redirect '/register';
@@ -289,7 +289,7 @@ post '/resend' => sub {
}
$student->update({
- email => param('email'),
+ email => lc param('email'),
});
# reread from database
$student->discard_changes;
@@ -316,7 +316,7 @@ post '/login' => sub {
}
my $user = $rs{Student}->find({
- email => params->{email},
+ email => lc params->{email},
});
unless ($user) {
session 'error' => 'Invalid email or password';
@@ -356,7 +356,7 @@ post '/password' => sub {
session 'error' => 'You must give an email address';
return redirect '/password';
}
- my $email = params->{email};
+ my $email = lc params->{email};
my $student = $rs{Student}->find({
email => $email,
});
diff --git a/Kinza/lib/Kinza/Schema/Result/Student.pm b/Kinza/lib/Kinza/Schema/Result/Student.pm
index bcd2624..42293ca 100644
--- a/Kinza/lib/Kinza/Schema/Result/Student.pm
+++ b/Kinza/lib/Kinza/Schema/Result/Student.pm
@@ -194,6 +194,18 @@ sub allowed_courses {
return $self->form->year->allowed_courses;
}
+sub is_registered {
+ my $self = shift;
+
+ return length $self->password;
+}
+
+sub is_verified {
+ my $self = shift;
+
+ return $self->is_registered && ! $self->verify;
+}
+
# You can replace this text with custom code or comments, and it will be preserved on regeneration
__PACKAGE__->meta->make_immutable;
1;
diff --git a/Kinza/views/layouts/main.tt b/Kinza/views/layouts/main.tt
index 95ac2ce..bb09718 100644
--- a/Kinza/views/layouts/main.tt
+++ b/Kinza/views/layouts/main.tt
@@ -58,6 +58,16 @@
+