Last change
on this file since 114 was
112,
checked in by fpvanagthoven, 14 years ago
|
Code to get questions and put them in objects
|
File size:
1.6 KB
|
Rev | Line | |
---|
[56] | 1 | <?php |
---|
| 2 | require 'classes/master.php'; //should be at top of every page |
---|
[102] | 3 | |
---|
| 4 | //$_SESSION['username'] = 'hai'; //temp, until bug is fixed |
---|
[47] | 5 | |
---|
[56] | 6 | if (isset($_POST['login'])) { |
---|
| 7 | if ($_POST['username'] == '') |
---|
| 8 | die("Please log in!"); |
---|
| 9 | else { |
---|
| 10 | $userDBI = new UserDatabaseInterface(); |
---|
| 11 | $user_exists = $userDBI->checkUserName($_POST['username']); |
---|
| 12 | if ($user_exists) { |
---|
| 13 | $correct_password = $userDBI->checkUserPassword($_POST); |
---|
[58] | 14 | /* session remembers login */ |
---|
[56] | 15 | if (!$correct_password) |
---|
| 16 | die("The password you entered is not correct!"); |
---|
[58] | 17 | else |
---|
| 18 | $_SESSION['username'] = $_POST['username']; |
---|
[56] | 19 | } |
---|
| 20 | else |
---|
| 21 | die("Unknown user name"); |
---|
| 22 | } |
---|
[47] | 23 | } |
---|
[58] | 24 | else if (is_null($_SESSION['username'])) |
---|
| 25 | redirect('index.php'); |
---|
[47] | 26 | |
---|
[64] | 27 | $surveys = Loader::loadSurveys(); |
---|
[78] | 28 | $applications = Loader::loadApplications(); |
---|
[47] | 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> |
---|
[59] | 36 | <?php new StyleSheet(); ?> |
---|
[47] | 37 | <script type="text/javascript" src="js/menu.js"></script> |
---|
| 38 | </head> |
---|
| 39 | <body> |
---|
| 40 | <div id="header"> |
---|
[56] | 41 | <?php new Logo(); ?> |
---|
| 42 | </div> |
---|
| 43 | |
---|
[47] | 44 | <div id="wrapper"> |
---|
[56] | 45 | |
---|
[47] | 46 | <div id="content"> |
---|
[58] | 47 | |
---|
| 48 | <?php new SessionMenu(); ?> |
---|
| 49 | |
---|
[78] | 50 | <?php new ApplicationMenu($applications); ?> |
---|
[58] | 51 | |
---|
| 52 | <?php new SurveyMenu($surveys); ?> |
---|
[99] | 53 | |
---|
| 54 | <?php new QuestionMenu(); ?> |
---|
[58] | 55 | |
---|
[47] | 56 | </div> |
---|
| 57 | </div> |
---|
| 58 | </body> |
---|
| 59 | </html> |
---|
Note: See
TracBrowser
for help on using the repository browser.