]> iEval git - gruntmaster-page.git/blobdiff - lib/Gruntmaster/Page/Register.pm
From Redis to Postgres - Part 1 (Getting started)
[gruntmaster-page.git] / lib / Gruntmaster / Page / Register.pm
index 599f1c4b0aaaf089bc3173d80f8a4b082f688caf..ed2566058c7e334fbd989d399568c5b39d25be18 100644 (file)
@@ -1,17 +1,10 @@
 package Gruntmaster::Page::Register;
 
-use 5.014000;
-use strict;
-use warnings;
 use Gruntmaster::Page::Base;
-our @ISA = qw/Gruntmaster::Page::Base/;
-our $VERSION = '0.001';
-
 use Apache2::Authen::Passphrase qw/pwcheck pwset USER_REGEX/;
-use Plack::Request;
 
 sub generate{
-       my ($self, $format, $env, $ct, $job, $ext) = @_;
+       my ($self, $format, $env) = @_;
        my $r = Plack::Request->new($env);
        my ($username, $password, $confirm_password, $name, $email, $phone, $town, $university, $level) = map { die if length > 200; $_ } map {scalar $r->param($_)} qw/username password confirm_password name email phone town university level/;
 
@@ -21,13 +14,10 @@ sub generate{
        return reply 'All fields are required' if grep { !length } $username, $password, $confirm_password, $name, $email, $phone, $town, $university, $level;
        pwset $username, $password;
 
-       insert_user $username, name => $name, email => $email, phone => $phone, town => $town, university => $university, level => $level;
+       db($env)->create({id => $username, name => $name, email => $email, phone => $phone, town => $town, university => $university, level => $level});
 
-       #PUBLISH genpage =>  "us/index.html";
-       #PUBLISH genpage =>  "us/$username.html";
+       purge  "/us/";
        reply 'Registered successfully';
 }
 
-sub variants{ [[reply => 1, undef, undef, undef, undef, undef]] }
-
 1
This page took 0.022395 seconds and 4 git commands to generate.