Commit 84dfa408 authored by Robert Boloc's avatar Robert Boloc Committed by Robert Lyon
Browse files

The $anonfeedback variable has not been used since v1.2 (Bug 1281121)



The only place that calls the get_view_from_token() does nothing with
the output. It is left over code from version 1.2 where the token was
checked to see if an anonymous user could add feedback to a view or
artefact.

The code changed completely in v1.3 where things like tutors came into
play so I've removed the legacy old code from view/artefact.php

Change-Id: Id1bf9732d87d4ac50ab2d12d1279b400d5f6ee30
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent caf7cc47
......@@ -2186,22 +2186,6 @@ function get_view_from_token($token, $visible=true) {
return $viewid;
}
/**
* Determine whether a view is accessible by a given token
*/
function view_has_token($view, $token) {
if (!$view || !$token) {
return false;
}
return record_exists_select(
'view_access',
'view = ? AND token = ? AND visible = ?
AND (startdate IS NULL OR startdate < current_timestamp)
AND (stopdate IS NULL OR stopdate > current_timestamp)',
array($view, $token, (int)$visible)
);
}
/**
* get the views that a user can see belonging
* to the given users
......
......@@ -134,7 +134,6 @@ $javascript = array('paginator', 'viewmenu', 'expandable');
$extrastylesheets = array('style/views.css');
if ($artefact->get('allowcomments')) {
$anonfeedback = !$USER->is_logged_in() && view_has_token($viewid, get_cookie('viewaccess:'.$viewid));
$addfeedbackform = pieform(ArtefactTypeComment::add_comment_form(false, $artefact->get('approvecomments')));
$extrastylesheets[] = 'style/jquery.rating.css';
$javascript[] = 'jquery.rating';
......@@ -214,7 +213,6 @@ $smarty->assign('feedlink', $feedlink);
if (isset($addfeedbackform)) {
$smarty->assign('enablecomments', 1);
$smarty->assign('anonfeedback', $anonfeedback);
$smarty->assign('addfeedbackform', $addfeedbackform);
}
$smarty->assign('objectionform', $objectionform);
......
Markdown is supported
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