Commit 845da9e8 authored by rlyon's avatar rlyon
Browse files

Allow moderation of anonymous comments (Bug #1088609)



Adding the Make Public button visible when author id is
not set (anonymous user) only when owner of artefact is
also viewer of page.

Change-Id: I33b544a7772becb489b8019b9bce496bde670094
Signed-off-by: default avatarrlyon <rlyon@paradise.net.nz>
parent b518070f
......@@ -478,6 +478,10 @@ class ArtefactTypeComment extends ArtefactType {
$item->makepublicrequested = 1;
}
}
else if (!$item->deletedby && $item->private && !$item->author
&& $data->owner && $data->isowner && $item->requestpublic == 'author') {
$item->makepublicform = pieform(self::make_public_form($item->id));
}
if ($item->author) {
if (isset($authors[$item->author])) {
......@@ -746,7 +750,7 @@ function make_public_validate(Pieform $form, $values) {
$owner = $comment->get('owner');
$requester = $USER->get('id');
if (!$author || !$owner || !$requester || ($requester != $owner && $requester != $author)) {
if (!$owner || !$requester || ($requester != $owner && $requester != $author)) {
$form->set_error('comment', get_string('makepublicnotallowed', 'artefact.comment'));
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment