if ($_GET['page'] === "faq") { //The user has clicked on the faq link $all_faq = $model->fetchfaq(); $l10n->addResource(__DIR__ . '/l10n/faq.json'); $l10n->localizeArray($all_faq, 'question'); $l10n->localizeArray($all_faq, 'answer'); require_once FS_PHP . '/header-external.php'; require_once 'views/faq.php'; require_once FS_PHP . '/footer-external.php'; } else { if ($_GET['page'] === "reset-user-password") { //Handle the logic for checking if the user is eligible to reset their password if ($model->checkIfStudentExists($_POST['student_num'], $_POST['email'])) { if ($model->checkIfStudentExistsInVentus($_POST['student_num'])) { if ($_POST['password'] === $_POST['password_confirm']) { $model->resetStudentPassword($_POST); $activation_status = "waiting"; $loggers['audit']->info("Password reset for {$_POST['student_num']}"); $l10n->addResource(__DIR__ . '/l10n/forgot-password-result.json'); require_once FS_PHP . '/header-external.php'; require_once 'views/forgot-password-result.php'; require_once FS_PHP . '/footer-external.php'; } else { $loggers['audit']->notice("Attempted password reset for student {$_POST['student_num']} with mismatched passwords"); if (ctype_digit($_POST['student_num'])) { header('location:index.php?page=forgot-password&mode=password_mismatch&email=' . $_POST['email'] . '&student_num=' . $_POST['student_num']); } else { header('Location: index.php'); } die; }