Skip to content

Commit

Permalink
Implementation of registration method: not done.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Felds committed Nov 24, 2009
1 parent 209696c commit 20c161d
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions lib/November.pm
Expand Up @@ -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');
}

Expand Down

0 comments on commit 20c161d

Please sign in to comment.