X-Git-Url: http://andersk.mit.edu/gitweb/sql-web.git/blobdiff_plain/dc478ec893c32ad501d678f9f82506de091e6b0b..HEAD:/signup.php diff --git a/signup.php b/signup.php index e958d29..5d55fcc 100644 --- a/signup.php +++ b/signup.php @@ -1,24 +1,39 @@ 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); + // TODO: missing function call, replace? + // $LoginSSL->refresh(); + redirect('login', true); + } + } elseif (isPost()) { + $err[] = 'You may not signup.'; + } } - } include 'tpl/signup.php';