mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
fixed tabs, fixed potential notices for undefined variables, added structure that will be used for detecting what variables to flag during installs & upgrades, removed all $_GET usage, switched 'admin' to $CFG->admin (for directory paths), and fixed blank line at end of index.php
This commit is contained in:
parent
d37bac7e5d
commit
6fcbab99ef
4 changed files with 807 additions and 793 deletions
|
@ -2,8 +2,8 @@
|
|||
|
||||
require_once('../config.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/adminlib.php');
|
||||
require_once($CFG->libdir . '/blocklib.php'); //d
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/pagelib.php'); //d
|
||||
require_once($CFG->libdir . '/blocklib.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/pagelib.php');
|
||||
|
||||
if ($site = get_site()) {
|
||||
require_login();
|
||||
|
@ -20,7 +20,9 @@ page_map_class($pagetype, $pageclass);
|
|||
|
||||
$PAGE = page_create_object($pagetype,TEMPORARY_ADMIN_PAGE_ID);
|
||||
|
||||
$PAGE->init_full();
|
||||
$section = optional_param('section', '', PARAM_ALPHAEXT);
|
||||
|
||||
$PAGE->init_full($section);
|
||||
|
||||
$adminediting = optional_param('adminedit', -1, PARAM_BOOL);
|
||||
|
||||
|
@ -42,12 +44,12 @@ $root = $ADMIN->locate($PAGE->section);
|
|||
|
||||
if (!is_a($root, 'admin_settingpage')) {
|
||||
error(get_string('sectionerror', 'admin'));
|
||||
die;
|
||||
die;
|
||||
}
|
||||
|
||||
if (!($root->check_access())) {
|
||||
error(get_string('accessdenied', 'admin'));
|
||||
die;
|
||||
die;
|
||||
}
|
||||
|
||||
// WRITING SUBMITTED DATA (IF ANY) -------------------------------------------------------------------------------
|
||||
|
@ -56,14 +58,14 @@ if ($data = data_submitted()) {
|
|||
if (confirm_sesskey()) {
|
||||
$errors = $root->write_settings((array)$data);
|
||||
if (empty($errors)) {
|
||||
redirect("$CFG->wwwroot/admin/settings.php?section=" . $PAGE->section, get_string('changessaved'),1);
|
||||
} else {
|
||||
error(get_string('errorwithsettings', 'admin') . ' <br />' . $errors);
|
||||
}
|
||||
} else {
|
||||
error(get_string('confirmsesskeybad', 'error'));
|
||||
die;
|
||||
}
|
||||
redirect("$CFG->wwwroot/admin/settings.php?section=" . $PAGE->section, get_string('changessaved'),1);
|
||||
} else {
|
||||
error(get_string('errorwithsettings', 'admin') . ' <br />' . $errors);
|
||||
}
|
||||
} else {
|
||||
error(get_string('confirmsesskeybad', 'error'));
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue