forked from tsugiproject/tsugi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lti.php
34 lines (28 loc) · 803 Bytes
/
lti.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
require_once 'config.php';
require_once 'pdo.php';
require_once 'lib/lms_lib.php';
use \Tsugi\Core\LTIX;
$session_id = LTIX::setupSession();
// See if we have a custom assignment setting.
if ( ! isset($_POST['custom_assn'] ) ) {
require("lti/noredir.php");
return;
} else {
$url = $_POST['custom_assn'];
$_SESSION['assn'] = $_POST['custom_assn'];
}
// Send us to where we are going next...
$query = false;
if ( isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0) {
$query = true;
$url .= '?' . $_SERVER['QUERY_STRING'];
}
$location = addSession($url);
session_write_close(); // To avoid any race conditions...
if ( headers_sent() ) {
echo('<p><a href="'.$url.'">Click to continue</a></p>');
} else {
header('Location: '.$location);
}
?>