Last change
on this file since 102 was
102,
checked in by fpvanagthoven, 14 years ago
|
Begin on questioncreation.php
|
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(); |
---|
[75] | 29 | |
---|
[47] | 30 | ?> |
---|
| 31 | |
---|
| 32 | <!DOCTYPE html> |
---|
| 33 | <html> |
---|
| 34 | <head> |
---|
| 35 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
---|
| 36 | <title>Facilitator</title> |
---|
[59] | 37 | <?php new StyleSheet(); ?> |
---|
[47] | 38 | <script type="text/javascript" src="js/menu.js"></script> |
---|
| 39 | </head> |
---|
| 40 | <body> |
---|
| 41 | <div id="header"> |
---|
[56] | 42 | <?php new Logo(); ?> |
---|
| 43 | </div> |
---|
| 44 | |
---|
[47] | 45 | <div id="wrapper"> |
---|
[56] | 46 | |
---|
[47] | 47 | <div id="content"> |
---|
[58] | 48 | |
---|
| 49 | <?php new SessionMenu(); ?> |
---|
| 50 | |
---|
[78] | 51 | <?php new ApplicationMenu($applications); ?> |
---|
[58] | 52 | |
---|
| 53 | <?php new SurveyMenu($surveys); ?> |
---|
[99] | 54 | |
---|
| 55 | <?php new QuestionMenu(); ?> |
---|
[58] | 56 | |
---|
[47] | 57 | </div> |
---|
| 58 | </div> |
---|
| 59 | </body> |
---|
| 60 | </html> |
---|
Note: See
TracBrowser
for help on using the repository browser.