]>
Commit | Line | Data |
---|---|---|
dc478ec8 JP |
1 | <?php |
2 | ||
3 | require_once('mitsql.cfg.php'); | |
4 | require_once('mitsql.lib.php'); | |
5 | ||
6 | if (!isSSL()) | |
1389493c | 7 | redirect('signup',true); |
dc478ec8 JP |
8 | |
9 | if (isLoggedIn()) { | |
10 | ||
11 | redirect('index'); | |
12 | ||
13 | } else { | |
50855303 JP |
14 | |
15 | if (is_null($SSLCred)) { | |
16 | $err[] = 'Please install a valid certificate.'; | |
17 | } else { | |
1389493c | 18 | if (isPost() && $LoginSSL->canSignup()) { |
88b7d384 JP |
19 | if (empty($i_p1)) { |
20 | $err[] = 'Your password may not be blank.'; | |
21 | } elseif ($i_p1 != $i_p2) { | |
22 | $err[] = 'Your confirmation password does not match.'; | |
23 | } else { | |
24 | $u = new User($LoginSSL->getUserId()); | |
25 | $u->signup($i_p1); | |
26 | $LoginSSL->refresh(); | |
88b7d384 JP |
27 | redirect('login', true); |
28 | } | |
29 | } elseif (isPost()) { | |
30 | $err[] = 'You may not signup.'; | |
1389493c | 31 | } |
dc478ec8 | 32 | } |
dc478ec8 JP |
33 | } |
34 | ||
35 | include 'tpl/signup.php'; | |
36 | ||
37 | ?> |