configured
[bMailZu.git] / index.php
blob27a86018557b3b32dbf6b633564847073ed95b20
1 <?php
2 /**
3 * This file is the login page for the system
4 * It provides a login form and will automatically
5 * forward any users who have cookies set to ctrlpnl.php
6 * @author Nick Korbel <lqqkout13@users.sourceforge.net>
7 * @version 06-25-04
8 * @package phpScheduleIt
10 * Copyright (C) 2003 - 2005 phpScheduleIt
11 * License: GPL, see LICENSE
13 /**
14 * Include Template class
16 include_once('lib/Template.class.php');
18 // Auth included in Template.php
19 $auth = new Auth();
20 $t = new Template();
21 $msg = '';
23 $resume = (isset($_POST['resume'])) ? $_POST['resume'] : '';
25 // Logging user out
26 if (isset($_GET['logout'])) {
27 $auth->doLogout();
29 else if (isset($_POST['login'])) {
30 $msg = $auth->doLogin($_POST['email'], $_POST['password'], (isset($_POST['setCookie']) ? 'y' : null), false, $resume, $_POST['language'], isset($_POST['domain'])? $_POST['domain'] : '');
32 else if (isset($_COOKIE['ID'])) {
33 $msg = $auth->doLogin('', '', 'y', $_COOKIE['ID'], $resume); // Check if user has cookies set up. If so, log them in automatically
36 $t->printHTMLHeader();
38 // Print out logoImage if it exists
39 echo (!empty($conf['ui']['logoImage']))
40 ? '<div align="left"><img src="' . $conf['ui']['logoImage'] . '" alt="logo" vspace="5"/></div>'
41 : '';
43 $t->startMain();
45 if (isset($_GET['auth'])) {
46 $auth->printLoginForm(translate('You are not logged in!'), $_GET['resume']);
48 else {
49 $auth->printLoginForm($msg);
52 $t->endMain();
53 // Print HTML footer
54 $t->printHTMLFooter();