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