slashargument fix for healthcenter, better diagnostic messages; renamed file.php/pic.jpg option to file.php/1/pic.jpg because the course number is mandatory; merged from MOODLE_16_STABLE

This commit is contained in:
skodak
2006-06-30 13:46:25 +00:00
parent 629c25da67
commit 6544f8d896
5 changed files with 11 additions and 12 deletions
+2 -2
View File
@@ -157,8 +157,8 @@ class configvarrss extends configvar {
/// slasharguments
unset($options);
$options[0] = "file.php?file=/pic.jpg";
$options[1] = "file.php/pic.jpg";
$options[0] = "file.php?file=/1/pic.jpg";
$options[1] = "file.php/1/pic.jpg";
$operatingsystem['slasharguments'] = new configvar (get_string('configslasharguments', 'admin'),
choose_from_menu ($options, 'slasharguments', $config->slasharguments, '', '', '', true) );
+3 -4
View File
@@ -7,8 +7,7 @@
define('SEVERITY_SIGNIFICANT', 'significant');
define('SEVERITY_CRITICAL', 'critical');
$resetsesserrorcounter = optional_param('resetsesserrorcounter', 0, PARAM_BOOL);
$solution = optional_param('solution', 0, PARAM_SAFEDIR); //in fact it is class name alhanumeric and _
$solution = optional_param('solution', 0, PARAM_SAFEDIR); //in fact it is class name alhanumeric and _
require_login();
if (!isadmin()) {
@@ -423,7 +422,7 @@ class problem_000010 extends problem_base {
$desc .= '<li>slasharguments are enabled in Moodle configuration</li>';
}
if ($this->status() == -1) {
$desc .= '<li>can not run automatic test, you can verify it <a href="'.$CFG->wwwroot.'/file.php/testslasharguments" target="_blank">here</a></li>';
$desc .= '<li>can not run automatic test, you can verify it <a href="'.$CFG->wwwroot.'/file.php/testslasharguments" target="_blank">here</a> manually</li>';
} else if ($this->status() == 0) {
$desc .= '<li>slashargument test <strong>failed</strong>, please check server configuration</li>';
} else {
@@ -501,7 +500,7 @@ class problem_000011 extends problem_base {
}
function solution() {
global $CFG;
if (!empty($resetsesserrorcounter)) {
if (optional_param('resetsesserrorcounter', 0, PARAM_BOOL)) {
if (get_field('config', 'name', 'name', 'session_error_counter')) {
delete_records('config', 'name', 'session_error_counter');
}
+2 -2
View File
@@ -302,9 +302,9 @@ function slasharguments($texexp, $md5) {
$image = tex2image($texexp,$md5,true);
echo "<p>If the following image displays correctly, set your ";
echo "<a href=\"$admin\" target=\"_blank\">Administration->Configuration->Variables</a> ";
echo "setting for slasharguments to file.php/pic.jpg: ";
echo "setting for slasharguments to file.php/1/pic.jpg: ";
echo "<img src=\"pix.php/$image\" align=\"absmiddle\"></p>\n";
echo "<p>Otherwise set it to file.php?file=pic.jpg ";
echo "<p>Otherwise set it to file.php?file=/1/pic.jpg ";
echo "It should display correctly as ";
echo "<img src=\"pix.php?file=$image\" align=\"absmiddle\"></p>\n";
echo "<p>If neither equation image displays correctly, please seek ";
+2 -2
View File
@@ -178,9 +178,9 @@
$image = tex2image($texexp,true);
echo "<p>If the following image displays correctly, set your ";
echo "<a href=\"$admin\" target=\"_blank\">Administration->Configuration->Variables</a> ";
echo "setting for slasharguments to file.php/pic.jpg: ";
echo "setting for slasharguments to file.php/1/pic.jpg: ";
echo "<img src=\"pix.php/$image\" align=\"absmiddle\"></p>\n";
echo "<p>Otherwise set it to file.php?file=pic.jpg ";
echo "<p>Otherwise set it to file.php?file=/1/pic.jpg ";
echo "It should display correctly as ";
echo "<img src=\"pix.php?file=$image\" align=\"absmiddle\"></p>\n";
echo "<p>If neither equation image displays correctly, please seek ";
+2 -2
View File
@@ -1096,7 +1096,7 @@ function get_file_argument($scriptname) {
if (!strpos($path_info, $scriptname)) {
$relativepath = clean_param(rawurldecode($path_info), PARAM_PATH);
if ($relativepath === '/testslasharguments') {
echo 'test 1: Slasharguments test passed.'; //indicate ok for health center
echo 'test 1: Slasharguments test passed. Server confguration is compatible with file.php/1/pic.jpg slashargument setting.'; //indicate ok for health center
die;
}
}
@@ -1110,7 +1110,7 @@ function get_file_argument($scriptname) {
$path_info = strip_querystring($arr[1]);
$relativepath = clean_param(rawurldecode($path_info), PARAM_PATH);
if ($relativepath === '/testslasharguments') {
echo 'test 2:Slasharguments test passed (compatibility hack).'; //indicate ok for health center
echo 'test 2:Slasharguments test passed (compatibility hack). Server confguration may be compatible with file.php/1/pic.jpg slashargument setting'; //indicate ok for health center
die;
}
}