Skip to content

Commit 4c69b29

Browse files
committed
Security: Add configuration setting 'webservice_remote_ppt2png_enable' to disable additional_webservices.php by default
1 parent 37be9ce commit 4c69b29

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

main/admin/configure_extensions.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,11 @@ function afficheContent(event){
159159
<form method="POST" class="form-horizontal" action="<?php echo api_get_self(); ?>">
160160
<?php
161161
$form = new FormValidator('ppt2lp');
162-
$form->addElement('text', 'host', get_lang('Host'));
162+
if (api_get_configuration_value('webservice_remote_ppt2png_enable') == true) {
163+
$form->addElement('text', 'host', get_lang('Host'));
164+
} else {
165+
$form->addElement('text', 'host', [get_lang('Host'),'Remote host disabled - set webservice_remote_ppt2png_enable setting to true in configuration.php to enable']);
166+
}
163167
//$form -> addElement('html','<br /><br />');
164168
$form->addElement('text', 'port', get_lang('Port'));
165169
//$form -> addElement('html','<br /><br />');

main/install/configuration.dist.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,3 +2479,6 @@
24792479

24802480
// Enable use of a custom course logo in mail & PDF headers
24812481
// $_configuration['mail_header_from_custom_course_logo'] = false;
2482+
2483+
// Enable additional_webservices.php for *remote* PPT2PNG/Oogie service
2484+
//$_configuration['webservice_remote_ppt2png_enable'] = false;

main/webservices/additional_webservices.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
*/
88
require_once __DIR__.'/../inc/global.inc.php';
99

10+
$enableThis = api_get_configuration_value('webservice_remote_ppt2png_enable');
11+
if (!$enableThis) {
12+
echo "Remote PPT2PNG service is disabled. \n";
13+
echo "To enable, add \$_configuration['webservice_remote_ppt2png_enable'] = true; to your configuration.php";
14+
exit;
15+
}
1016
api_protect_webservices();
1117

1218
/**

0 commit comments

Comments
 (0)