Permalink
Browse files

Quickie one-liner from login useful in register.

  • Loading branch information...
1 parent a817694 commit 1c9a59850d0a6bc00e866496dd2f39076521483b Jason Felds committed Nov 25, 2009
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/November.pm
View
@@ -219,8 +219,8 @@ class November does Session does Cache {
if $password & $passagain && $password neq $passagain {
push @errors, 'The password and confirmation must match.';
}
-
- if defined self.read_users(){$user_name} {
+ my %users = self.read_users();
+ if defined %users{$user_name} {
push @errors, 'This username is taken. Please choose another.';
}
@@ -229,7 +229,8 @@ class November does Session does Cache {
self.response('register_failed.tmpl');
return;
}
- # TODO: Implement registration code.
+ my $phash = digest(digest($user_name, 'sha256') ~ $password, 'sha256');
+ # TODO: Add the user to the users file.
}
self.response('register.tmpl');
}

0 comments on commit 1c9a598

Please sign in to comment.