Skip to content

Commit

Permalink
rating MDL-23814 instantiate rating manager outside the "if" brackets…
Browse files Browse the repository at this point in the history
… because it is used in different "if" brackets
  • Loading branch information
mouneyrac committed Aug 17, 2010
1 parent 28bd3d9 commit 59b0f79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rating/rate.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,14 @@
die();
}

$rm = new rating_manager();

//check the module rating permissions
$pluginrateallowed = true;
$pluginpermissionsarray = null;
if ($context->contextlevel==CONTEXT_MODULE) {
$plugintype = 'mod';
$pluginname = $cm->modname;
$rm = new rating_manager();
$pluginpermissionsarray = $rm->get_plugin_permissions_array($context->id, $plugintype, $pluginname);
$pluginrateallowed = $pluginpermissionsarray['rate'];

Expand Down

0 comments on commit 59b0f79

Please sign in to comment.