source: Dev/trunk/mainmenu.php @ 98

Last change on this file since 98 was 82, checked in by basvannuland, 14 years ago

Start with new separate question db

File size: 1.5 KB
Line 
1<?php
2require 'classes/master.php'; //should be at top of every page   
3
4if (isset($_POST['login'])) {
5    if ($_POST['username'] == '')
6        die("Please log in!");
7    else {
8        $userDBI = new UserDatabaseInterface();
9        $user_exists = $userDBI->checkUserName($_POST['username']);
10        if ($user_exists) {
11            $correct_password = $userDBI->checkUserPassword($_POST);
12            /* session remembers login */
13            if (!$correct_password)
14                die("The password you entered is not correct!");
15            else
16                $_SESSION['username'] = $_POST['username'];
17        }
18        else
19            die("Unknown user name");
20    }
21}
22else if (is_null($_SESSION['username']))
23    redirect('index.php');
24
25$surveys = Loader::loadSurveys();
26$applications = Loader::loadApplications();
27
28?>
29
30<!DOCTYPE html>
31<html>
32    <head>
33        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
34        <title>Facilitator</title>
35        <?php new StyleSheet(); ?>
36        <script type="text/javascript" src="js/menu.js"></script>
37    </head>
38    <body>
39        <div id="header">
40            <?php new Logo(); ?>
41        </div>
42
43        <div id="wrapper">
44
45            <div id="content">
46                               
47                    <?php new SessionMenu(); ?>
48
49                    <?php new ApplicationMenu($applications); ?>
50               
51                    <?php new SurveyMenu($surveys); ?>
52
53            </div>
54        </div>
55    </body>
56</html>
Note: See TracBrowser for help on using the repository browser.