mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
webservice MDL-20803 little hack in order to not trigger environment.php in the header when $USER is set but the user is not logged
This commit is contained in:
parent
d4c6ef705c
commit
b5e4c8d4c1
1 changed files with 8 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue