Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

This file is not linked to or used by anything yet, but I've found it

useful to delete forums properly while testing stuff.
  • Loading branch information...
commit 238a826393f8cbd3be2c8b493185db5eccb36d7a 1 parent ef58b82
authored August 02, 2002

Showing 1 changed file with 27 additions and 0 deletions. Show diff stats Hide diff stats

  1. 27  mod/forum/delete.php
27  mod/forum/delete.php
... ...
@@ -0,0 +1,27 @@
  1
+<?PHP // $Id$
  2
+
  3
+//  Deletes a forum entirely.  
  4
+
  5
+    require("../../config.php");
  6
+    require("mod.php");
  7
+
  8
+    require_variable($f);  // The forum to delete.
  9
+
  10
+    if (! $forum = get_record("forum", "id", $f)) {
  11
+        error("Forum ID was incorrect");
  12
+    }
  13
+
  14
+    if (! $course = get_record("course", "id", $forum->course)) {
  15
+        error("Forum course was incorrect");
  16
+    }
  17
+
  18
+    if (!isteacher($forum->course)) {
  19
+        error("You are not allowed to do this");
  20
+    }
  21
+
  22
+    if (! delete_instance($forum->id)) {
  23
+        error("Could not delete that forum");
  24
+    }
  25
+
  26
+    redirect("$CFG->wwwroot/mod/forum/index.php?id=$course->id");
  27
+?>

0 notes on commit 238a826

Please sign in to comment.
Something went wrong with that request. Please try again.