Security: Add configuration setting 'webservice_remote_ppt2png_enable' to disable additional_webservices.php by default

pull/4819/head
Yannick Warnier 2 years ago
parent 37be9ce724
commit 4c69b294f9
  1. 6
      main/admin/configure_extensions.php
  2. 3
      main/install/configuration.dist.php
  3. 6
      main/webservices/additional_webservices.php

@ -159,7 +159,11 @@ Display::display_header($nameTool);
<form method="POST" class="form-horizontal" action="<?php echo api_get_self(); ?>">
<?php
$form = new FormValidator('ppt2lp');
$form->addElement('text', 'host', get_lang('Host'));
if (api_get_configuration_value('webservice_remote_ppt2png_enable') == true) {
$form->addElement('text', 'host', get_lang('Host'));
} else {
$form->addElement('text', 'host', [get_lang('Host'),'Remote host disabled - set webservice_remote_ppt2png_enable setting to true in configuration.php to enable']);
}
//$form -> addElement('html','<br /><br />');
$form->addElement('text', 'port', get_lang('Port'));
//$form -> addElement('html','<br /><br />');

@ -2479,3 +2479,6 @@ INSERT INTO extra_field_options (field_id, option_value, display_text, priority,
// Enable use of a custom course logo in mail & PDF headers
// $_configuration['mail_header_from_custom_course_logo'] = false;
// Enable additional_webservices.php for *remote* PPT2PNG/Oogie service
//$_configuration['webservice_remote_ppt2png_enable'] = false;

@ -7,6 +7,12 @@
*/
require_once __DIR__.'/../inc/global.inc.php';
$enableThis = api_get_configuration_value('webservice_remote_ppt2png_enable');
if (!$enableThis) {
echo "Remote PPT2PNG service is disabled. \n";
echo "To enable, add \$_configuration['webservice_remote_ppt2png_enable'] = true; to your configuration.php";
exit;
}
api_protect_webservices();
/**

Loading…
Cancel
Save