checkUserName($_POST['username']); if ($user_exists) { $correct_password = $userDBI->checkUserPassword($_POST); /* session remembers login */ if (!$correct_password) die("The password you entered is not correct!"); else $_SESSION['username'] = $_POST['username']; } else die("Unknown user name"); } } else if (is_null($_SESSION['username'])) redirect('index.php'); $surveys = array(); $surveyDBI = new SurveyDatabaseInterface(null); $surveyIDTitles = $surveyDBI->getExistingSurveys(); foreach ($surveyIDTitles as $id => $title) { $survey = new Survey($id, $title); array_push($surveys, $survey); } ?> Facilitator