-
Notifications
You must be signed in to change notification settings - Fork 0
/
lms.php
46 lines (40 loc) · 1.14 KB
/
lms.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
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/** lms.php
* This is the hostpage for the lms
* It currently works only with customised install of Moodle
*/
$host='lms.php';
$book='lms';
include ('scripts/head_options.php');
$ip=$_SERVER['REMOTE_ADDR'];
$salt=$CFG->lmsshare.$CFG->support;
$secret=md5($salt . $ip);
$token=md5($tid . $secret);
$entrypage='';
$user=get_user($tid);
$externalparams=array(
'lang' => current_language(),
'token' => $token,
'user' => $tid,
'passwd' => '',
);
/*construct the redirect string*/
$externalred=$CFG->lmssite . '/'.$entrypage;
while(list($param,$value)=each($externalparams)){
if(!isset($joiner)){$joiner='?';}
else{$joiner='&';}
$externalred=$externalred . $joiner . $param . '=' . $value;
}
?>
<div style="visibility:hidden;" id="hiddenbookoptions">
<fieldset class="lms">
<legend><?php print_string('options');?></legend>
</fieldset>
</div>
<div id="bookbox" class="lmscolor">
<iframe id="externalbook" name="externalbook" class="externalbookframe"></iframe>
</div>
<?php
include('scripts/end_options.php');
?>
<script>frames["externalbook"].location.href="<?php print $externalred;?>";</script>