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
This commit is contained in:
stronk7
2004-08-29 23:28:57 +00:00
parent 8a2fe40709
commit 00083db4ea
+11 -1
View File
@@ -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 ) {