Fix Fails when stundent try to download a wiki page as pdf - Refs #8006

1.10.x
José Loguercio 9 years ago
parent f13a1293dc
commit 881ed0eb1a
  1. 5
      main/wiki/index.php
  2. 11
      main/wiki/wiki.inc.php

@ -101,7 +101,10 @@ $wiki->blockConcurrentEditions(api_get_user_id(), $action);
/* MAIN WIKI AREA */
ob_start();
$wiki->handleAction($action);
$handleAction = $wiki->handleAction($action);
if (!$handleAction && $action == 'export_to_pdf') {
$wiki->handleAction('showpage');
}
$content = ob_get_contents();
ob_end_clean();

@ -2013,7 +2013,14 @@ class Wiki
public function export_to_pdf($id, $course_code)
{
if (!api_is_platform_admin()) {
if (api_get_setting('students_export2pdf') == 'true') {
if (api_get_setting('students_export2pdf') !== 'true') {
self::setMessage(
Display::display_error_message(
get_lang('StudentsDownloadPDFDoesntAllowed'),
false,
true
)
);
return false;
}
}
@ -5362,7 +5369,7 @@ class Wiki
case 'export_to_pdf':
if (isset($_GET['wiki_id'])) {
self::export_to_pdf($_GET['wiki_id'], api_get_course_id());
exit;
break;
}
break;
case 'export2doc':

Loading…
Cancel
Save