From 69603ede7a0d7567f37025eee713975282122d13 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Mon, 29 Dec 2008 21:09:44 +0000 Subject: Implemented bharat's suggestions to the comment module in preparation for the spam_filter module --- modules/comment/helpers/comment.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/comment/helpers/comment.php') diff --git a/modules/comment/helpers/comment.php b/modules/comment/helpers/comment.php index 92a9e54c..d6c3bd48 100644 --- a/modules/comment/helpers/comment.php +++ b/modules/comment/helpers/comment.php @@ -46,13 +46,15 @@ class comment_Core { $comment->text = $text; $comment->item_id = $item_id; $comment->url = $url; + $comment->ip_addr = Input::instance()->ip_address(); + $comment->user_agent = Kohana::$user_agent; $comment->created = time(); // @todo Figure out how to mock up the test of the spam_filter if (module::is_installed("spam_filter") && !TEST_MODE) { spam_filter::verify_comment($comment); } else { - $comment->visible = true; + $comment->published = true; } $comment->save(); @@ -75,6 +77,8 @@ class comment_Core { $comment->email = $email; $comment->text = $text; $comment->url = $url; + $comment->ip_addr = Input::instance()->ip_address(); + $comment->user_agent = Kohana::$user_agent; // @todo Figure out how to mock up the test of the spam_filter if (module::is_installed("spam_filter") && !TEST_MODE) { -- cgit v1.2.3