]> andersk Git - sql-web.git/blobdiff - signup.php
git-svn-id: svn://presbrey.mit.edu/sql/mitsql@109 a142d4bd-2cfb-0310-9673-cb33a7e74f58
[sql-web.git] / signup.php
index e958d29a3109c48ac551dd1bad1d2f8b152e7b12..f8de8e9c1addb288999caef139622c80152674c3 100644 (file)
@@ -4,21 +4,32 @@ require_once('mitsql.cfg.php');
 require_once('mitsql.lib.php');
 
 if (!isSSL())
-       redirect2(flipSSL());
+       redirect('signup',true);
 
 if (isLoggedIn()) {
 
        redirect('index');
 
 } else {
-
-       $Login2 = new Login($SSLUsername);
-       if (isPost() && $Login2->canSignup()) {
-               $u = new User($Login2->getUserId());
-               $u->signup($i_p1);
-               $Login2->refresh();
+       
+       if (is_null($SSLCred)) {
+               $err[] = 'Please install a valid certificate.';
+       } else {
+               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();
+                               redirect('login', true);
+                       }
+               } elseif (isPost()) {
+                       $err[] = 'You may not signup.';
+               }
        }
-
 }
 
 include 'tpl/signup.php';
This page took 0.025332 seconds and 4 git commands to generate.