Permalink
Browse files

Added code to allow the remote package update with a php later versio…

…n than 4.2
  • Loading branch information...
1 parent bb006c9 commit 8aee93f134ca3f57237428ab6975ebdc6843cb60 csantossaenz committed Jan 18, 2007
Showing with 18 additions and 3 deletions.
  1. +18 −3 mod/scorm/locallib.php
View
@@ -50,6 +50,10 @@
set_config('scorm_framewidth','100%');
}
+if (!isset($CFG->scorm_updatetime)) {
+ set_config('scorm_updatetime','2');
+}
+
if (!isset($CFG->scorm_advancedsettings)) {
set_config('scorm_advancedsettings','0');
}
@@ -687,15 +691,26 @@ function scorm_validate($data) {
//
// SCORM Update
//
+ //if (($validation->launch != -1) && is_file($reference)) {
if (($validation->launch != -1) && (is_file($reference) || (substr($reference,0,7) == 'http://'))){
- $fp = fopen($reference,"r");
+
if (substr($reference,0,7) != 'http://') {
+ $fp = fopen($reference,"r");
$fstat = fstat($fp);
+ fclose($fp);
+
}
else if(substr($reference,0,7) == 'http://'){
- $mdcheck=md5_file($reference);
+ if ($scormdir = make_upload_directory("$courseid/$CFG->moddata/scorm")) {
+ if ($tempdir = scorm_datadir($scormdir)) {
+ copy ("$reference", $tempdir."/".basename($reference));
+ $mdcheck=md5_file($tempdir."/".basename($reference));
+ unlink ($tempdir."/".basename($reference));
+ rmdir($tempdir);
+ }
+ }
}
- fclose($fp);
+
if ($scorm = get_record("scorm","id",$scormid)) {
if ($scorm->reference[0] == '#') {
require_once($repositoryconfigfile);

0 comments on commit 8aee93f

Please sign in to comment.