forked from gnanet/mailzu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
55 lines (47 loc) · 1.45 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
* This file is the login page for the system
* It provides a login form and will automatically
* forward any users who have cookies set to ctrlpnl.php
* @author Nick Korbel <[email protected]>
* @version 06-25-04
* @package phpScheduleIt
*
* Copyright (C) 2003 - 2005 phpScheduleIt
* License: GPL, see LICENSE
*/
/**
* Include Template class
*/
include_once('lib/Template.class.php');
// Auth included in Template.php
$auth = new Auth();
$t = new Template();
$msg = '';
$resume = (isset($_POST['resume'])) ? $_POST['resume'] : '';
// Logging user out
if (isset($_GET['logout'])) {
$auth->doLogout();
}
else if (isset($_POST['login'])) {
$msg = $auth->doLogin($_POST['email'], $_POST['password'], (isset($_POST['setCookie']) ? 'y' : null), false, $resume, $_POST['language'], isset($_POST['domain'])? $_POST['domain'] : '');
}
else if (isset($_COOKIE['ID'])) {
$msg = $auth->doLogin($_COOKIE['ID'], '', 'y', $_COOKIE['ID'], $resume); // Check if user has cookies set up. If so, log them in automatically
}
$t->printHTMLHeader();
// Print out logoImage if it exists
echo (!empty($conf['ui']['logoImage']))
? '<div class="alignleft"><img src="' . $conf['ui']['logoImage'] . '" alt="logo" vspace="5"/></div>'
: '';
$t->startMain();
if (isset($_GET['auth'])) {
$auth->printLoginForm(translate('You are not logged in!'), $_GET['resume']);
}
else {
$auth->printLoginForm($msg);
}
$t->endMain();
// Print HTML footer
$t->printHTMLFooter();
?>