From 4e27a2b92e6cea26a3e39ead53459ce42b102d11 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Sat, 22 Jan 2005 19:53:28 +0000 Subject: [PATCH] Changed some sesskey behaviours SC#73 (admin part) --- admin/block.php | 8 ++++---- admin/blocks.php | 2 +- admin/module.php | 10 +++++----- admin/modules.php | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/admin/block.php b/admin/block.php index def37dd39a..a87386efda 100644 --- a/admin/block.php +++ b/admin/block.php @@ -14,10 +14,6 @@ error("Site isn't defined!"); } - if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); - } - require_variable($_REQUEST['block']); $blockid = intval($_REQUEST['block']); @@ -40,6 +36,10 @@ /// If data submitted, then process and store. if ($config = data_submitted()) { + + if (!confirm_sesskey()) { + error(get_string('confirmsesskeybad', 'error')); + } if(!$block->has_config()) { error('This block does not support global configuration'); } diff --git a/admin/blocks.php b/admin/blocks.php index 28da489849..980b9c3e15 100644 --- a/admin/blocks.php +++ b/admin/blocks.php @@ -166,7 +166,7 @@ $settings = ''; // By default, no configuration if($blockobject->has_config()) { - $settings = ''.$strsettings.''; + $settings = ''.$strsettings.''; } $count = count_records('block_instance', 'blockid', $blockid); diff --git a/admin/module.php b/admin/module.php index 1ab26d4e91..71c052b29a 100644 --- a/admin/module.php +++ b/admin/module.php @@ -13,13 +13,13 @@ error("Site isn't defined!"); } - if (!confirm_sesskey()) { - error(get_string('confirmsesskeybad', 'error')); - } - /// If data submitted, then process and store. - if ($config = data_submitted()) { + if ($config = data_submitted()) { + + if (!confirm_sesskey()) { + error(get_string('confirmsesskeybad', 'error')); + } print_header(); foreach ($config as $name => $value) { set_config($name, $value); diff --git a/admin/modules.php b/admin/modules.php index 18bfdf0286..094629f785 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -165,7 +165,7 @@ $delete = "name&sesskey=$USER->sesskey\">$strdelete"; if (file_exists("$CFG->dirroot/mod/$module->name/config.html")) { - $settings = "name&sesskey=$USER->sesskey\">$strsettings"; + $settings = "name\">$strsettings"; } else { $settings = ""; } -- 2.39.5