index.php 1.65 KB
Newer Older
1
2
<?php
/**
3
 * This program is part of Mahara
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 *
 * @package    mahara
20
21
 * @subpackage core
 * @author     Penny Leach <penny@catalyst.net.nz>
22
23
24
25
26
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
 * @copyright  (C) 2006,2007 Catalyst IT Ltd http://catalyst.net.nz
 *
 */

27
28
29
30
define('INTERNAL', 1);
define('PUBLIC', 1);
define('MENUITEM', 'home');

31
32
require('init.php');

33
// check to see if we're installed...
34
if (!get_config('installed')) {
35
    redirect(get_config('wwwroot') . 'admin/index.php');
36
37
}

38
39
// Check for whether the user is logged in, before processing the page. After
// this, we can guarantee whether the user is logged in or not for this page.
40
41
if (!$SESSION->is_logged_in()) {
    require_once('form.php');
42
43
44
    $form = auth_get_login_form();
    $form['renderer'] = 'div';
    $login_form = form($form);
45
46
}

47
48
49
50
$smarty = smarty();
if (!$SESSION->is_logged_in()) {
    $smarty->assign('login_form', $login_form);
}
51
$smarty->display('index.tpl');
52

53
?>