source: Dev/trunk/mainmenu.php @ 78

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

save and load application
start with save and load session

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