mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-20 03:19:13 -04:00
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
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user