Beispiel #1
0
//============================================================================================
// Session, config
//============================================================================================
require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('student', true);
if (!isset($SESSION->logged_in)) {
    header('location: index.php?next=' . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']);
    die;
}
//============================================================================================
// Load the Model and L10N
//============================================================================================
$model = new ActivityLog($dbo);
$dashboard = new Dashboard($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 = "alog";
if (!isset($_GET['page'])) {
    $count_pending_follow_ups = $dashboard->fetchCountPendingFollowUps($SESSION->student_num);
    $all_student_activity = $model->listAllStudentActivity($SESSION->student_num);
    $l10n->addResource(__DIR__ . '/l10n/header.json');
    $l10n->addResource(__DIR__ . '/l10n/activity-log.json');
    require_once FS_PHP . '/header-external.php';
    require_once 'views/activity-log.php';
Beispiel #2
0
<?php

require '../includes/php/bootstrap.php';
$SESSION = new \Zend_Session_Namespace('survey', true);
if (empty($_GET['lang'])) {
    // No language sent, check session
    if (empty($SESSION->corr_lang)) {
        $SESSION->corr_lang = DEFAULT_LANGUAGE;
    }
} else {
    if (\Ventus\Utilities\I18n\Translate::isAllowedLanguage($_GET['lang'])) {
        // acceptable language18
        $SESSION->corr_lang = $_GET['lang'];
    } else {
        // unacceptable language
        $SESSION->corr_lang = DEFAULT_LANGUAGE;
    }
}
$uri = empty($_GET['uri']) ? "https://" . URL_SURVEY . "/" : $_GET['uri'];
//Check if URL is safe to redirect to
if (preg_match('#^((https?:)?//' . URL_VENTUS . '/|/(?!/))#', urldecode($uri))) {
    // URL is valid
    header("Location: {$uri}");
} else {
    // Someone is taking advantage of a safe-looking URL
    // Only use the HTTP referer header if it is a Ventus site
    header("Location: " . $_SERVER['HTTP_REFERER']);
}
exit;