]> git.mjollnir.org Git - moodle.git/commitdiff
admin/block.php is now using sesskey.
authorstronk7 <stronk7>
Sat, 2 Oct 2004 23:15:51 +0000 (23:15 +0000)
committerstronk7 <stronk7>
Sat, 2 Oct 2004 23:15:51 +0000 (23:15 +0000)
And bug where one object was used like an array.

Merged from MOODLE_14_STABLE

admin/block.php
admin/blocks.php

index a3387c39c9fbb5d5eee8a216c62799f63913ffea..d6eb8da1a61873961e31fb51f154dbcba379b553 100644 (file)
         error("Site isn't defined!");
     }
 
+    if (!confirm_sesskey()) {
+        error(get_string('confirmsesskeybad', 'error'));
+    }
+
     require_variable($_REQUEST['block']);
     $blockid = intval($_REQUEST['block']);
 
 
 /// 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.
 
index 359f130baf22dc1934f9a2487407aa663239bf3b..2978797b32cc565de57c8eefacc267021785665b 100644 (file)
 
         $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);