]> andersk Git - sql-web.git/blobdiff - signup.php
jbarnold: contact.php
[sql-web.git] / signup.php
index 0b52815c42491d711d61079df0da4875e5e17591..27d80d51e9123836820e00da18c79c3bc273bed1 100644 (file)
@@ -4,7 +4,7 @@ require_once('mitsql.cfg.php');
 require_once('mitsql.lib.php');
 
 if (!isSSL())
-       redirect('index',false);
+       redirect('signup',true);
 
 if (isLoggedIn()) {
 
@@ -15,14 +15,22 @@ if (isLoggedIn()) {
        if (is_null($SSLCred)) {
                $err[] = 'Please install a valid certificate.';
        } else {
-       $Login2 = new Login($SSLUsername);
-       if (isPost() && $Login2->canSignup()) {
-               $u = new User($Login2->getUserId());
-               $u->signup($i_p1);
-               $Login2->refresh();
+               if (isPost() && $LoginSSL->canSignup()) {
+                       if (empty($i_p1)) {
+                               $err[] = 'Your password may not be blank.';
+                       } elseif ($i_p1 != $i_p2) {
+                               $err[] = 'Your confirmation password does not match.';
+                       } else {
+                               $u = new User($LoginSSL->getUserId());
+                               $u->signup($i_p1);
+                               $LoginSSL->refresh();
+                               sess('Login', $LoginSSL);
+                               redirect('login', true);
+                       }
+               } elseif (isPost()) {
+                       $err[] = 'You may not signup.';
+               }
        }
-       }
-
 }
 
 include 'tpl/signup.php';
This page took 0.092266 seconds and 4 git commands to generate.