From 14ddbc473c3ccfc03773bd684cd41255cc951507 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 15 May 2001 18:38:57 +0000 Subject: - Created 2 new functions: + path_uri(): returns the fully-qualified URI of your drupal site. + path_img(): returns the image directory or http://image-server.com/ in case you prefer to load-balance bandwidth usage. Replaced all occurences of the variable "site_url" with path_uri() and removed "site_url" from "setting.module". - Drastically simplified the node_save() API, which should make the node-forms more secure. Updated "story.module", "book.module", "forum.module", "page.module" and "node.module" to reflect this change. This is needs more testing so hit it, beat it, tease it. - Fixed an occasional glitch in the configuration file loading logic. - Made "queue.module" display an informative notice when an anonymous user tries accessing the moderation queue. - Updated the hard-coded information in drupal.module a bit. --- modules/forum.module | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'modules/forum.module') diff --git a/modules/forum.module b/modules/forum.module index 5a14831c1..8e3693f5f 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -23,8 +23,11 @@ function forum_form($edit = array()) { } function forum_save($edit) { - global $status; - node_save(array_merge($edit, array(type => "forum", status => $status[posted]))); + global $user, $status; + + if (user_access($user)) { + node_save($edit, array(author => $user->id, body, cid, comment => category_comment($edit[cid]), moderate => topic_moderate($edit[tid]), promote => category_promote($edit[cid]), score => 0, status => $status[posted], tid, timestamp => time(), title, type => "forum", votes => 0)); + } } function forum_num_comments($nid) { -- cgit v1.2.3