diff --git a/lib/November.pm b/lib/November.pm index 208b896..300a57f 100644 --- a/lib/November.pm +++ b/lib/November.pm @@ -201,34 +201,35 @@ class November does Session does Cache { } method register { - # Real work will come later. if my $user_name = $.cgi.params { my $password = $.cgi.params; my $passagain = $.cgi.params; my Str @errors; - unless defined $password { - push @errors, "Please provide a password for your mask."; + if !defined $password || $password eq '' { + push @errors, 'Please provide a password.'; } - if $password.chars < 6 { - push @errors, "Please provide at least six characters for your password."; + if $password && $password.chars < 6 { + push @errors, 'Please provide at least six characters for ' + 'your password.'; } - if $password neq $passagain { - push @errors, "The password and confirmation must match."; + if $password & $passagain && $password neq $passagain { + push @errors, 'The password and confirmation must match.'; } if defined self.read_users(){$user_name} { - push @errors, "This username is taken. Please choose another."; + push @errors, 'This username is taken. Please choose another.'; } if @errors { + # TODO: Send @errors to template. self.response('register_failed.tmpl'); return; } - # The actual writing takes place here. + # TODO: Implement registration code. } self.response('register.tmpl'); }