mirror of
https://github.com/moodle/moodle.git
synced 2025-01-21 07:28:31 +01:00
b0e3a92523
and require() to require_once()
28 lines
643 B
PHP
28 lines
643 B
PHP
<?PHP // $Id$
|
|
|
|
// Deletes a forum entirely.
|
|
|
|
require_once("../../config.php");
|
|
require_once("mod.php");
|
|
|
|
require_variable($f); // The forum to delete.
|
|
|
|
if (! $forum = get_record("forum", "id", $f)) {
|
|
error("Forum ID was incorrect");
|
|
}
|
|
|
|
if (! $course = get_record("course", "id", $forum->course)) {
|
|
error("Forum course was incorrect");
|
|
}
|
|
|
|
if (!isteacher($forum->course)) {
|
|
error("You are not allowed to do this");
|
|
}
|
|
|
|
if (! delete_instance($forum->id)) {
|
|
error("Could not delete that forum");
|
|
}
|
|
|
|
redirect("$CFG->wwwroot/mod/forum/index.php?id=$course->id");
|
|
?>
|