Commit 7ab38a32 authored by Aaron Wells's avatar Aaron Wells
Browse files

Don't show the "leave feedback" link to logged-out users

Bug 1431661: Logged-out users can't leave feedback anyway.
When they submit the feedback form, they are prompted to log
in. So, we may as well hide the "leave feedback" link for
logged-out users.

Change-Id: I5441c05e7dab5c50bd4e2ff24b841dfc13b2a133
parent 797df58e
......@@ -941,6 +941,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
* @param bool $editing Whether we are view edit mode or not
*/
public function get_annotation_feedback_for_view($annotationartefact, $view, $blockid, $html = true, $editing = false) {
global $USER;
if (!is_object($annotationartefact) || !is_object($view)) {
throw new MaharaException(get_string('annotationinformationerror', 'artefact.annotation'));
}
......@@ -972,7 +973,7 @@ class ArtefactTypeAnnotationfeedback extends ArtefactType {
$smarty->assign('annotationfeedbackcount', $annotationfeedbackcount);
$smarty->assign('annotationfeedback', $annotationfeedback);
$smarty->assign('editing', $editing);
$smarty->assign('allowfeedback', $annotationartefact->get('allowcomments'));
$smarty->assign('allowfeedback', $USER->is_logged_in() && $annotationartefact->get('allowcomments'));
$render = $smarty->fetch('artefact:annotation:annotationfeedbackview.tpl');
return array($annotationfeedbackcount, $render);
}
......
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