示例#1
0
文件: index.php 项目: hughnguy/php
     if (isset($_GET['next'])) {
         // Specific URL requested
         if (preg_match('#^((https?:)?//' . URL_VENTUS . '/|/(?!/))#', urldecode($_GET['next']))) {
             // URL is valid
             header('location:' . $_GET['next']);
         } else {
             // Someone is taking advantage of a safe-looking URL
             header('location: index.php');
         }
         exit;
     }
     header('location:dashboard.php');
     exit;
 } else {
     //Check if the student has completed the intake form
     if (!$intake_form->checkIntakeFormCompletionStatus($SESSION->student_num)) {
         // Intake form not completed
         header('Location: intake-form.php');
         exit;
     }
     // Intake form completed
     //If this is the first time the user has logged in and somehow, has already completed the intake form
     if ($_GET['mode'] === "first-time") {
         // First login
         $loggers['audit']->info("Student logged in for the first time");
         header('location:profile.php?mode=first-time');
         exit;
     }
     $loggers['audit']->info("Student logged in");
     if (isset($_GET['next'])) {
         // Specific URL requested
示例#2
0
//============================================================================================
// Load the Model and L10N
//============================================================================================
$model = new IntakeForm($dbo);
if (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($SESSION->corr_lang)) {
    $l10n->setLanguage($SESSION->corr_lang);
    \Locale::setDefault($SESSION->corr_lang);
}
$l10n->addResource(FS_L10N . '/header-external.json');
//============================================================================================
// Load the page requested by the user
//============================================================================================
$this_page = "intake";
if (!isset($_GET['page'])) {
    $intake_form_details = $model->fetchIntakeForm($SESSION->student_num);
    $is_complete = $model->checkIntakeFormCompletionStatus($SESSION->student_num);
    $l10n->addResource(__DIR__ . '/l10n/header.json');
    $l10n->addResource(__DIR__ . '/l10n/intake-form.json');
    require_once FS_PHP . '/header-external.php';
    require_once 'views/intake-form.php';
    require_once FS_PHP . '/footer-external.php';
} elseif ($_GET['page'] === "add-update") {
    $model->addOrUpdateIntakeForm($SESSION->student_num, $_POST);
    $loggers['audit']->info("Intake form updated");
} elseif ($_GET['page'] === "mark-as-complete") {
    $model->addOrUpdateIntakeForm($SESSION->student_num, $_POST);
    $loggers['audit']->info("Intake form updated");
    $model->markAsComplete($SESSION->student_num);
    $loggers['audit']->info("Intake form completed");
} else {
    header('location: https://' . URL_PHP . '/error-external.php?eid=S099');