]> andersk Git - sql-web.git/blame_incremental - login.php
bug: dropping database outside the interface stops interface for all users
[sql-web.git] / login.php
... / ...
CommitLineData
1<?php
2
3require_once('mitsql.cfg.php');
4require_once('mitsql.lib.php');
5
6if (isSSL()) {
7 if (is_null($SSLCred)) {
8 $err[] = 'Please install a valid certificate.';
9 }
10}
11
12if (isPost() && empty($err)) {
13
14 if (isSSL()) {
15 $Login = $LoginSSL;
16 } else {
17 $Login = new Login($i_u, $i_p);
18 }
19
20 if ($Login->exists() && !$Login->isEnabled()) {
21 $err[] = 'Account not active. <a href="do/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 }
27
28 if (empty($err)) {
29 sess('UserId', $Login->getUserId());
30 redirect('main');
31 }
32
33}
34
35isLoggedIn() && redirect('main');
36
37include 'tpl/login.php';
38
39?>
This page took 0.034031 seconds and 5 git commands to generate.