From 23ca7a2d8832aa16107cf7002c35170ae2b87a1c Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 1 Nov 2001 17:04:20 +0000 Subject: - Another batch of updates/improvements: + introduced basic node permissions ("create", "delete", "update" and "view") at the node level: it's up to the "<$node->type>_module" to hide gory details (if any). + made the "blog it"-feature in the blog and import module work with the new node system, in specific with the new centralized forms. + made it possible to update blogs. + made the page module work with the new node system. + various smaller improvements. --- modules/forum/forum.module | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'modules/forum/forum.module') diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 5364b7e34..f33ad51f5 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -1,6 +1,21 @@ "discussion forum"); + + return $info[$field]; +} + +function forum_access($op, $node) { + + if ($op == "view") { + return $node->nid && $node->status && !$node->moderate; + } + + return user_access("adminster nodes"); +} + function forum_link($type) { if ($type == "page" && user_access("access content")) { $links[] = "". t("forum") .""; @@ -24,18 +39,12 @@ function forum_form($node) { function forum_save() { - if (user_access("administer nodes")) { - if ($node->nid) { - return array(); - } - else { - return array("promote" => 0, "moderate" => 0, "status" => 1); - } + if ($node->nid) { + return array(); } else { - return 0; + return array("promote" => 0, "moderate" => 0, "status" => 1); } - } function forum_num_comments($nid) { -- cgit v1.2.3