summaryrefslogtreecommitdiff
path: root/modules/comment/controllers/comments.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-06-05 23:35:32 -0700
committerBharat Mediratta <bharat@menalto.com>2010-06-05 23:35:32 -0700
commit87fde3f360d557d48241d09cae4f25949e748d4f (patch)
treef832951bc829847a5d5298ce05792c4a0b3e91ff /modules/comment/controllers/comments.php
parent10895ca5298dc71410cfd87fe8a28c4f976c2234 (diff)
Create a UI under Admin > Settings > Comments where you can limit
comments only to registered users. It's simplistic, but is better than adding a permission since generally this setting will be used Gallery-wide. Fixes ticket #1002
Diffstat (limited to 'modules/comment/controllers/comments.php')
-rw-r--r--modules/comment/controllers/comments.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php
index 465b1bcd..c42ad24e 100644
--- a/modules/comment/controllers/comments.php
+++ b/modules/comment/controllers/comments.php
@@ -24,6 +24,9 @@ class Comments_Controller extends Controller {
public function create($id) {
$item = ORM::factory("item", $id);
access::required("view", $item);
+ if (!comment::can_comment()) {
+ access::forbidden();
+ }
$form = comment::get_add_form($item);
try {
@@ -69,6 +72,9 @@ class Comments_Controller extends Controller {
public function form_add($item_id) {
$item = ORM::factory("item", $item_id);
access::required("view", $item);
+ if (!comment::can_comment()) {
+ access::forbidden();
+ }
print comment::prefill_add_form(comment::get_add_form($item));
}