From 1c47adc54083c3a1b32247ca4bf50aa1e1d655f7 Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 6 Mar 2006 10:02:59 +0000 Subject: [PATCH] parameter cleaup - round 1 --- admin/admin.php | 6 +----- admin/auth.php | 12 +++++------- admin/block.php | 2 +- admin/blocks.php | 2 +- admin/config.php | 7 +++---- admin/configvars.php | 1 + admin/creators.html | 2 +- admin/creators.php | 7 ++----- admin/dbperformance.php | 8 ++++---- admin/delete.php | 4 ++-- admin/editor.php | 16 +++++++++------- admin/enrol.php | 5 +++-- admin/environment.php | 5 ++--- admin/filter.php | 14 ++++++++------ 14 files changed, 43 insertions(+), 48 deletions(-) diff --git a/admin/admin.php b/admin/admin.php index 62da7ccc295..8744c0a6dda 100644 --- a/admin/admin.php +++ b/admin/admin.php @@ -1,14 +1,10 @@ wwwroot/$CFG->admin/index.php"); } diff --git a/admin/auth.php b/admin/auth.php index cec3f69d6f3..7738bc39b4b 100644 --- a/admin/auth.php +++ b/admin/auth.php @@ -1,9 +1,9 @@ libdir.'/blocklib.php'); require_once($CFG->libdir.'/tablelib.php'); - $confirm = optional_param('confirm', 0, PARAM_INT); + $confirm = optional_param('confirm', 0, PARAM_BOOL); $hide = optional_param('hide', 0, PARAM_INT); $show = optional_param('show', 0, PARAM_INT); $delete = optional_param('delete', 0, PARAM_INT); diff --git a/admin/config.php b/admin/config.php index b2594580fb3..29dba824c44 100644 --- a/admin/config.php +++ b/admin/config.php @@ -3,6 +3,8 @@ require_once('../config.php'); + $focus = ''; + if ($site = get_site()) { // If false then this is a new installation require_login(); if (!isadmin()) { @@ -76,9 +78,6 @@ $config->locale = $CFG->lang; } } - if (empty($focus)) { - $focus = ''; - } $sesskey = !empty($USER->id) ? $USER->sesskey : ''; @@ -102,7 +101,7 @@ /// Get all the configuration fields and helptext - include('configvars.php'); + require('configvars.php'); /// Cycle through the sections to get the sectionnames $linktext = ''; diff --git a/admin/configvars.php b/admin/configvars.php index cb99f3d7e6f..97ecd0568cc 100644 --- a/admin/configvars.php +++ b/admin/configvars.php @@ -1,5 +1,6 @@ function - wwwroot/$CFG->admin/index.php"); } @@ -50,6 +46,7 @@ if (!$frm = data_submitted()) { print_simple_box("
".get_string("adminhelpassigncreators")."
", "center", "50%"); + $frm = new object(); /// A form was submitted so process the input diff --git a/admin/dbperformance.php b/admin/dbperformance.php index f378c5457d3..abe311bbedb 100644 --- a/admin/dbperformance.php +++ b/admin/dbperformance.php @@ -1,11 +1,11 @@ enrol, PARAM_ALPHA); + $enrol = optional_param('enrol', $CFG->enrol, PARAM_SAFEDIR); require_login(); @@ -43,6 +43,7 @@ $modules = get_list_of_plugins("enrol"); + $options = array(); foreach ($modules as $module) { $options[$module] = get_string("enrolname", "enrol_$module"); } diff --git a/admin/environment.php b/admin/environment.php index 1686e1670ad..29ab5ac07fc 100644 --- a/admin/environment.php +++ b/admin/environment.php @@ -35,9 +35,8 @@ /// Parameters - $action = optional_param('action', '', PARAM_ALPHA); - $sesskey = optional_param('sesskey'); - $version = optional_param('version'); + $action = optional_param('action', '', PARAM_ACTION); + $version = optional_param('version', '', PARAM_FILE); // /// Security checks require_login(); diff --git a/admin/filter.php b/admin/filter.php index 47016ed5fc3..51c77e05003 100644 --- a/admin/filter.php +++ b/admin/filter.php @@ -2,8 +2,8 @@ // filter.php // Edit text filter settings - require_once "../config.php"; - require_once "$CFG->libdir/tablelib.php"; + require_once '../config.php'; + require_once $CFG->libdir.'/tablelib.php'; // check for allowed access require_login(); @@ -16,10 +16,12 @@ // get parameters $param = new Object; - $param->filter = required_param( 'filter' ); - $param->submit = optional_param( 'submit','',PARAM_ALPHA ); - $param->reset = optional_param( 'reset','',PARAM_ALPHA ); - $filtername = substr( $param->filter, strpos( $param->filter, '/' )+1 ) ; + + $param->filter = required_param('filter', PARAM_PATH); + $param->submit = optional_param('submit', 0, PARAM_BOOL); + $param->reset = optional_param('reset', 0, PARAM_BOOL); + + $filtername = substr($param->filter, strpos( $param->filter, '/' )+1 ) ; // get translated strings for use on page $txt = new Object;