]> andersk Git - sql-web.git/blob - signup.php
signup exits rather than die'ing
[sql-web.git] / signup.php
1 <?php
2 /*
3         (c) 2005 Joe Presbrey
4 */
5
6 require_once('mitsql.cfg.php');
7 require_once('mitsql.lib.php');
8
9 if (!isSSL())
10         redirect('signup',true);
11
12 if (isLoggedIn()) {
13
14         redirect('index');
15
16 } else {
17         
18         if (is_null($SSLCred)) {
19                 $err[] = 'Please install a valid certificate.';
20         } else {
21                 if (isPost() && $LoginSSL->canSignup()) {
22                         if (empty($i_p1)) {
23                                 $err[] = 'Your password may not be blank.';
24                         } elseif ($i_p1 != $i_p2) {
25                                 $err[] = 'Your confirmation password does not match.';
26                         } else {
27                                 $u = new User($LoginSSL->getUserId());
28                                 $u->signup($i_p1);
29                                 $LoginSSL->refresh();
30                                 redirect('login', true);
31                         }
32                 } elseif (isPost()) {
33                         $err[] = 'You may not signup.';
34                 }
35         }
36 }
37
38 include 'tpl/signup.php';
39
40 ?>
This page took 0.60198 seconds and 5 git commands to generate.