]> git.mjollnir.org Git - moodle.git/commitdiff
webservice MDL-20803 little hack in order to not trigger environment.php in the heade...
authorjerome mouneyrac <jerome@moodle.com>
Sun, 13 Dec 2009 14:06:09 +0000 (14:06 +0000)
committerjerome mouneyrac <jerome@moodle.com>
Sun, 13 Dec 2009 14:06:09 +0000 (14:06 +0000)
webservice/wsdoc.php

index 4e28bef300373e745e174cbf1a14677adf9eb0a8..519afa2391054c83aeabaf40fa7cf13c35c7a8e3 100644 (file)
@@ -226,15 +226,21 @@ class webservice_documentation_generator {
      * Generate and display the documentation
      */
     protected function display_documentation_html() {
-        global $PAGE, $OUTPUT, $SITE;
+        global $PAGE, $OUTPUT, $SITE, $USER;
 
         $PAGE->set_url('/webservice/wsdoc');
         $PAGE->set_docs_path('');
         $PAGE->set_title($SITE->fullname." ".get_string('wsdocumentation', 'webservice'));
         $PAGE->set_heading($SITE->fullname." ".get_string('wsdocumentation', 'webservice'));
         $PAGE->set_generaltype('popup');
-
+        //unlog temporarly the user in order to not trigger environment.php called by Moodle header.
+        //environment.php checkes the sessionkey that we don't have here.
+        //emvrionment.php is just used to detect the flash player. We don't need
+        //to check the flash player version.
+        $userid = $USER->id;
+        $USER->id = null;
         echo $OUTPUT->header();
+        $USER->id = $userid;
         $renderer = $PAGE->theme->get_renderer('core_wsdoc',$OUTPUT);
         echo $renderer->documentation_html($this->functions, $this->username);
         echo $OUTPUT->footer();