From: stronk7 Date: Sun, 29 Aug 2004 23:28:57 +0000 (+0000) Subject: Check that glossary is correct before edit categories. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=00083db4ea2f3c1d21e63d22454a4cdace586f6c;p=moodle.git Check that glossary is correct before edit categories. Bug 1838 (http://moodle.org/bugs/bug.php?op=show&bugid=1838) Merged from MOODLE_14_STABLE --- diff --git a/mod/glossary/editcategories.php b/mod/glossary/editcategories.php index 3dd0c09403..95476f48bc 100644 --- a/mod/glossary/editcategories.php +++ b/mod/glossary/editcategories.php @@ -32,6 +32,17 @@ error("Course module is incorrect"); } + if ($hook) { + if ($category = get_record("glossary_categories","id",$hook)) { + //Check it belongs to the same glossary + if ($category->glossaryid != $glossary->id) { + error("Glossary is incorrect"); + } + } else { + error("Category is incorrect"); + } + } + require_login($course->id); if ( !isteacher($course->id) ) { @@ -49,7 +60,6 @@ navmenu($course, $cm)); if ( $hook ) { - $category = get_record("glossary_categories","id",$hook); if ( $action == "edit" ) { if ( $confirm ) {