]> andersk Git - sql-web.git/blob - signup.php
change password feature
[sql-web.git] / signup.php
1 <?php
2
3 require_once('mitsql.cfg.php');
4 require_once('mitsql.lib.php');
5
6 if (!isSSL())
7         redirect('signup',true);
8
9 if (isLoggedIn()) {
10
11         redirect('index');
12
13 } else {
14         
15         if (is_null($SSLCred)) {
16                 $err[] = 'Please install a valid certificate.';
17         } else {
18                 if (isPost() && $LoginSSL->canSignup()) {
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();
27                                 sess('Login', $LoginSSL);
28                                 redirect('login', true);
29                         }
30                 } elseif (isPost()) {
31                         $err[] = 'You may not signup.';
32                 }
33         }
34 }
35
36 include 'tpl/signup.php';
37
38 ?>
This page took 0.104346 seconds and 5 git commands to generate.