Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implementation of registration method: not done.

  • Loading branch information...
commit 20c161dd292e5d64937bf976b2fa6a242d659e80 1 parent 209696c
Jason Felds authored
Showing with 33 additions and 0 deletions.
  1. +33 −0 lib/November.pm
View
33 lib/November.pm
@@ -202,6 +202,39 @@ class November does Session does Cache {
method register {
# Real work will come later.
+ if my $user_name = $.cgi.params<user_name> {
+ my $password = $.cgi.params<password>;
+ my $passagain = $.cgi.params<passagain>;
+
+ my Str @errors;
+
+ unless defined $password
+ {
+ push @errors, "Please provide a password for your mask.";
+ }
+
+ if $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 defined self.read_users(){$user_name}
+ {
+ push @errors, "This username is taken. Please choose another.";
+ }
+
+ if @errors.elems
+ {
+ self.response('register_failed.tmpl');
+ return;
+ }
+ # The actual writing takes place here.
+ }
self.response('register.tmpl');
}
Please sign in to comment.
Something went wrong with that request. Please try again.