]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13766 Tidying
authormoodler <moodler>
Mon, 15 Sep 2008 06:58:26 +0000 (06:58 +0000)
committermoodler <moodler>
Mon, 15 Sep 2008 06:58:26 +0000 (06:58 +0000)
repository/ws.php

index 189130bcc7fd8a742f3a054fbd2e2ec3ad104558..939ef4a19c64cf562b53942ee9ed960b09a2ad51 100644 (file)
@@ -2,9 +2,7 @@
 
 /// The Web service script that is called from the filepicker front end
 
-    set_time_limit(0);
-    header("Cache-Control: no-cache, must-revalidate");
-    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
+
     require_once('../config.php');
     require_once('../lib/filelib.php');
     require_once('lib.php');
@@ -19,6 +17,9 @@
     $repo_id = optional_param('repo_id', 1, PARAM_INT);       // repository ID
     $callback = optional_param('callback', '', PARAM_CLEANHTML);
 
+/// Headers to make it not cacheable
+    header("Cache-Control: no-cache, must-revalidate");
+    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
 
 /// Check permissions
     if (! (isloggedin() && repository_check_context($ctx_id)) ) {
@@ -27,6 +28,9 @@
         die(json_encode($err));
     }
 
+/// Wait as long as it takes for this script to finish
+    set_time_limit(0);
+
 /// Check for actions that do not need repository ID
     switch ($action) {