]> andersk Git - sql-web.git/blame_incremental - login.php
show service stats on index
[sql-web.git] / login.php
... / ...
CommitLineData
1<?php
2/*
3 (c) 2005 Joe Presbrey
4*/
5
6require_once('mitsql.cfg.php');
7require_once('mitsql.lib.php');
8
9if (isSSL()) {
10 if (is_null($SSLCred)) {
11 $err[] = 'Please install a valid certificate.';
12 }
13}
14
15if (isPost() && empty($err)) {
16
17 if (isSSL()) {
18 $Login = $LoginSSL;
19 } else {
20 $Login = new Login($i_u, $i_p);
21 }
22
23 if ($Login->exists() && !$Login->isEnabled()) {
24 $err[] = 'Account not active. <a href="do/signup">Did you signup yet?</a>.';
25 } elseif (!$Login->exists()) {
26 $err[] = 'Nonexistant account or invalid password.';
27 } elseif (!$Login->canLogin()) {
28 $err[] = 'That account is no longer valid. Please contact the staff (sql@mit.edu).';
29 }
30
31 if (empty($err)) {
32 sess('UserId', $Login->getUserId());
33 redirect('main?refresh');
34 }
35
36}
37
38isLoggedIn() && redirect('main');
39
40include 'tpl/login.php';
41
42?>
This page took 0.071306 seconds and 5 git commands to generate.