admin/block.php is now using sesskey.

And bug where one object was used like an array.

Merged from MOODLE_14_STABLE
This commit is contained in:
stronk7 2004-10-02 23:15:51 +00:00
parent 398ef378dc
commit c1b70c8edc
2 changed files with 9 additions and 5 deletions

View file

@ -14,6 +14,10 @@
error("Site isn't defined!");
}
if (!confirm_sesskey()) {
error(get_string('confirmsesskeybad', 'error'));
}
require_variable($_REQUEST['block']);
$blockid = intval($_REQUEST['block']);
@ -28,13 +32,13 @@
/// If data submitted, then process and store.
if ($config = data_submitted()) {
unset($config['block']); // This will always be set if we have reached this point
$block->handle_config($config);
if ($config = data_submitted()) {
unset($config->block); // This will always be set if we have reached this point
$block->handle_config($config);
print_header();
redirect("$CFG->wwwroot/$CFG->admin/blocks.php", get_string("changessaved"), 1);
exit;
}
}
/// Otherwise print the form.

View file

@ -152,7 +152,7 @@
$settings = ''; // By default, no configuration
if($blockobject->has_config()) {
$settings = '<a href="block.php?block='.$blockid.'">'.$strsettings.'</a>';
$settings = '<a href="block.php?block='.$blockid.'&sesskey='.$USER->sesskey.'">'.$strsettings.'</a>';
}
$count = blocks_get_courses_using_block_by_id($blockid);