Last change
on this file since 183 was
116,
checked in by fpvanagthoven, 14 years ago
|
Some refactoring and commenting, plus, the questions within the categories in QuestionCreationTool? are now sorted aswell; on code.
|
File size:
1.5 KB
|
Rev | Line | |
---|
[56] | 1 | <?php |
---|
| 2 | require 'classes/master.php'; //should be at top of every page |
---|
[102] | 3 | |
---|
[56] | 4 | if (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); |
---|
[58] | 12 | /* session remembers login */ |
---|
[56] | 13 | if (!$correct_password) |
---|
| 14 | die("The password you entered is not correct!"); |
---|
[58] | 15 | else |
---|
| 16 | $_SESSION['username'] = $_POST['username']; |
---|
[56] | 17 | } |
---|
| 18 | else |
---|
| 19 | die("Unknown user name"); |
---|
| 20 | } |
---|
[47] | 21 | } |
---|
[58] | 22 | else if (is_null($_SESSION['username'])) |
---|
| 23 | redirect('index.php'); |
---|
[47] | 24 | |
---|
[64] | 25 | $surveys = Loader::loadSurveys(); |
---|
[78] | 26 | $applications = Loader::loadApplications(); |
---|
[47] | 27 | ?> |
---|
| 28 | |
---|
| 29 | <!DOCTYPE html> |
---|
| 30 | <html> |
---|
| 31 | <head> |
---|
| 32 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
---|
| 33 | <title>Facilitator</title> |
---|
[59] | 34 | <?php new StyleSheet(); ?> |
---|
[47] | 35 | <script type="text/javascript" src="js/menu.js"></script> |
---|
| 36 | </head> |
---|
| 37 | <body> |
---|
| 38 | <div id="header"> |
---|
[56] | 39 | <?php new Logo(); ?> |
---|
| 40 | </div> |
---|
| 41 | |
---|
[47] | 42 | <div id="wrapper"> |
---|
[56] | 43 | |
---|
[47] | 44 | <div id="content"> |
---|
[58] | 45 | |
---|
| 46 | <?php new SessionMenu(); ?> |
---|
| 47 | |
---|
[78] | 48 | <?php new ApplicationMenu($applications); ?> |
---|
[58] | 49 | |
---|
| 50 | <?php new SurveyMenu($surveys); ?> |
---|
[99] | 51 | |
---|
| 52 | <?php new QuestionMenu(); ?> |
---|
[58] | 53 | |
---|
[47] | 54 | </div> |
---|
| 55 | </div> |
---|
| 56 | </body> |
---|
| 57 | </html> |
---|
Note: See
TracBrowser
for help on using the repository browser.