MDL-48106 mod_glossary: Add missing sesskey checks

This commit is contained in:
Andrew Nicols
2015-01-05 13:38:01 +00:00
committed by Dan Poltawski
parent e72516ccde
commit 5770e51478
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -33,6 +33,7 @@
<tr>
<td colspan="2">
<div class="buttons">
<input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
<input type="hidden" name="id" value="<?php p($cm->id) ?>" />
<input type="hidden" name="action" value="<?php p($action) ?>" />
<input type="hidden" name="confirm" value="1" />
+4
View File
@@ -95,6 +95,7 @@ if ( $hook >0 ) {
if ( $action == "edit" ) {
if ( $confirm ) {
require_sesskey();
$action = "";
$cat = new stdClass();
$cat->id = $hook;
@@ -128,6 +129,7 @@ if ( $hook >0 ) {
} elseif ( $action == "delete" ) {
if ( $confirm ) {
require_sesskey();
$DB->delete_records("glossary_entries_categories", array("categoryid"=>$hook));
$DB->delete_records("glossary_categories", array("id"=>$hook));
@@ -165,6 +167,7 @@ if ( $hook >0 ) {
<td align="$rightalignment" style="width:50%">
<form id="form" method="post" action="editcategories.php">
<div>
<input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
<input type="hidden" name="id" value="<?php p($cm->id) ?>" />
<input type="hidden" name="action" value="delete" />
<input type="hidden" name="confirm" value="1" />
@@ -188,6 +191,7 @@ if ( $hook >0 ) {
} elseif ( $action == "add" ) {
if ( $confirm ) {
require_sesskey();
$dupcategory = $DB->get_records_sql("SELECT * FROM {glossary_categories} WHERE ".$DB->sql_like('name','?', false)." AND glossaryid=?", array($name, $glossary->id));
if ( $dupcategory ) {
redirect("editcategories.php?id=$cm->id&amp;action=add&amp;name=$name", get_string("duplicatecategory", "glossary"), 2);