]> andersk Git - sql-web.git/blob - login.php
mitsql: contact page, signup fixes, main info on index
[sql-web.git] / login.php
1 <?php
2
3 require_once('mitsql.cfg.php');
4 require_once('mitsql.lib.php');
5
6 if (isSSL()) {
7         if (is_null($SSLCred)) {
8                 $err[] = 'Please install a valid certificate.';
9         }
10 }
11
12 if (empty($err) && isPost()) {
13         
14         if (isSSL()) {
15             $Login = new Login($SSLUsername);
16                 $Login->update($cred['Name'],$cred['Email']);
17                 sess('Login', $Login);
18         } else {
19                 $Login = new Login($i_u, $i_p);
20                 if ($Login->exists() && !$Login->isEnabled()) {
21                         $err[] = 'Account not active. <a href="signup">Did you signup yet?</a>.';
22                 } elseif (!$Login->exists()) {
23                         $err[] = 'Nonexistant account or invalid password.';
24                 } elseif (!$Login->canLogin()) {
25                         $err[] = 'That account is no longer valid. Please contact the staff.';
26                 } else {
27                         sess('Login', $Login);
28                 }
29         }
30
31 }
32
33 isLoggedIn() && redirect('main');
34
35 include 'tpl/login.php';
36
37 ?>
This page took 0.784862 seconds and 5 git commands to generate.