X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=maps%2Fbin%2Fsignup.cgi;h=9d2b155818bbd293207266e1244c31beeb90924e;hb=4f37839bc9faacb57d9bce9196d916595f14b114;hp=a4296982d83662d7f80b33ee3c15144f7e77a5ba;hpb=020a4a5ea2be725b155cae3a2cadc9aba3911b9b;p=clearscm.git diff --git a/maps/bin/signup.cgi b/maps/bin/signup.cgi index a429698..9d2b155 100755 --- a/maps/bin/signup.cgi +++ b/maps/bin/signup.cgi @@ -16,41 +16,42 @@ use strict; use warnings; use FindBin; -$0 = $FindBin::Script; -use lib $FindBin::New; +local $0 = $FindBin::Script; + +use lib "$FindBin::Bin/../lib"; +use lib "$FindBin::Bin/../../lib"; use MAPS; use MAPSWeb; use CGI qw (:standard); -my $userid = param ("userid"); -my $fullname = param ("fullname"); -my $email = param ("email"); -my $password = param ("password"); -my $repeated_password = param ("repeated_password"); -my $mapspop = param ("MAPSPOP"); -my $history = param ("history"); -my $days = param ("days"); -my $dates = param ("dates"); -my $tag_and_forward = param ("tag_and_forward"); -my $message; +my $userid = param('userid'); +my $fullname = param('fullname'); +my $email = param('email'); +my $password = param('password'); +my $repeated_password = param('repeated_password'); +my $mapspop = param('MAPSPOP'); +my $history = param('history'); +my $days = param('days'); +my $dates = param('dates'); +my $tag_and_forward = param('tag_and_forward'); sub MyError { my $errmsg = shift; $userid = Heading ( - "getcookie", - "", - "Signup", - "Signup" + 'getcookie', + '', + 'Signup', + 'Signup' ); NavigationBar $userid; - print h2 {-align => "center", - -class => "error"}, "Error: " . $errmsg; + print h2 {-align => 'center', + -class => 'error'}, 'Error: ' . $errmsg; Footing; @@ -59,42 +60,47 @@ sub MyError { sub Body { # Check required fields - if ($userid eq "" ) { - MyError "You must specify a userid!"; + if ($userid eq '' ) { + MyError 'You must specify a userid!'; } # if - if ($email eq "" ) { - MyError "You must specify an email address!"; + if ($email eq '' ) { + MyError 'You must specify an email address!'; } # if - if ($password eq "") { - MyError "You must specify a password!"; + if ($password eq '') { + MyError 'You must specify a password!'; } # if - if ($fullname eq "") { - MyError "You must specify your full name!"; + if ($fullname eq '') { + MyError 'You must specify your full name!'; } # if # Password field checks if (length $password < 6) { - MyError "Password must be longer than 6 characters!"; + MyError 'Password must be longer than 6 characters!'; } # if if ($password ne $repeated_password) { - MyError "Passwords do not match"; + MyError 'Passwords do not match'; } # if - my $status = AddUser $userid, $fullname, $email, $password; + my $status = AddUser( + userid => $userid, + name => $fullname, + email => $email, + password => $password, + ); - if ($status ne 0) { - MyError "Username already exists"; + if ($status != 0) { + MyError 'Username already exists'; } # if my %options = ( - "MAPSPOP" => $mapspop, - "History" => $history, - "Page" => $days, - "Dates" => $dates, - "Tag&Forward" => $tag_and_forward + MAPSPOP => $mapspop, + History => $history, + Page => $days, + Dates => $dates, + 'Tag&Forward' => $tag_and_forward, ); - my $status = AddUserOptions $userid, %options; + $status = AddUserOptions($userid, %options); if ($status == 0) { print redirect ("/maps/?errormsg=User account \"$userid\" created.
You may now login"); @@ -103,6 +109,8 @@ sub Body { } else { MyError "Unable to add useropts for \"$userid\""; } # if + + return; } # Body Body;