forked from drlippman/IMathAS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathltisessionsetup.php
33 lines (33 loc) · 897 Bytes
/
ltisessionsetup.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
<?php
require_once(__DIR__ . "/init_without_validate.php");
header('P3P: CP="ALL CUR ADM OUR"');
ini_set('session.gc_maxlifetime',86400);
if ($_SERVER['HTTP_HOST'] != 'localhost') {
session_set_cookie_params(0, '/', '.'.implode('.',array_slice(explode('.',Sanitize::domainNameWithPort($_SERVER['HTTP_HOST'])),isset($CFG['GEN']['domainlevel'])?$CFG['GEN']['domainlevel']:-2)));
}
session_start();
$redir = Sanitize::url($_GET['redirect_url']);
?>
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function redirect() {
window.location = "<?php echo $redir; ?>";
}
</script>
</head>
<?php
if (empty($redir)) {
echo '<body>Session established. Go back to your LMS and try again.</body>';
} else {
?>
<body onload="redirect()">
Redirecting you back to your LMS...<br/>
If you aren't redirected in 5 seconds,
<a href="<?php echo $redir; ?>">click here</a>.
</body>
<?php
}
?>
</html>