Merge branch 'w38_MDL-29401_m22_frankenstyle' of git://github.com/skodak/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2011-09-27 00:00:20 +02:00
commit e135797586
50 changed files with 267 additions and 142 deletions

View file

@ -19,7 +19,7 @@ $returnurl = new moodle_url('/admin/settings.php', array('section'=>'manageauths
$PAGE->set_url($returnurl);
$action = optional_param('action', '', PARAM_ACTION);
$auth = optional_param('auth', '', PARAM_SAFEDIR);
$auth = optional_param('auth', '', PARAM_PLUGIN);
get_enabled_auth_plugins(true); // fix the list of enabled auths
if (empty($CFG->auth)) {

View file

@ -6,7 +6,7 @@
require_once '../config.php';
require_once $CFG->libdir.'/adminlib.php';
$auth = required_param('auth', PARAM_SAFEDIR);
$auth = required_param('auth', PARAM_PLUGIN);
$PAGE->set_pagetype('admin-auth-' . $auth);
admin_externalpage_setup('authsetting'.$auth);

View file

@ -14,7 +14,7 @@ require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$returnurl = "$CFG->wwwroot/$CFG->admin/settings.php?section=manageeditors";
$action = optional_param('action', '', PARAM_ACTION);
$editor = optional_param('editor', '', PARAM_SAFEDIR);
$editor = optional_param('editor', '', PARAM_PLUGIN);
// get currently installed and enabled auth plugins
$available_editors = editors_get_available();

View file

@ -27,7 +27,7 @@ require_once('../config.php');
require_once($CFG->libdir.'/adminlib.php');
$action = required_param('action', PARAM_ACTION);
$enrol = required_param('enrol', PARAM_SAFEDIR);
$enrol = required_param('enrol', PARAM_PLUGIN);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$PAGE->set_url('/admin/enrol.php');

View file

@ -33,7 +33,7 @@ require_once($CFG->libdir.'/tablelib.php');
admin_externalpage_setup('managelocalplugins');
$delete = optional_param('delete', '', PARAM_SAFEDIR);
$delete = optional_param('delete', '', PARAM_PLUGIN);
$confirm = optional_param('confirm', '', PARAM_BOOL);
/// If data submitted, then process and store.

View file

@ -11,9 +11,9 @@
admin_externalpage_setup('managemodules');
$show = optional_param('show', '', PARAM_SAFEDIR);
$hide = optional_param('hide', '', PARAM_SAFEDIR);
$delete = optional_param('delete', '', PARAM_SAFEDIR);
$show = optional_param('show', '', PARAM_PLUGIN);
$hide = optional_param('hide', '', PARAM_PLUGIN);
$delete = optional_param('delete', '', PARAM_PLUGIN);
$confirm = optional_param('confirm', '', PARAM_BOOL);

View file

@ -85,7 +85,7 @@ if (!empty($config->disabledbehaviours)) {
// Process actions ============================================================
// Disable.
if (($disable = optional_param('disable', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (($disable = optional_param('disable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($behaviours[$disable])) {
print_error('unknownbehaviour', 'question', $thispageurl, $disable);
}
@ -98,7 +98,7 @@ if (($disable = optional_param('disable', '', PARAM_SAFEDIR)) && confirm_sesskey
}
// Enable.
if (($enable = optional_param('enable', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (($enable = optional_param('enable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($behaviours[$enable])) {
print_error('unknownbehaviour', 'question', $thispageurl, $enable);
}
@ -115,7 +115,7 @@ if (($enable = optional_param('enable', '', PARAM_SAFEDIR)) && confirm_sesskey()
}
// Move up in order.
if (($up = optional_param('up', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (($up = optional_param('up', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($behaviours[$up])) {
print_error('unknownbehaviour', 'question', $thispageurl, $up);
}
@ -127,7 +127,7 @@ if (($up = optional_param('up', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
}
// Move down in order.
if (($down = optional_param('down', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (($down = optional_param('down', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($behaviours[$down])) {
print_error('unknownbehaviour', 'question', $thispageurl, $down);
}
@ -139,7 +139,7 @@ if (($down = optional_param('down', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
}
// Delete.
if (($delete = optional_param('delete', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (($delete = optional_param('delete', '', PARAM_PLUGIN)) && confirm_sesskey()) {
// Check it is OK to delete this question type.
if ($delete == 'missing') {
print_error('cannotdeletemissingbehaviour', 'question', $thispageurl);

View file

@ -79,7 +79,7 @@ $sortedqtypes = question_bank::sort_qtype_array($sortedqtypes, $config);
// Process actions ============================================================
// Disable.
if (($disable = optional_param('disable', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (($disable = optional_param('disable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($qtypes[$disable])) {
print_error('unknownquestiontype', 'question', $thispageurl, $disable);
}
@ -89,7 +89,7 @@ if (($disable = optional_param('disable', '', PARAM_SAFEDIR)) && confirm_sesskey
}
// Enable.
if (($enable = optional_param('enable', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (($enable = optional_param('enable', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($qtypes[$enable])) {
print_error('unknownquestiontype', 'question', $thispageurl, $enable);
}
@ -103,7 +103,7 @@ if (($enable = optional_param('enable', '', PARAM_SAFEDIR)) && confirm_sesskey()
}
// Move up in order.
if (($up = optional_param('up', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (($up = optional_param('up', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($qtypes[$up])) {
print_error('unknownquestiontype', 'question', $thispageurl, $up);
}
@ -114,7 +114,7 @@ if (($up = optional_param('up', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
}
// Move down in order.
if (($down = optional_param('down', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (($down = optional_param('down', '', PARAM_PLUGIN)) && confirm_sesskey()) {
if (!isset($qtypes[$down])) {
print_error('unknownquestiontype', 'question', $thispageurl, $down);
}
@ -125,7 +125,7 @@ if (($down = optional_param('down', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
}
// Delete.
if (($delete = optional_param('delete', '', PARAM_SAFEDIR)) && confirm_sesskey()) {
if (($delete = optional_param('delete', '', PARAM_PLUGIN)) && confirm_sesskey()) {
// Check it is OK to delete this question type.
if ($delete == 'missingtype') {
print_error('cannotdeletemissingqtype', 'question', $thispageurl);

View file

@ -262,7 +262,7 @@ class report_customlang_utils {
debugging('Unable to dump local strings for non-installed language pack .'.s($lang));
return false;
}
if ($component !== clean_param($component, PARAM_SAFEDIR)) {
if ($component !== clean_param($component, PARAM_COMPONENT)) {
throw new coding_exception('Incorrect component name');
}
if (!$filename = self::get_component_filename($component)) {

View file

@ -12,7 +12,7 @@ require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->libdir.'/questionlib.php');
// Get URL parameters.
$requestedqtype = optional_param('qtype', '', PARAM_SAFEDIR);
$requestedqtype = optional_param('qtype', '', PARAM_PLUGIN);
// Print the header & check permissions.
admin_externalpage_setup('reportquestioninstances');

View file

@ -10,7 +10,7 @@ $new = optional_param('new', '', PARAM_FORMAT);
$hide = optional_param('hide', 0, PARAM_INT);
$delete = optional_param('delete', 0, PARAM_INT);
$sure = optional_param('sure', '', PARAM_ALPHA);
$type = optional_param('type', '', PARAM_ALPHAEXT);
$type = optional_param('type', '', PARAM_PLUGIN);
$context = get_context_instance(CONTEXT_SYSTEM);

View file

@ -42,7 +42,7 @@
define('SEVERITY_SIGNIFICANT', 'significant');
define('SEVERITY_CRITICAL', 'critical');
$solution = optional_param('solution', 0, PARAM_SAFEDIR); //in fact it is class name alhanumeric and _
$solution = optional_param('solution', 0, PARAM_PLUGIN);
require_login();
require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));