From: stronk7 Date: Sat, 9 Oct 2004 18:33:44 +0000 (+0000) Subject: course/scales.php is using sesskey. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=92604dbcf8f0952ccad389da6ee862cb52ae17c1;p=moodle.git course/scales.php is using sesskey. Merged from MOODLE_14_STABLE --- diff --git a/course/scales.php b/course/scales.php index aee3abb27e..e4c2a90d2c 100644 --- a/course/scales.php +++ b/course/scales.php @@ -43,7 +43,7 @@ $errors = NULL; - if ($action == 'sendform') { + if ($action == 'sendform' and confirm_sesskey()) { if ($form = data_submitted()) { if (empty($form->name)) { $errors[$scaleid]->name = true; @@ -124,6 +124,9 @@ //If action is edit or new, show the form if ($action == "edit" || $action == "new") { + + $sesskey = !empty($USER->id) ? $USER->sesskey : ''; + //Check for teacher edit if (! isteacheredit($course->id)) { error("Only editing teachers can modify scales !"); @@ -216,6 +219,7 @@ echo ""; echo ""; echo "id\" />"; + echo ""; echo "courseid\" />"; echo "id\" />"; echo ""; @@ -230,7 +234,7 @@ } //If action is delete, do it - if ($action == "delete") { + if ($action == "delete" and confirm_sesskey()) { //Check for teacher edit if (! isteacheredit($course->id)) { error("Only editing teachers can delete scales !"); @@ -263,7 +267,7 @@ } //If action is down or up, do it - if ($action == "down" || $action == "up" ) { + if (($action == "down" || $action == "up") and confirm_sesskey()) { //Check for teacher edit if (! isadmin()) { error("Only administrators can move scales",$CFG->wwwroot.'/course/scales.php?id='.$course->id); @@ -449,14 +453,14 @@ $buttons .= "id&scaleid=$scale->id&action=edit\"> "; if ($incustom && isadmin()) { - $buttons .= "id&scaleid=$scale->id&action=down\">id&scaleid=$scale->id&action=down&sesskey=$USER->sesskey\"> "; } if (!$incustom && isadmin()) { - $buttons .= "id&scaleid=$scale->id&action=up\">id&scaleid=$scale->id&action=up&sesskey=$USER->sesskey\"> "; } - $buttons .= "id&scaleid=$scale->id&action=delete\">id&scaleid=$scale->id&action=delete&sesskey=$USER->sesskey\"> "; } $line[] = $buttons;